Repository navigation
Document how CodeQL alerts are handled in this repo - #43
Conversation
In-source codeql[...] comments do not suppress alerts under code scanning default setup: after PR #42 landed, four alerts reappeared at lines with correctly placed comments. Record that in the harness guidance so the next person does not repeat the investigation, along with the dismissal convention and what adopting advanced setup would take.
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Reviewer's GuideDocumentationDocument the repo’s CodeQL alert behavior, dismissal guidance, and conditions for revisiting the standing decision.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
[Low impact] This documentation change appears safe to merge.
|
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Secrets | Nov 18, 2026 5:34p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="docs/repo-harness-guidance.md" line_range="136" />
<code_context>
+- `py/clear-text-logging-sensitive-data` fires on the report print helpers (`report_sources.py`, `report_products.py`, `report_summary.py`). They print derived billing figures for a local terminal report — no credentials, tokens, or raw API payloads — so the standing decision is to dismiss as `won't fix` with that rationale on the alert.
</code_context>
<issue_to_address>
**Sensitive billing output goes unreviewed**
When a maintainer follows the standing dismissal and a report's stdout is captured in shared CI or build logs, the dismissal policy hides `py/clear-text-logging-sensitive-data` alerts even though the report helpers print billing amounts and usage figures; when stdout is captured in shared build logs, those details can be exposed without the alert prompting review or redaction.
Qualify the dismissal as safe only for strictly local output and preserve or re-evaluate the alert when report output can reach shared logs.
</issue_to_address>
### Comment 2
<location path="docs/repo-harness-guidance.md" line_range="134" />
<code_context>
+- In-source `# codeql[query-id]` comments are **not applied** by GitHub code scanning here. A correctly placed comment (alone on the line immediately above the flagged line, which is the documented shape) still produces an open alert on every analysis — verified on `main` after PR #42. Keep the comments: they record intent for CLI/IDE readers and are correct CodeQL syntax, but do not expect them to close an alert.
</code_context>
<issue_to_address>
**Persistent dismissals misdescribed**
When a maintainer dismisses an alert while the finding remains in analyzed code, gitHub retains a dismissed alert's state across analyses while the finding remains unchanged, so saying each analysis produces an open alert implies that the documented dismissal workflow does not stick and misleads maintainers about what they will see.
Clarify that the comment does not suppress the finding from analysis, but dismissing the alert persists its dismissed state unless a relevant code change causes it to reopen.
</issue_to_address>Sourcery on PR #43, both fair: - 'an open alert on every analysis' overstated it. The comment does not stop the alert being created, but a dismissal persists while the code location is unchanged and only reappears when a nearby edit shifts the line. Confirmed by the 17:01 analysis, which re-found the six dismissed alerts without reopening them and only filed four new ones. - The blanket 'safe to dismiss because it is local output' rule needs a condition: it holds only while report stdout stays local. Name the current CI safeguards and say to revisit the dismissal if that changes.
Muse Spark review of PR #43: the 'output stays local' justification listed the two CI safeguards but implied nothing else runs the report with --dry-run. scripts/smoke does, with a fake token, writing to /tmp, and is not part of CI. Also mark the 280-character dismissal-comment limit as API-enforced, which it is (a 310-character comment was rejected earlier).
|
|
@coderabbitai review |
Action performed
|



Why
PR #42 moved the repo's
# codeql[...]suppression comments onto the documented line (alone, immediately above the flagged line). The first scan of the merged commit created 4 new alerts on lines with correctly placed comments (report_sources.py:28,30,report_products.py:94,96), which settles the question the PR left open: under code scanning default setup, in-source suppression is not applied — the alerts are still created.That knowledge is worth keeping, but
TO_DO.mdis a work list, not a reference, and this isn't work anyone needs to queue. It belongs with the other CI/security conventions indocs/repo-harness-guidance.md.Change
New "CodeQL alert handling" block under CI, Hooks, Security, And Hygiene:
codeql[...]comments do not stop an alert being created — keep them as intent markers for CLI/IDE readers, don't expect suppression.PATCH /repos/{owner}/{repo}/code-scanning/alerts/{n}withstate=dismissed,dismissed_reason=won't fix,dismissed_comment(≤280 chars). Classic tokens withrepoare accepted even though the REST docs listsecurity_events.py/clear-text-logging-sensitive-data: dismiss aswon't fix, because the print helpers emit derived billing figures to the terminal of whoever ran the report — no credentials, tokens, or raw API payloads. Carries the condition that output stays local, with the two current safeguards named and an instruction to revisit the dismissal if that changes.advanced-security/dismiss-alertsagainst a SARIF artifact, i.e. advanced setup rather than default. Not adopted; revisit only if volume becomes unmanageable.State after this
Docs-only;
./scripts/docs-checkpasses. No changelog entry (maintainer guidance, not user-visible behavior).Summary by Sourcery
Document the repository’s CodeQL alert-handling conventions and security decisions.
Enhancements:
Documentation:
Summary by CodeRabbit