Skip to content

Commit 625ed15

Browse files
authored
fix(ci): drop the CodeQL rule that only ever fires on generated code (#292)
cs/nested-if-statements has fired four times in this repository and every one was inside System.Text.RegularExpressions source-generator output — #157/#158 (2026-07-16, QueryBuilder.Pro) and #307/#308 (2026-08-17, Core). Never once in code anyone wrote. paths-ignore: **/obj/** was added for exactly this after the first pair and did not stop the second, which is the part worth recording. For a compiled language the extractor takes compilation units from the BUILD, and generator output has no file in the checkout for a path filter to match: it is reported under a synthetic obj/.../generated/… path that never existed on disk. A path filter cannot reach it by construction, so a third variation on the same tweak would have failed the same way. Excluding the rule instead. It is a maintainability rule, not a security one; SonarCloud already covers that ground for this repo; and a rule at a 100% false-positive rate across two different source generators will keep firing every time a generator changes shape. paths-ignore stays — it is still correct for anything a build genuinely leaves in the checkout. The two open alerts were dismissed separately at the repository level, since resolving a finding does not close its alert. Their first justification said the build output "was never excluded from the CodeQL paths", which is wrong — it was, since 3f0c0bd; both dismissals were rewritten to state the real reason.
1 parent 145c467 commit 625ed15

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

.github/codeql/codeql-config.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
name: "NeoReports CodeQL config"
22

3+
# Only reaches files that exist in the checkout. Kept because it is correct for anything
4+
# a build leaves behind on disk — but see query-filters below for why it is not enough.
35
paths-ignore:
46
- "**/obj/**"
57
- "**/bin/**"
8+
9+
# `cs/nested-if-statements` has fired four times in this repository and every one of them was
10+
# inside System.Text.RegularExpressions source-generator output — alerts #157/#158 (2026-07-16)
11+
# and #307/#308 (2026-08-17); never once in code anyone wrote. The paths-ignore above was added
12+
# for exactly this and did not stop it: for a compiled language the extractor takes compilation
13+
# units from the BUILD, and generator output has no checkout file for a path filter to match, so
14+
# it is reported under a synthetic `obj/.../generated/...` path that never existed on disk.
15+
#
16+
# Dropping the rule rather than dismissing its alerts one release at a time: it is a
17+
# maintainability rule, not a security one, SonarCloud already covers that ground for this repo,
18+
# and a rule that has produced a 100% false-positive rate across two source generators will keep
19+
# producing them every time a generator changes shape.
20+
query-filters:
21+
- exclude:
22+
id: cs/nested-if-statements

docs/STATUS-AND-BACKLOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,23 @@ check-then-act rather than atomic — closing that needs a compare-and-swap on `
118118
an interface every custom store implements, for a race orders of magnitude smaller than the human one
119119
this closes.
120120

121+
### 1c. CodeQL noise from source-generator output — **FIXED (2026-08-18)**
122+
123+
`cs/nested-if-statements` fired four times in this repository and every one was inside
124+
`System.Text.RegularExpressions` source-generator output — #157/#158 (2026-07-16, QueryBuilder.Pro)
125+
and #307/#308 (2026-08-17, Core). Never once in code anyone wrote.
126+
127+
`paths-ignore: **/obj/**` was added for exactly this and did not stop the second pair, which is the
128+
part worth remembering: for a **compiled** language the extractor takes compilation units from the
129+
*build*, and generator output has no file in the checkout for a path filter to match — it is reported
130+
under a synthetic `obj/.../generated/…` path that never existed on disk. A path filter cannot reach it
131+
by construction.
132+
133+
Fixed by excluding the rule itself via `query-filters`, not by a third path tweak: it is a
134+
*maintainability* rule rather than a security one, SonarCloud already covers that ground here, and a
135+
rule at a 100% false-positive rate across two different generators will keep firing every time a
136+
generator changes shape.
137+
121138
### 2. CI hardening
122139
- **Fail (not skip) the Testcontainers integration tests when Docker is absent in CI.****done**:
123140
the five container `ServerFixture`s now swallow a start failure only through an exception filter,

0 commit comments

Comments
 (0)