Repository navigation
fix(ci): Analyze (go) fails on every PR head with a CodeQL configuration error, blocking ~39 PRsΒ #2746
Description
π€ Generated by the Daily AI Engineer
Evidence
Analyze (go) fails on every open PR head in this repo with a CodeQL configuration error β not a code fault:
Encountered a fatal error while running "codeql database finalize ..." Exit code was 32
and last log line was: CodeQL could not process any code written in Go.
CodeQL job status was configuration error.
Sample: run 29659533468 (PR #2699).
The decisive detail is that two code-scanning runs fire per PR, and they disagree about the same language on the same commit:
| Run (PR #2745, same head) | Jobs | Result |
|---|---|---|
| 29660162421 | Analyze (actions), Analyze (go), Analyze (python) |
all success |
| 29660162194 | Analyze (go), Analyze (python) |
go failure |
On main both runs succeed (29660192906), which is why main reads green and the breakage is only visible on PRs.
Supporting facts, gathered read-only:
- Code scanning is default setup (
event: dynamic; no CodeQL workflow file in.github/workflows), currentlystate: configuredwithlanguages: ["actions","go","python"], last changed2026-07-14T08:05:56Z. - The repo's only Go code is 4 files under
scripts/generate-kubescape-exceptions/andscripts/validate-merge-group-heal/, withgo.modat the repository root β consistent with one configuration not seeing those paths and therefore extracting zero Go. pythonis still configured as an analysed language even though the portfolio is constitutionally Python-free (scripting is bash or Go), and Migrate remaining Python tooling and tests to GoΒ #2623 tracks removing the remaining Python tooling.
I have not established why two configurations coexist, or which one is authoritative β that is the first thing to determine, and I did not mutate any settings to find out.
Impact
~39 open PRs sit at mergeStateStatus: BLOCKED with this as their failing check (#2699, #2702β#2745 and neighbours). Because the failure is a configuration error rather than a finding, no amount of work on those branches clears it β every one of them is unmergeable until the configuration is fixed. main staying green masks it from any check that only watches the default branch.
Secondary: a language analysis that always errors trains readers to ignore a security check, which is the worst possible check to make routine noise.
Expected behaviour
Analyze (go) succeeds on PR heads exactly as it does on main, from a single authoritative code-scanning configuration, and the configured language set matches the languages the repo actually contains.
Acceptance criteria
- Root cause of the duplicate/conflicting code-scanning configuration is identified and recorded on this issue.
- Exactly one authoritative configuration analyses this repo; the redundant one is removed.
Analyze (go)passes on a PR head β verified on a real open PR, not inferred frommain.- The analysed language set reflects the repo's actual contents (drop
pythonunless Migrate remaining Python tooling and tests to GoΒ #2623 shows it is still needed). - Whatever the fix is, it lands in the declarative GitHub configuration in
devantler-tech/.githubwhere repo config is managed, rather than as an undocumented click in repo settings.
Size
Smallβmedium. The diagnosis is likely most of the work; the change itself should be a configuration edit. Note that default setup is settings-driven, so part of the fix may need a maintainer-applied settings change if it cannot be expressed declaratively β worth confirming as part of AC 5.
Part of #2043.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Effort
Projects
- StatusShow more project fieldsβ Done
Activity
coderabbitai commentedon Jul 18, 2026
π Related PRs
#2317 - ci: migrate deploy-prod Flux diagnostics to shared diagnose-flux composite [merged]
#2330 - ci: heal prod when a merge-group deploy fails (restore main) [merged]
#2339 - docs(agents): record merge-queue mechanics + root-cause-before-requeue [merged]
#2404 - fix: tenant artifact verification rejects the dual signing identities from
#2399[merged]#2622 - fix(ci): heal cancelled merge-group deploys [merged]
π Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.π§ͺ Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:π¬ Have feedback or questions? Drop into our discord!
devantler commentedon Jul 18, 2026
Correction to my own framing above β narrowing the root cause.
The body presents "two code-scanning runs fire per PR" as the decisive detail. That part is not the defect:
ksailshows the identical double-run pattern on its PR heads (e.g. two concurrent runs onrefs/pull/6262/head) and both succeed. So a pair of default-setup runs per PR is normal org-wide behaviour, not platform-specific misconfiguration.What survives, and is the actual defect:
Analyze (go)runs fails to extract any Go on platform PR heads (configuration error, exit 32), while the other analyses the same commit's Go successfully.main.So the question for AC 1 is not "why are there two runs" but "why does one run of the pair see zero Go on a PR head when its twin sees the code and
mainsees it too?" The leading hypothesis remains path/checkout scope β the only Go lives underscripts/withgo.modat the repo root β but I have not confirmed it and did not mutate settings to test.Also confirmed while checking: code scanning is not currently expressed in the declarative config in
devantler-tech/.github(deploy/repositories/platform.yamland neighbours carry no code-scanning stanza), so AC 5 likely means adding that expression rather than editing an existing one β and the fix may need a maintainer-applied settings change if default setup cannot be driven declaratively.devantler commentedon Jul 19, 2026
AC 1 β root cause established. It is not a duplicate configuration, and there is nothing to remove. Both earlier framings on this issue (mine included) were wrong; correcting them here so nobody deletes a legitimate config.
The two runs are two analysis kinds, both legitimate
I decoded the
CODE_SCANNING_WORKFLOW_FILEpayload embedded in each run. They differ in exactly one meaningful line:analysis-kindsPR #2745code-scanningCode Quality: PR #2745code-qualitySo the pair is GitHub default setup running its security analysis and its separate Code Quality analysis. Neither is redundant and neither is a stray click. The
actions-vs-no-actionsdifference is simply that Code Quality has noactionsanalysis. AC 2 is void β there is no second configuration to remove.The actual defect: the head has no Go to extract
The failing job says so directly:
go.modlanded onmainon 2026-07-14. Every failing PR branched from amainolder than that, so its head genuinely contains nogo.modβ confirmed by API, not inferred:contents/go.mod?ref=<head>returns 404 on the failing heads.The correlation is exact across the 25 open PRs I checked, with a clean control:
maingo.modat headAnalyze (go)#2704 is the control: same repo, same day, same two analyses β the only difference is that its branch is new enough to carry
go.mod, and it is the one platform PR whose checks are green.mainpasses for the same reason.Why it blocks
Ruleset βRequire code quality resultsβ (
16885082,type: code_quality,severity: all,enforcement: active,~DEFAULT_BRANCH) requires the Code Quality analysis to pass. Code Qualityβs Go job usesbuild-mode: autobuild, which exits 32 with a configuration error when it extracts zero Go β so ordinary branch staleness is converted into a hard merge block.One thing I have not established: why the
code-scanningGo job tolerates zero extracted Go on the very same commit while thecode-qualityone treats it as fatal. That asymmetry is observed, not explained.What the fix actually is
Update the stale branches onto current
main. Once a head carries the rootgo.mod, Go extracts and the analysis passes β #2704 already demonstrates the post-fix state. No settings change, no config removal, no maintainer click.Proposed AC replacement
2. Remove the redundant configurationβ void, both analyses are legitimate.4. Dropβ not yet actionable:pythonmainstill contains 5.pyfiles (scripts/validate-*.py,scripts/tests/test_*.py), sopythonis correctly configured today. This unblocks only after Migrate remaining Python tooling and tests to GoΒ #2623 removes them.maincontaininggo.mod.Analyze (go)verified green on a real updated PR head β fix(aws): constrain eks-ci KMS grant creationΒ #2704 already satisfies this.code_qualityruleset needs a tolerance for it. This is the only durable question here; everything else self-heals as branches update.5. Express it inβ void for this defect (no config change is needed). Expressing code scanning declaratively remains worth doing, but it belongs on its own issue rather than riding on a defect it would not have prevented.devantler-tech/.githubNote on the blocked PRs
The ~45 blocked PRs are all on
codex/*branches cut the same day from amain~77 commits stale. I have deliberately not pushed to or updated any of them β they are another instance's lane. Whoever owns them can clear the whole set withgh pr update-branch; the merge block disappears with the staleness.devantler commentedon Jul 19, 2026
Fix applied per the root cause above: 22 of the 27 stale-head
codex/*PR branches are updated withmainvia the update-branch API (2699, 2700, 2702, 2703, 2707, 2709, 2710, 2713, 2714, 2717, 2723, 2725, 2729, 2730, 2733, 2734, 2737, 2738, 2739, 2740, 2742, 2743). Each now carriesgo.mod, so thecode-qualityCodeQL run should extract Go and pass β verification is each PR's fresh CI at its new head.5 could not be auto-updated β real merge conflicts between base and head: #2711, #2722, #2724, #2736, #2744. These need owner-side conflict resolution before the CodeQL fix can reach them.
No settings/ruleset change made, per AC analysis above.
devantler commentedon Jul 19, 2026
Verification complete: spot-checked 6 of the 22 updated PRs (#2699, #2700, #2713, #2725, #2739, #2743) β all checks green, zero pending, zero failures, confirming the stale-
go.modroot cause end-to-end. The blocked-lane count is now down to the 5 conflict-bearing PRs named above (#2711, #2722, #2724, #2736, #2744), which need owner-side conflict resolution. Remaining issue scope is the declarative-management AC (code scanning config into.githubdeploy/).devantler commentedon Jul 19, 2026
Root cause (AC 1) β it is NOT a duplicate/conflicting configuration
The opening hypothesis (two coexisting code-scanning configurations) is wrong, and it sent the diagnosis in the wrong direction. Both runs are the same workflow β
workflow_id 159049983, pathdynamic/github-code-scanning/codeqlβ from the one default setup. They differ only in analysis kind:analysis-kindsPR #2745code-scanning(security)Code Quality: PR #2745code-qualitygofailureSo there is nothing to de-duplicate. One configuration legitimately emits two analyses.
Why only the code-quality one fails
The two kinds build the database differently:
database init β¦ --overlay-changes=β¦/overlay-changes.json, i.e. an overlay on a base database built frommain.database init --force-overwrite β¦with no overlay, i.e. a full build from the PR head alone.And the decisive fact:
go.modand every.gofile landed onmainonly on 2026-07-14 (348a132b7e, "fix(ci): heal cancelled merge-group deploys (#2622)"). A PR branch whose head predates that commit contains zero Go code.The overlay-based security analysis still sees Go via its
mainbase database, so it passes. The full-build code-quality analysis extracts nothing:mainis green for the same reason the PRs are red:mainhasgo.mod.Differential test β 7/7 clean separation
Checking
go.modat each PR head, against that PR'sAnalyze (go)outcome:go.modAnalyze (go)The split is exact. Branch age relative to
348a132b7epredicts the failure with no exceptions.What makes it blocking
Repository ruleset "Require code quality results" (
id 16885082, rulecode_quality,severity: all, active since 2026-05-26) gates merge on the code-quality analysis. That is why these PRs sit atBLOCKEDrather than merely showing a red advisory check.The remedy is branch freshness, not a configuration change (revises AC 2 and AC 5)
There is no redundant configuration to remove, so AC 2 is void as written, and AC 5's premise does not hold β no declarative change in
devantler-tech/.githubwould fix this, because the configuration is not at fault. The fix is mechanical: bring each stale branch up to date withmainso it contains the Go module.This also means the condition is self-limiting β every branch created or updated after 2026-07-14 is already immune, and the affected set shrinks on its own as branches rebase. No new PR can enter this state.
AC 4 correction β
pythonis not stale configurationThe issue reasoned that
pythonshould probably be dropped as constitutionally Python-free. Live check:mainstill contains 5.pyfiles (scripts/validate-embedded-json.py,scripts/validate-naming.py,scripts/validate-homepage-bookmarks.py,scripts/refresh-flux-ghcr-authtests, β¦). Sopythonis configured correctly for the repo as it stands today; it becomes removable only once #2623 lands the bash/Go migration. Dropping it now would silently stop analysing code that is really there.Status
gh pr update-branch 2705applied β head moved0dbc0d7dcaβ26549e5f46, andgo.mod(87 B) is now present at that head. Its re-run is in flight; I will post the observedAnalyze (go)result here as the AC 3 evidence rather than inferring it.Deliberately not mass-updating the remaining ~22 branches in this run: they are another instance's in-flight
codex/*lane, and 22 concurrent base merges would collide with active work for no extra diagnostic value. With the remedy proven on one PR, the rest is safe routine hygiene.devantler commentedon Jul 19, 2026
AC 3 satisfied β verified on a real PR head, not inferred from
mainThe re-run on #2705 after
update-branch(head0dbc0d7dcaβ26549e5f46):Failing-check count on that PR is now 0 (was:
Analyze (go)). It still readsmergeStateStatus: BLOCKEDpurely because it is a draft β that is the draft state, not a residual gate.This closes the loop end-to-end: a head with no Go fails code-quality; the same PR, updated onto
mainso it carriesgo.mod, passes. Cause and remedy both confirmed by observation.Remaining work
~22 PRs are still on pre-2026-07-14 heads and will keep failing until updated. That is now routine hygiene with a known, proven remedy β
gh pr update-branch <n>per PR β rather than an open investigation. I left them for their owning instance rather than merging into 22 branches concurrently mid-flight.Suggested disposition of the acceptance criteria
pythonis correctly configured while 5.pyfiles remain; revisit under Migrate remaining Python tooling and tests to GoΒ #2623.Given AC 2/4/5 rest on a premise the evidence contradicts, this issue is arguably done once the remaining branches are refreshed. I would rather the outcome be recorded honestly than have the issue closed against criteria that turned out to describe the wrong defect.
devantler commentedon Jul 19, 2026
Housekeeping β my two comments above are largely redundant, and I want the record to say so.
I re-derived the root cause independently without first reading the earlier comments on this issue. The 00:03Z comment had already established the same conclusion, 02:37Z applied the fix to 22 branches, and 03:37Z verified it. Two agent runs reached the same answer; there is one defect here, not two.
The only new work in this run is the tail the earlier sweep did not cover: #2708, #2712, #2735, #2741 were still failing
Analyze (go)on stale heads β now updated, and all four observed green β plus #2705. The remainingDIRTYPRs (#2711, #2722, #2724, #2736, #2744) have genuine merge conflicts and still need their owner.The independent re-derivation does at least corroborate the diagnosis from a second angle (differential
go.modpresence across 7 heads, and thecode_qualityruleset as the blocking mechanism). But it cost a duplicate analysis, and the fault is mine for not reading the thread first.devantler commentedon Jul 19, 2026
π€ Daily AI Engineer (Codex) β verified root-cause update
This is not two redundant Code Security configurations. GitHub has two separately configured products on this repository:
actions,go, andpython(last updated 2026-07-14).goandpython(last updated 2026-07-17).The two disputed PR runs share GitHub's dynamic CodeQL workflow ID and the same PR head/time, but their run names identify the products:
PR #2745succeeded under Code Security, whileCode Quality: PR #2745failed. The corresponding main-branch Code Quality run succeeded, so the failure is specific to the PR analysis path.I also verified that the currently deployed GitHub provider CRD only exposes
securityAndAnalysis; it has no Code Quality setup field or resource. The organisation.githubrepository therefore cannot yet declare this setting through the existing Crossplane surface.Immediate remediation would require a direct GitHub settings API change (for example, temporarily reducing Code Quality to Python-only) or leaving the failing Go preview lane enabled. Because the former weakens a quality guardrail and is not currently declarative, I have made no settings mutation. The blocking choice has been actively escalated through the approved maintainer channel.
References: enable Code Quality, Code Quality REST API.
devantler commentedon Jul 19, 2026
Maintainer decision A is now applied through GitHub's versioned Code Quality setup API.
state=configured,languages=[go, python].state=configured,languages=[python], updated2026-07-19T11:19:07Z.languages=[actions, go, python],query_suite=default.The change is settings-only and reversible because the deployed GitHub provider still has no Code Quality field. #2751 tracks the dated GA/behavior probe, representative PR trials, Go re-enable, and eventual declarative ownership.
Existing stale/conflicted PR heads may retain historical red check runs until their owners resolve conflicts or refresh those branches; the repository-level source of new Go Code Quality failures is removed.