[2026 errata] Sprint 2 polling scripts report success and exit 0 when GitHub issue creation or update fails
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Start in 2026/working/polling/scripts/: create_issues.post_issue() and main(), then sync_sprint2.sync_github_issues() and main(). Each returns or appends success even when the API call fails, so exit code and summary are wrong. The payload's stub reproduction shows the expected exit code 2 and the failure list. Linked PR #163 already targets this, so check it before starting.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Affected section
Other (Sprint 2 polling tooling under 2026/working/polling/scripts/)
Where does the issue appear?
GitHub source
What is incorrect?
create_issues.py and sync_sprint2.py report success, and exit with status 0, when every GitHub API call they make fails. Both scripts document a failure exit code in their module docstrings:
EXIT CODES
0 success
1 configuration error (missing token, missing args, missing file)
2 GitHub API error (after creating any issues, prints which ones succeeded)
create_issues.py's docstring promises exit code 2 plus a list of the issues that did succeed; sync_sprint2.py promises 2 GitHub API error during reconciliation or firing. Neither is implemented for issue creation or issue updates:
create_issues.post_issue()returnsNoneon a non-201 response (the same value it returns for a dry run).create_issues.main()ignores the return value, never counts failures, and ends withreturn 0.sync_sprint2.sync_github_issues()callscreate_issues.post_issue(...)and discards the result, then unconditionally runssummary["created"].append(entry["id"]). In the update paths (force_patchand the changed-entry loop),patch_issue()returnsFalseon failure, butsummary["updated"].append(...)is also executed unconditionally.sync_sprint2.main()finishes withreturn 0after printingCreated new issues: N,Updated existing issues: N, and the "NEXT STEPS: git add ... issues.json" block. It has already written the newissues.jsonregistry before any issue was fired (Phase 4 runs before Phase 5), so a failed run leaves a registry that claims entries are synchronised while the GitHub issues do not exist.
Only the label upsert (ensure_labels) calls sys.exit(2) on an API failure.
Proposed correction
- Have
post_issue()distinguish "dry run" from "failed" (for example, raise a dedicated exception or return a sentinel), count failures increate_issues.main(), print the entries that succeeded and the ones that failed, and return2if any failed. - In
sync_sprint2.sync_github_issues(), append tosummary["created"]/summary["updated"]only when the call succeeded, track afailedlist, and havemain()return2when it is non-empty. Print the failures in the summary and suppress the "NEXT STEPS" block when anything failed. - Consider writing
issues.jsononly after the GitHub mutations succeed, or print an explicit warning that the registry was updated while firing failed.
Supporting evidence
Reproduced on origin/main @ 9253e38, Python 3.11, no network access. GitHub's API is replaced with a stub that answers 401 Bad credentials to every request.
create_issues.py (run from 2026/working/polling/scripts/):
python -c "
import os,sys
os.environ['GH_TOKEN']='x'
sys.argv=['create_issues.py','--form-url','https://example.test/form','--skip-labels','--only-ids','LLM01,TA-CFAS']
import create_issues as c
calls=[]
def fake(method,path,token,body=None):
calls.append((method,path)); return 401,{'message':'Bad credentials'}
c._request=fake
c.time.sleep=lambda s:None
rc=c.main()
print('requests:',calls)
print('exit code:',rc)
"
Output (trimmed to the relevant lines):
[track-b] creating issues
! failed to create '[Track B] Feedback: LLM01 — Prompt Injection': status 401 body {'message': 'Bad credentials'}
[track-a] creating issues
! failed to create '[Track A] Feedback: Compositional Fine-Tuning Alignment Subversion': status 401 body {'message': 'Bad credentials'}
done.
requests: [('POST', '/repos/GenAI-Security-Project/GenAI-LLM-Top10/issues'), ('POST', '/repos/GenAI-Security-Project/GenAI-LLM-Top10/issues')]
exit code: 0
Both creations failed and the script still ends with done. and exit code 0 instead of 2.
sync_sprint2.py (same directory):
python -c "
import time
time.sleep=lambda s:None
import create_issues as ci, sync_sprint2 as ss
ci._request=lambda *a,**k:(401,{'message':'Bad credentials'})
ss._request=lambda *a,**k:(401,{'message':'Bad credentials'},{})
cfg={'labels':[],'track_a':[],'track_b':[{'id':'LLM01','title':'Prompt Injection','file':'LLM01_PromptInjection.md'}]}
s=ss.sync_github_issues(cfg,{},'https://example.test/form','x',False,[])
print('created:',s['created'])
existing=[{'number':36,'title':'t','labels':[{'name':'LLM01'}]}]
s=ss.sync_github_issues(cfg,{},'https://example.test/form','x',False,existing,force_rebuild=True)
print('updated:',s['updated'])
"
Output:
! failed to create '[Track B] Feedback: LLM01 — Prompt Injection': status 401 body {'message': 'Bad credentials'}
created: ['LLM01']
[issues] --force-rebuild: re-rendering covered issues with current templates...
updated: ['LLM01']
! patch #36 failed: status 401 body {'message': 'Bad credentials'}
The summary lists LLM01 as created and as updated even though the create and the patch both failed.
Why it matters: these scripts are run by hand to fire the 20 Sprint 2 feedback issues and to reconcile them with the registry that the Apps Script form reads. A token with insufficient scope, an expired token, or a secondary rate limit produces a run that looks successful in the summary and in any wrapper that checks the exit status, while the corresponding issues were never created or updated. The only signal is an interleaved ! line in the log.
Acknowledgments
- I checked the published release and the canonical GitHub source for an existing correction.
- I agree to follow the OWASP Code of Conduct.
- Lingua principale
- JavaScript
- Stelle
- 177
- Fork
- 57
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di GenAI-Security-Project/GenAI-LLM-Top10
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
GenAI-Security-Project/GenAI-LLM-Top10#176 · 1 commento · 1 reazione ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 66/100
GenAI-Security-Project/GenAI-LLM-Top10#131 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
[Release feedback] Make Zenodo source bundles reproducible across checkoutsForse già presa @drk-ram l’ha presa 20 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 32/100
Tutte le issue di GenAI-Security-Project/GenAI-LLM-Top10
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
test(ci): flake in external-api-stream-auth.test.js waitForRun abort test (hardcoded 20ms sleep)Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
Fei2411/DeepSeek-Bot#2978 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Stars-and-Stripes-Honor-Flight/sshf-ui#352 ·
I maintainer di solito rispondono entro 1 giorno
-
[NEW TOOL] Clipping AIAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ArshdeepGrover/ai-tools-manager#284 ·
I maintainer di solito rispondono entro 6 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
career-ops-hq/career-ops#8333 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno