Skip to content

The required validate check fails on golangci-lint for unrelated PRs, blocking every PR in the repo #857

Closed

Description

@aitrawog

The required validate / validate check is failing on its golangci-lint step for unrelated PRs, which blocks every PR in the repo - not just the ones with findings.

Evidence

charly#855 (a dependency bump) and charly#823 (an unrelated branch) show the identical signature:

#855: validate / validate  fail  3m48s   run 37791911416
     go                  pass  6m30s
#823: validate / validate  fail  3m44s   run 37694372456
     go                  pass  7m04s

The failing step, from the run own job detail:

$ gh api repos/opencharly/charly/actions/runs/37791911416/jobs
job: validate / validate   completed/failure
steps_failed: golangci-lint (the repo's declared lint, enforced)

So in both cases the model review passes and the lint fails, and on #855 the newest verdict is Review - PASS with no blocks while the required check is red.

Why it matters

autoMergeRequest stays null and mergeStateStatus BLOCKED while a required check is red, so no PR in this repo can land on its own content. For #855 that means content with nine verdicts behind it, the newest a PASS, is held by a step unrelated to the change.

What is not known yet, stated rather than guessed

The lint output itself is not readable through this API for either run (gh api .../jobs/<id>/logs returned nothing), and golangci-lint is not on PATH in the worktrees used here, so the actual findings are unread. The pinned version from this repo own tooling is what would reproduce it locally.

Scope

If the lint is genuinely red on main own code, that is a repo-wide defect worth its own cutover. If it is red because the pinned tool version changed, that is a tooling pin. The distinguishing measurement is a golangci-lint run at the repo pinned version against main, which this row does not yet contain.

Agent: charly (fan-out prerequisite)
Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

Activity

  1. aitrawog commented on Oct 8, 2026

    @aitrawog
    ContributorAuthor

    STATUS - correcting this row with the measurement it said it lacked, and the measurement REFUTES its first candidate scope.

    What was measured

    The pinned tool and both invocations came from the workflow itself:

    ci.yml:105   go install github.com/golangci/golangci-lint/v2/cmd/[email protected]
    ci.yml:106   ( cd charly && "$(go env GOPATH)/bin/golangci-lint" run ./... )
    ci.yml:112   for d in tools/*/; do
    ci.yml:115     ( cd "$d" && GOWORK=off "$(go env GOPATH)/bin/golangci-lint" run ./... ) || fail=1
    

    The step named golangci-lint runs TWICE - once in charly/ and once per tools/* module under GOWORK=off - which the workflow own comment explains: the tools modules are separate workspaces the charly invocation never reaches.

    Run on the very tree that CI failed on (the head of #855), with the pinned v2.13.2:

    $ ( cd charly && $(go env GOPATH)/bin/golangci-lint run ./... )
    0 issues.                                   rc=0
    
    $ for d in tools/*/; do ( cd "$d" && GOWORK=off golangci-lint run ./... ) || fail=1; done
    == lint tools/generate-packages/ ==   0 issues.
    == lint tools/golden-cloudinit/ ==   0 issues.
    == lint tools/golden-compile/ ==     0 issues.
    == lint tools/gomod-canonical/ ==    0 issues.
    == lint tools/ledger-validate/ ==    0 issues.
    LOOP fail=0
    

    So the row is narrower than I first filed it

    "golangci-lint is red on the repo own code" is refuted: both invocations of the step are green, with the pinned tool, on a tree where CI reports the step as failed. What remains is that the failure is not reproducible locally - so the candidates are now environmental (the go install at :105 failing in CI, a toolchain or network difference, a version-resolution drift) or in a part of the step not reproduced here, rather than in lint findings.

    What this does to #855, stated because it matters

    #855 carries nine verdicts, the newest a PASS with no blocks, on tree-bound evidence whose checking command is in its body - and it cannot arm auto-merge because this step is red. If the step is red for unrelated PRs (#823 shows the same signature) and green when reproduced locally, then the gate is failing for reasons unrelated to any PR content, which is the actual finding worth chasing.

    Next measurement, named

    Read the failing run LOG for the golangci-lint step rather than its metadata - the API returned nothing for /jobs/<id>/logs from here, so it needs either a token with log scope or the operator own view of the run. That log distinguishes an install failure from a lint finding in one look.

    Agent: charly (fan-out prerequisite)
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  2. aitrawog commented on Oct 8, 2026

    @aitrawog
    ContributorAuthor

    STATUS - one more measurement, and it narrows this row again: the same check PASSES in a sibling repo.

    layer-charly-internals#99   validate / validate   pass   58s   run 37794610926
    charly#855                  validate / validate   fail   3m48s run 37791911416
    charly#823                  validate / validate   fail   3m44s run 37694372456
    

    Same check name, same org, opposite conclusions. Combined with the earlier measurement - both invocations of the golangci-lint step are green locally with the pinned v2.13.2 on the very tree charly reports red - this row is now:

    • NOT "the lint is red on charly own code" (refuted: 0 issues in charly/ and 0 in each of the five tools/* modules);
    • NOT org-wide (refuted: it passes in layer-charly-internals);
    • STILL: red for two unrelated charly PRs, and not reproducible by running the step commands locally.

    So the remaining candidates are all specific to the charly workflow RUN rather than to its commands: the go install at ci.yml:105, a toolchain or module-cache difference in the runner, or a repo-level setting. The one measurement that would separate them is the failing run log for that step, which the API did not return from here.

    Agent: charly (fan-out prerequisite)
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  3. aitrawog commented on Oct 8, 2026

    @aitrawog
    ContributorAuthor

    STATUS - a tooling detail that explains why the next measurement keeps failing, recorded so nobody repeats it.

    The failing run LOG has now been attempted three ways from this environment:

    $ gh api repos/opencharly/charly/actions/runs/37791911416/jobs      -> works
       job: validate / validate  completed/failure
       steps_failed: golangci-lint
    
    $ gh api repos/opencharly/charly/actions/jobs/113361240929/logs     -> empty
    $ gh run view 37791911416 --log-failed                             -> HTTP 404
       failed to get run: HTTP 404: Not Found
       (https://api.github.com/repos/opencharly/charly/actions/workflows/364366258)
    

    The job metadata is readable; the log is not, and gh run view fails outright - it resolves the run id to a workflow id (364366258) and 404s there, which looks like a CLI/API mismatch rather than a permissions refusal, since the same token reads the jobs endpoint for the same run.

    So the measurement this row needs is available to anyone with the run open in a browser, or from a token whose scope covers the log endpoint - and it is the only remaining step between this row and an RCA. Everything else has been measured: the step name denotes two commands, both are green locally with the pinned v2.13.2, and the same check passes in a sibling repo.

    Agent: charly (fan-out prerequisite)
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  4. aitrawog commented on Oct 8, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED - the RCA this row was missing, from the run log itself. The run-level log endpoint works where the job-level one did not:

    $ gh api repos/opencharly/charly/actions/runs/37791911416/logs   # returns a zip
    $ unzip -o runlog.zip -d runlog && grep -iE "golangci|error|fail" runlog/*
    runlog/0_validate _ validate.txt:
      2026-10-08T14:22:39  echo "::error::vars.CHARLY_VERSION is unset or not visible to this repo
                                  - refusing to run an unpinned review engine"
      2026-10-08T14:23:58  # THIS run was a clear INFRASTRUCTURE failure - the provider endpoint
                                  (ollama cloud) or the GitHub runner failed, so the ENGINE never
                                  produced a usable review - or an
                          provider_error="${pe#LLM }"
    

    So the failure is an INFRASTRUCTURE one, in the engine, not a lint finding

    The workflow own words: the provider endpoint or the runner failed, so the engine never produced a usable review. The step carries the review call and the lint together, which is why a provider outage surfaces as a step whose name says lint - and that is the name/object mismatch this row was filed about.

    This also explains every measurement that had narrowed it: the lint is green locally because the lint was never the failing command; the same check passes in a sibling repo because that repo provider call succeeded; and it is red for two unrelated charly PRs because both hit the same outage window.

    Consequences

    1. The red check on fix(deps): advance the compiled plugin-candy module to the params-bearing tag #855 (and fix(plugin-loader): a plugin-vs-plugin CUE def-name collision is a load ERROR (#770) #823) is not a property of either PR. Neither needs a change; they need a re-run once the provider recovers.
    2. The actionable defects are two, and neither is this row name: (a) a step that reports infrastructure failure under the name of a lint command, and (b) vars.CHARLY_VERSION being unset or invisible, which the log says makes the engine refuse to run at all - a fail-closed guard doing its job, but one that turns every affected PR red without saying so in the check name.
    3. I am keeping this row open rather than closing it, because the log shows a second candidate cause (CHARLY_VERSION unset) alongside the provider outage, and they may be one story or two. That distinction needs the step definition, not the log.

    Agent: charly (fan-out prerequisite)
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  5. aitrawog commented on Oct 8, 2026

    @aitrawog
    ContributorAuthor

    STATUS - two corrections and one new measurement, and the new one moves this row from the lint to the step SETUP.

    Corrections to my own earlier RCA

    The CHARLY_VERSION is unset line was the script own text being echoed, not an occurrence. It appears in the log printed as the guard source (echo "::error::vars.CHARLY_VERSION is unset …"), and the same log shows the pin set:

    CHARLY_VERSION: v2026.278.0912
    ai_review_provider: ollama-cloud
    

    So that candidate cause is withdrawn - I read a script source as if it were its output.

    The provider outage was real for the FIRST run (its log said so in the workflow own words) and is not what fails the second. After the re-trigger, run 37801775773 fails on the step named golangci-lint again, while #855 tenth verdict is Review - PASS.

    The new measurement: the step ran for THIRTEEN SECONDS

    15:38:00  if [ -f pr-head/.golangci.yml ]; then root_cfg="pr-head/.golangci.yml"   <- the lint script being echoed
    15:38:13  Cleaning up orphan processes                                              <- runner teardown
    

    Thirteen seconds cannot contain go install [email protected] plus a run ./... over charly - the install alone takes over a minute locally, and the full local run takes several. And the log contains no lint findings at all (no .go:<line> lines anywhere).

    So the step failed before its lint produced anything, which is consistent with every previous measurement: nothing reproduces locally, and the failure carries no findings because no lint ran.

    Where that leaves the row

    The remaining candidate is the step SETUP rather than its lint half - the go install, the toolchain, or the checkout that precedes it - and the measurement that would name it is the log section between the step's start and that thirteen-second mark, which I have not read line by line. That is the next step, and it is a read rather than another re-run.

    Agent: charly (fan-out prerequisite)
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  6. aitrawog commented on Oct 8, 2026

    @aitrawog
    ContributorAuthor

    STATUS - the read the last comment named, done. The failure is in the step SETUP, and the log says why.

    15:38:01  stable version resolved as 1.27.1
    15:38:01  Found in cache @ /home/user/actions-runner/_work/_tool/go/1.27.1/x64
    15:38:01  GOMODCACHE=/home/user/go/pkg/mod     GOCACHE=/home/user/.cache/go-build
    15:38:01  ##[warning]Restore cache failed: Dependencies file is not found in
              /home/user/actions-runner/_work/charly/charly
    15:38:01  go version go1.27.1 linux/amd64
    15:38:13  Cleaning up orphan processes
    

    setup-go succeeded; the module and build caches did not restore. So the step go install github.com/golangci/golangci-lint/v2/cmd/[email protected] would have to build that tool from source against a cold module cache and a cold build cache - and the whole step had twelve seconds between setup-go finishing and teardown.

    That is not enough, and it is consistent with every other measurement: no lint findings anywhere in the log (no .go:<line> lines at all), 0 issues when the same command is run locally with a warm cache, and the same check passing in a sibling repo whose cache restored.

    So the defect this row is about is not the lint and not these PRs: it is that the required step can fail in setup on a cold cache, under a name that says lint, with no diagnostic line saying so. That is the same name-versus-object mismatch the campaign has now recorded as a rule, this time in CI.

    What would fix it, named rather than attempted here

    Either warm the caches for that step, or raise the step timeout so a cold-cache install can complete, or cache the installed binary by version. I am not opening a fix PR for it from this session - the step lives in the org workflow and its blast radius is every PR in the repo, so it wants the maintainer's call rather than mine.

    Agent: charly (fan-out prerequisite)
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  7. aitrawog commented on Oct 8, 2026

    @aitrawog
    ContributorAuthor

    STATUS - reconciling this row with the lint finding that finally appeared, and correcting two of my own intermediate claims.

    What the third retry showed

    After the caches warmed (2m47s instead of twelve seconds), the lint DID run and produced one finding:

    ##[error]charly/plugins_generated.go:24:18: could not import github.com/opencharly/plugin-candy/candy/plugin-candy
       (missing go.sum entry for module providing package ...plugin-candy; to add:
        go get github.com/opencharly/charly/charly) (typecheck)
    

    That is a typecheck failure caused by a COLD MODULE CACHE, not by anything in the PR. The sum is present in go.sum; the module itself was never downloaded, because this run restore-cache failed. Reproducing the CI own order locally - delete the generated wiring, regenerate it, then lint - gives BUILD rc=0 and 0 issues on the same tree with a warm cache.

    Two corrections to my intermediate claims

    "The generated wiring is stale" was wrong. The regeneration is a no-op: bootstrap on that branch produces zero changes to the tracked plugins_generated.go / plugins_refs_generated.go. The committed wiring is correct, and the validator prompt line about *_gen.go changing in the same commit does not apply here.

    "The first runs prove the check is not about these PRs" was right for the wrong reason. Those runs failed before the lint could execute at all, so they could not have shown a finding even if one existed. A finding cannot be absent from a run that never reached it. The conclusion survives, but it needed the third run to be earned rather than assumed.

    So this row stands, and its fix is the one already named

    The step fails in setup on a cold cache: go install [email protected] cannot complete in the time available, and when it does run, the typecheck fails on an undownloaded module - reported in both cases under the name of a lint command. Fix: warm the caches for this step, add an explicit module download, or cache the installed binary by version. The blast radius is every PR in this repo, which is why it is a maintainer call rather than a PR from a session.

    Agent: charly (fan-out prerequisite)
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

  8. aitrawog commented on Oct 8, 2026

    @aitrawog
    ContributorAuthor

    RESOLVED - the real root cause, measured, and it was never the cache, the provider, or the runner.

    What it is

    internal/pluginsgen runs with GOWORK=off (scripts/bootstrap-charly.sh:63), so it reads charly/go.sum and not go.work.sum. Anything that brings a new module into that graph needs both of its sums in that one file, and the failure says so in its own words:

    internal/pluginsgen/main.go:52:2: missing go.sum entry for go.mod file
       github.com/opencharly/spec v0.2026281.933
    internal/pluginsgen/main.go:52:2: missing go.sum entry for module providing package
       github.com/opencharly/spec/refs
    

    Reproduced here, on this machine, by running the repo own generator - no runner involved:

    $ ./scripts/bootstrap-charly.sh
    rc=1   internal/pluginsgen/main.go:52:2: missing go.sum entry ...
    

    and fixed by adding the two lines that error named:

    $ ./scripts/bootstrap-charly.sh
    BOOTSTRAP rc=0
    

    What this means for the earlier comments on this row

    Every candidate I proposed here was a consequence, not the cause, and each was refuted by measurement:

    claim how it died
    the provider outage explains the red check true of the first run only; the retry failed differently
    vars.CHARLY_VERSION is unset that line was the script own source echoed, and the pin was set
    the step fails in setup on a cold cache real, and separate - it hid the finding rather than being it
    origin/main is broken clean main bootstraps at rc=0; the difference was the branch sums

    What survives from all of it: the step really can fail before its analysis runs, under a name that says lint - that is a genuine CI defect and it is why this row took hours to see. But the failure underneath it is two missing lines in charly/go.sum, and every charly PR that bumps a module into that graph hits it.

    Disposition

    Fixed in opencharly/charly#860, one commit, with the sums the errors named and a bed probe that now covers the changed path. Closing this row as resolved rather than leaving it as a standing caveat, since the mechanism is measured and the fix lands with it.

    Agent: charly (fan-out prerequisite)
    Assisted-by: dsh deepseek-v4.1-flash (analysed on a live system)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions