From 8e8998b2dff2af07d94de84abf105ab91f2e2a95 Mon Sep 17 00:00:00 2001 From: Scott McCarty Date: Wed, 4 Nov 2026 20:39:17 -0500 Subject: [PATCH] fix: run codeql inside `sdlc ci`, with one test finding baselined `[tool.sdlc.ci] skip = ["codeql"]` kept CodeQL out of the one tier anything enforces. Constitution XII says CI runs push's checks except Gourmand and Gatehouse; CodeQL is one of push's verdicts. With the skip in place the only thing that could block on a CodeQL finding was the pre-push hook -- a developer's machine, one `--no-verify` away -- while the required `sdlc ci` reported green. The comment justifying the skip said the CodeQL Action covered it. The Action does run on pull requests here, but its check is advisory: no ruleset requires it, so a finding annotated the PR and merged anyway. With CodeQL in, one finding appears: `py/overly-permissive-file` at test/test_api.py:207, the `os.chmod(target, 0o644)` in a `finally` that puts back the mode the test took away to prove CrunchLog raises DataFileError on an unreadable file. The file is in tmp_path and the chmod is the cleanup, not a permission the product ever sets. Recorded in .sdlc/codeql-baseline.json, so a new finding still fails. One of 24 repos; python-sdlc#19 then refuses this config so it cannot come back. RT#1552. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01R7Y1jesjfgxHeqtKJCvay6 --- .sdlc/codeql-baseline.json | 7 +++++++ pyproject.toml | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 .sdlc/codeql-baseline.json diff --git a/.sdlc/codeql-baseline.json b/.sdlc/codeql-baseline.json new file mode 100644 index 0000000..5abb85a --- /dev/null +++ b/.sdlc/codeql-baseline.json @@ -0,0 +1,7 @@ +[ + { + "rule": "py/overly-permissive-file", + "path": "test/test_api.py", + "fingerprint": "cbf6d22c405058b:1" + } +] diff --git a/pyproject.toml b/pyproject.toml index c447e03..9cf070a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,8 +111,3 @@ warn_unused_configs = true # rather than scanning nothing and calling it a pass. skip = ["semgrep"] -[tool.sdlc.ci] -# The CodeQL Action job uploads to the Security tab and annotates new -# alerts on the pull request, so CI does not analyse a second time. -# The push tier still gates on it. -skip = ["codeql"]