Skip to content

CodeQL: PR scans see results; new errors and warnings fail; scan main daily (Part of #7153) - #7154

Merged
squid-shepherd[bot] merged 4 commits into
mainfrom
feat/codeql-ratchet
Oct 30, 2026
Merged

squid-shepherd[bot] merged 4 commits into
mainfrom
feat/codeql-ratchet

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 30, 2026 •

Copy link
Copy Markdown
Owner

Part of #7153

Problem

Open code-scanning alerts on main went from 34 to 459 in five weeks, while every PR's CodeQL check read "No new alerts". PR analyses held no results at all: #6719 added alerts and its SARIF has 0, while main's has 405. So the check couldn't stop anything.

What this does

  • Turns off diff-informed analysis (CODEQL_ACTION_DIFF_INFORMED_QUERIES: "false"). Tested on this PR: its analysis went from 0 results to 425.
  • Adds tests/tools/codeql_new_alerts.py, which compares a PR's results with main's latest analysis. A result is new only when all of these hold: it's in a file the PR changed, its rule and line hash aren't on main, the same rule and hash aren't elsewhere on main (moved code), and the file has more of that rule than main does (a hash also changes when a neighbouring line does).
  • Enforces errors and warnings only (owner 2026-10-30). A new one fails Analyze, and ci-gate holds the PR. Notes are reported, never blocking. py/regex/unmatchable-* and py/ineffectual-statement are report-only, because they're proven false on this code: 134 of them were dismissed with written reasons on CodeQL: PR scans see nothing and open alerts grew from 34 to 459 #7153.
  • Scans main daily instead of weekly.
  • Marks CodeQL as proven in gate_controls.py and lowers the unproven count to 20.

Evidence

Replayed on this PR's real results against main across all files: 21 new, 7 blocking. Those 7 include three py/redundant-comparison warnings in gitgalaxy/core/detector.py and one new py/unsafe-cyclic-import. Limited to a PR's changed files, the count on any one PR will be far smaller.

Before the count check, the same data gave 25 new, about 9 of them likely hash churn.

Cost (.claude/rules/ci-workflows.md)

  • Reach: unchanged. Of the last 60 merged PRs, 25 run CodeQL. PRs changing Python only under tests still skip it, which is a separate decision on CodeQL: PR scans see nothing and open alerts grew from 34 to 459 #7153.
  • Runner time: this PR's analysis took about 5 min with diff-informed off, against about 4.9 min in docs/ci.md. One run, not a sample.
  • main: 6 more scans a week.

Risks

  • A PR can be blamed for a result another PR added since the last daily scan, if both touched the same file.
  • The step's baseline fetch fails open: if main's analysis can't be read, the step passes without checking.
  • Blocking results add some fix loops. That's why notes don't block.

Checks

🤖 Generated with Claude Code

A PR's analysis held no results (#6719: 0, main 405), so the check read 'No new alerts'
whatever the PR did. Diff-informed analysis goes off, and a report-only step compares the
PR's results with main's latest analysis in the files it changed. main is scanned daily.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 30, 2026 15:13
@squid-shepherd
squid-shepherd Bot disabled auto-merge October 30, 2026 15:26
@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #7154 @ e5fb418: 1 failed check(s)

== full-suite part 1/2 (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/41075642450/job/124138291321
repro: python -m pytest -q tests/tools/test_change_classifier.py::test_the_committed_list_is_fresh tests/tools/test_workflow_inputs.py::test_every_path_filtered_workflow_triggers_on_what_it_reads
failing tests: tests/tools/test_change_classifier.py::test_the_committed_list_is_fresh tests/tools/test_workflow_inputs.py::test_every_path_filtered_workflow_triggers_on_what_it_reads
errors:
fail-on-cache-miss: false
[--ai-guardrails] [--fail-on-secrets]
[--fail-on-malware]
--fail-on-secrets CI/CD Gate: Fail build if hardcoded secrets are
--fail-on-malware CI/CD Gate: Fail build if ML threat inference flags
CI/CD Gate: Fail build if any file exceeds this risk
CI/CD Gate: fail the build if any file's structural
E AssertionError: docs_read_by_tests.txt is stale: python tests/tools/change_classifier.py --write
tests/tools/test_change_classifier.py:88: AssertionError
E AssertionError: add these to the workflow's pull_request paths (or to ALLOW, with the reason): codeql.yml: tests/tools/codeql_new_alerts.py
tests/tools/test_workflow_inputs.py:36: AssertionError
FAILED tests/tools/test_change_classifier.py::test_the_committed_list_is_fresh - AssertionError: docs_read_by_tests.txt is stale: python tests/tools/change_classifier.py --write
FAILED tests/tools/test_workflow_inputs.py::test_every_path_filtered_workflow_triggers_on_what_it_reads - AssertionError: add these to the workflow's pull_request paths (or to ALLOW, with the reason): codeql.yml: tests/tools/codeql_new_aler
##[error]Process completed with exit code 1.
log tail:
archive: true
env:
PYTHONUTF8: 1
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
OMP_NUM_THREADS: 1
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
##[endgroup]
With the provided path, there will be 1 file uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: test-times-part-1.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 106875
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 7f8bfd92593785b113315627f2193ab2b3cfc731605b95b88ffc5361f700bcfb
Finalizing artifact upload
Artifact test-times-part-1 successfully finalized. Artifact ID 12987819939
Artifact test-times-part-1 has been successfully uploaded! Final size is 106875 bytes. Artifact ID is 12987819939
Artifact download URL: https://github.com/squid-protocol/gitgalaxy/actions/runs/41075642450/artifacts/12987819939
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.0
Temporarily overriding HOME='/home/runner/work/_temp/9c76c2e4-33c5-4ae5-a1e8-37b42ebc7721' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (fbbc28c) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then). Until then it is a draft and runs the cheap audits only; re-adding the label marks it ready, which starts the full set on that head.

@squid-shepherd
squid-shepherd Bot marked this pull request as draft October 30, 2026 15:34
@squid-shepherd squid-shepherd Bot added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md labels Oct 30, 2026
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 30, 2026 15:41
@squid-shepherd squid-shepherd Bot added shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #7154 @ fbbc28c: 13 failed check(s)

== db2 (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949892/job/124153396075
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== db2 ${{ matrix.shard }} (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949793/job/124153373084
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== det (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949793/job/124153370964
repro: tests/tools/box/heavy-run.sh python tests/tools/proof_sweep.py --det-only --skip-db2 --cases --work /tmp/gitgalaxy-scratch/ci-digest/sweep
errors:
##[error]Process completed with exit code 1.
log tail:
compression-level: 6
overwrite: false
include-hidden-files: false
archive: true
env:
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
##[endgroup]
With the provided path, there will be 182 files uploaded
Artifact name is valid!
Root directory input is valid!
Uploading artifact: det-sweep-ledger.zip
Beginning upload of artifact content to blob storage
Uploaded bytes 157404
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is 9a2ce501bd8cb1af5f39a4c6ef6d8a17803264b7be4e3ae858efc71c96d6a12f
Finalizing artifact upload
Artifact det-sweep-ledger successfully finalized. Artifact ID 12991115288
Artifact det-sweep-ledger has been successfully uploaded! Final size is 157404 bytes. Artifact ID is 12991115288
Artifact download URL: https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949793/artifacts/12991115288
Post job cleanup.
[command]/usr/bin/git version
git version 2.56.0
Temporarily overriding HOME='/home/runner/work/_temp/ef76d5b6-f2b0-40ba-a87a-41110e3297ac' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

== durations key (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949927/job/124153367059
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== full-suite (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949927/job/124153366428
repro: python -m pytest -q tests
errors:
##[error]Process completed with exit code 1.
log tail:
Commit: 21505ad2541d5be6135ed84fc33697146cf75b8e
Build Date: 2026-10-21T00:45:21Z
Worker ID: {568e687a-a5c8-4183-ad27-733030cc8d9d}
Region: westus2
Cloud: Azure
##[endgroup]
##[group]Operating System
Ubuntu
24.04.5
LTS
##[endgroup]
##[group]Runner Image
Image: ubuntu-24.04
Version: 20261025.353.1
Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20261025.353/images/ubuntu/Ubuntu2404-Readme.md
Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20261025.353
##[endgroup]
##[group]GITHUB_TOKEN Permissions
Contents: read
Metadata: read
##[endgroup]
Secret source: Actions
Cache mode: write
Prepare workflow directory
Prepare all required actions
Complete job name: full-suite
##[group]Run echo "full-suite parts: $PARTS (tested-tree skip: $SKIP, suite plan: $PLAN)"
echo "full-suite parts: $PARTS (tested-tree skip: $SKIP, suite plan: $PLAN)"
# #4935: "skipped" is a pass only when the gate proved this tree green on the PR; otherwise it is a failure.
# #6278: or when the suite plan proved the PR changes only prose no test or engine code opens (mode skip).
test "$PARTS" = "success" || { test "$PARTS" = "skipped" && { test "$SKIP" = "true" || test "$PLAN" = "skip"; }; }
shell: /usr/bin/bash -e {0}
env:
PARTS: cancelled
SKIP:
PLAN:
##[endgroup]
full-suite parts: cancelled (tested-tree skip: , suite plan: )
##[error]Process completed with exit code 1.
Cleaning up orphan processes

== full-suite part ${{ matrix.group }}/${{ needs.shard-plan.outputs.splits }} (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949927/job/124153367560
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== ground-truth part ${{ matrix.shard }} (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949813/job/124153380414
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== ground-truth-warm (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949813/job/124153379845
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== plan the suite parts (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949927/job/124153367980
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== shard ${{ matrix.group }}/${{ needs.plan.outputs.splits }} (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949892/job/124153396446
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== shard ${{ matrix.shard }} (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949793/job/124153372135
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== store the suite's durations (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949927/job/124153369132
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

== suite time budget (#5166) (cancelled) -- infra
https://github.com/squid-protocol/gitgalaxy/actions/runs/41081949927/job/124153368949
repro: python tests/tools/pr_gates.py --fast
log tail:
(log unavailable: gh: HTTP 404)

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

Owner 2026-10-30: enforce errors and warnings only. Notes and the rules proven false here
are still reported. A result is new only if the file gained that rule, and code moved from
elsewhere on main doesn't count, so a shifted hash can't fail a PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@squid-shepherd squid-shepherd Bot removed the shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md label Oct 30, 2026
@squid-protocol squid-protocol changed the title CodeQL: report the results a PR adds; scan main daily (Part of #7153) CodeQL: PR scans see results; new errors and warnings fail; scan main daily (Part of #7153) Oct 30, 2026
@squid-shepherd squid-shepherd Bot removed the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

CI shepherd: the head of this PR (5f219b8) is not the one a maintainer labelled shepherd:merge on (new commits, or never approved), so the label was removed and nothing merges unreviewed code. Re-add the label when the new head is ready (shepherd:reapprove marks this PR until then). Until then it is a draft and runs the cheap audits only; re-adding the label marks it ready, which starts the full set on that head.

@squid-shepherd
squid-shepherd Bot marked this pull request as draft October 30, 2026 16:38
@squid-shepherd squid-shepherd Bot added shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md and removed shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md labels Oct 30, 2026
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 30, 2026 16:47
@squid-shepherd squid-shepherd Bot added shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md and removed shepherd:reapprove Bot: new commits dropped shepherd:merge; re-add it to merge this head. Guide: docs/ci.md labels Oct 30, 2026
@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 30, 2026 16:56
@squid-shepherd squid-shepherd Bot removed the shepherd:retrying Bot: an infra/flake rerun is pending on this head. Guide: docs/ci.md label Oct 30, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant