STAC-25459 Wire inv check-mod-tidy into CI, gated on the godeps cache hash - #447
Merged
Merged
Conversation
Base automatically changed from
STAC-25429-godeps-cache-image
to
STAC-25142-agent-lint-unit
July 29, 2026 13:52
LouisParkin
merged commit Jul 29, 2026
a9a92e0
into
STAC-25142-agent-lint-unit
15 of 16 checks passed
This was referenced Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wires the existing, never-referenced
inv check-mod-tidytask (tasks/go.py:302) into the GitHub Actions lint workflow as aGo module tidiness (go.mod / go.sum)job.Why
stackstate-agenthas never verified module tidiness in CI — not on GitLab, not on GitHub. This is a pre-existing gap, not a regression from the STAC-25429 cache image:inv deps(tasks/go.py:148) is onlydownload_go_dependencies. It does not tidy. (inv deps-vendoreddoes, but that is a different task and is not what CI ran.)go mod tidythat used to sit in the GitLabdeps_debreconcile was a bare YAML line that mutated the tree. It never failed a pipeline on untidiness. The only surviving reference is commented out inside the deaddeps_rpmjob (.gitlab-ci-agent.yml:104).inv check-mod-tidyalready exists and is a real gate —go work sync, then per-modulego mod tidyplusgit diff --exit-code go.mod go.sum, thenraise_if_errors. It was simply never called by any CI config.How it is gated
The job is skipped when the godeps cache image already exists.
The cache tag is a sha256 over exactly
**/go.mod,**/go.sum,go.work,go.work.sumandmodules.yml(plus the Dockerfile, the metadata script, and the base image tag). Soimage_exists == truemeans those files are byte-identical to a tree this check has already passed on — the content-addressed tag doubles as a cached verdict. The check therefore costs nothing on the large majority of PRs, which do not touch the module graph, and runs exactly when the graph moves.Known blind spot, documented in the job comment: a source-only change that removes the last import of a dependency leaves a stale
requirewithout touching any hashed file, so the job stays skipped. That does not break builds. A scheduledforce_mod_tidydispatch would cover it if we decide we want that.Placement
The job lives in the caller (
lint-and-unit-tests.yml), not in the reusablegodeps-cache.yml, because that reusable workflow is called by bothlint-and-unit-tests.ymlandbuild-binaries.yml— a job added inside it would run twice per PR. It consumes the reusable workflow's existingimage_existsandci_imageoutputs.Validation
workflow_dispatchcarries aforce_mod_tidyboolean so the gate can be exercised against an unchanged module graph (the current manifests are already baked, soimage_existsis true and the job would otherwise skip).zizmor --collect=workflows,actions,dependabot .— no findingsJira: https://stackstate.atlassian.net/browse/STAC-25459