fix(ci): use the suppression comment form CodeQL honors - #251
Merged
Conversation
The in-code suppressions have never dismissed an alert: every dismissal in the repo was done by hand. CodeQL's shared AlertSuppression library matches `codeql[query-id]` only when the comment starts its own line, and then covers the line below it, so all nine trailing `# codeql[...]` comments were inert. - Rewrite the nine suppressions as trailing `# lgtm[query-id]`, the form that covers its own line, so the flagged expression is inside the annotated range. - Split the two multi-line logger calls in the email service: a trailing annotation on the line that opens a call covers no argument. - Say in the CodeQL config and the CI comment which form works and why.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
simonvanlierde
added a commit
that referenced
this pull request
Sep 9, 2026
Keeps main's `lgtm[py/clear-text-logging-sensitive-data]` on the rate-limit log. This branch had dropped that marker on the grounds that the in-code form never suppressed anything, which #251 has since fixed by moving to the form CodeQL honors. The marker stays; the comment above it still says why the value is safe.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
AlertSuppression.qlpacks andadvanced-security/dismiss-alertsin CI have never dismissed an alert: the dismiss step ends atIndexed 11 code scanning alert(s)and closes nothing, because the uploaded SARIF carries zero suppressions. Every dismissal in this repo was done by hand.The cause is comment placement. In CodeQL's shared
AlertSuppression.qll,codeql[query-id]matches only when the comment begins its own line, and then covers the line below it. All nine# codeql[...]comments here are trailing, so none match.lgtm[query-id]covers its own line, which is what a trailing annotation needs.# lgtm[query-id].The own-line
# codeql[...]form was tried first and rejected: ruff reports it as ERA001, and inside a callruff formatsplits the arguments and moves the flagged expression off the covered line.prekpasses on all touched files. The real check is the merge: the dismiss step should close alerts 164 and 165, both false positives on a masked recipient token. If it doesn't, they stay open and nothing is worse than today.