Quiet known-noise CodeQL alerts without losing coverage
Merged
JE
2mo ago+51+51+01234567890123456789-33-33-01234567890123456789
The security-alert cleanup sweep found 58 of this repo's 66 open CodeQL alerts came from three noise sources, none of them defects. This mutes each at the source rather than by perpetual dismissal:
- Generated Python (24×
py/unused-import, all ingenerated/services/): handled exactly as the config file's own comment prescribes — the SARIF filter now stripspython/src/basecamp/generated/with a(?!services/_)lookahead, so the hand-writtenservices/_base.pyandservices/_async_base.pystay scanned. Regex verified against representative paths (generated files stripped, the two_files andauth.pyuntouched). python/tests/(26 alerts: empty excepts, unreachable statements, unused locals, plus two false-positivepy/incomplete-url-substring-sanitizationhighs on\"https://3.basecamp.com\" in urlassertions): added topaths-ignoreunder the existing test-infrastructure entries.py/ineffectual-statement(8 alerts): every hit is a...Protocol/overload stub body inauth.py/async_auth.py— idiomatic typing code the query mistakes for a defect, growing with every future Protocol method. Excluded viaquery-filters, mirroring the existingjava/class-name-matches-super-classprecedent.
The existing open alerts in these categories were already dismissed with matching reasons; this change keeps them from coming back. The remaining 8 open alerts (Scorecard process findings) are untouched.
Summary by cubic
Quiets 58 known-noise CodeQL alerts without losing coverage of the hand-written Python service bases. Previously, generated Python, tests, and the py/ineffectual-statement query reopened false positives; now they are filtered or excluded.
- SARIF filter: centralized in
.github/codeql/sarif-filter.jqand used by the workflow; the test now runs the same program. Dropspython/src/basecamp/generated/results exceptgenerated/services/_via a lookahead so_base.pyand_async_base.pystay scanned; fixture asserts both are kept. - Ignore tests: add
python/tests/topaths-ignore. - Query exclusion: add
py/ineffectual-statementtoquery-filtersto avoid Protocol/overload...stub false positives. - Existing dismissed alerts in these categories will not return; the remaining 8 Scorecard alerts are unchanged. No migration required.