Repository navigation
ci: run Docker-gated generation tests on relevant PRs and nightly - #1175
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed-able status (r145) The Docker generate workflow now runs on every pull request and queue entry. A `changes` job skips the shards only when nothing but documentation changed, and `docker-generate` always reports one status: it fails unless every shard passed and the receipts of all shards together prove the row. scripts/test-generate-isolated.sh takes its row from CODEFLY_CONFORMANCE_REQUIRED and its packages and build tag from pkg/conformance/matrix.json and the tagged sources (through scripts/conformance-packages and Row.Packages). A repository test runs the script's loop in --list mode and checks it against an independent scan of the matrix gates and every file built under the row's tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (r158) The docs-only classifier moves into scripts/generate-qualification-scope.sh and diffs with --no-renames: with rename detection a file moved into docs/ or renamed to .md showed only its new path, so moving a Go source, a tagged test or a testdata fixture read as documentation and skipped the shards. TestDocsOnlyScopeSeesBothSidesOfARename covers each case. test-generate-isolated.sh builds its go test command once; --list prints it and the loop compiles only through it. The repository test compares that command with the row's build_tag and refuses a script that spells the tag or a package itself or runs go test any other way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ate-tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Fixes #1171.
Client and contract generation could merge green because CI never ran the published proto companion tests. This fix adds Linux/Docker qualification of
linux-amd64-docker-generateon every pull request, every merge-queue entry, nightly runs and manual dispatch.What runs
changesrunsscripts/generate-qualification-scope.shto diff the PR (or queue entry) against its base. Rename detection is off, so a moved file counts by its old path too. The shards are skipped only when every changed path is documentation (docs/or Markdown outsidetestdata/).TestDocsOnlyScopeSeesBothSidesOfARenamecovers code moved intodocs/, a test renamed to.md, a testdata.mdmoved intodocs/, and a testdata.mdedited. All of these run the shards, and a prose-only change skips them. There is no workflow-level path filter, so a change to any Go package the generators compile (pkg/runnables,pkg/gitops,pkg/composition, …), to go.mod/go.sum, to the scripts or to the workflows runs the shards.generate (0..2): three runners split the discovered tests round-robin. Each pulls the published image once through Core's existingproto.CompanionImageresolution and extracts its pinnedbuf. Each package is compiled once under the row's build tag. Every selected top-level test runs in its own process and Codefly home withCODEFLY_GENERATE_QUALIFY=1. Logs, timings and receipts are kept as artifacts. Each shard has a 15-minute limit.docker-generatealways reports, and is the one status that can be required. It fails unlesschangessucceeded and every shard passed. It then downloads every shard's artifact and runsverify-conformance-receipts.shon the receipts of all shards together. A shard that happens to draw no receipt-bearing test therefore can't go falsely red. It passes without the shards only whenchangesfound nothing but documentation. Making it required is the owner's ruleset call. This PR only makes it possible.Derived, not listed
scripts/test-generate-isolated.shtakes its row fromCODEFLY_CONFORMANCE_REQUIRED, set once at workflow level. It takes its packages and build tag frompkg/conformance/matrix.jsonand the tagged sources, throughscripts/conformance-packages→Row.Packages. The packages are the row'sgatesplus every package with a file whose//go:buildnames the row'sbuild_tag. Today that iscmd/generate,cmd/publishandcmd/sync.pkg/generatorsdrops out of this job: it has no gate and no tagged file. Its tests, including the TypeScript compile check that needs node, already run ingo.ymlcoverageandrace, which set up node. No coverage is lost.The script builds its
go testcommand once.--listprints that command, then walks the run's own loop and prints each package.TestGenerateQualificationScriptRunsTheMatrixRowchecks the printed command against the row'sbuild_tag, and the packages against an independent scan of the matrix gates and of every file built under the tag. It also refuses a script that:go testother than through the printed command.It also checks that the row names
generate-qualification.yml#generateand that thegeneratejob runs the script.Mutations verified at
90ab4780, each one failing the test:-tags proto_companion_requiredon the compile command;go test -c;(At
26cf9fd6the tag claim was not true.--listechoed the derived tag and never read the compile line. r158 g2.)Reuse
The existing conformance gate, receipt verifier, matrix (
gates,build_tag, which nothing read before),proto.CompanionImageand the artifact actions. There is no duplicated image pin, test-name allowlist, generated-client edit or alternative image resolver.actions/download-artifactis pinned to v8.0.2 (9000827c). It errors on a digest mismatch by default.The Python import test helper now uses a read-only mount and
-B. Root-owned bytecode files had been preventing Linux temp-directory cleanup.qualifiedkeeps its "every change" meaning indocs/supported-matrix.mdand in theStatusQualifiedcomment, which now agree. Both name the one exemption, a documentation-only change.Known gap: image pinned by tag, not digest (owner: core)
The companion resolves to
ghcr.io/codefly-dev/proto:<semver>from core's embeddedinfo.codefly.yaml, a mutable tag. A repush of that version changes what this job qualifies, and the extractedbufgoes on PATH. The workflow logsRepoDigestsbut cannot verify them, because there is nothing to compare against. The fix belongs in core: pin the digest next to the version incompanions/proto. This job and the tests would then pull by digest through the same resolver. That is out of scope for this PR (r145 f5).Validation
de659390: Docker qualification run, all three shards green. 314 test invocations split 105/105/104, 14 receipts, all 9 tagged companion tests passed.go test ./pkg/conformance/...(plus-race),go vet,golangci-lint,actionlintwith shellcheck. One thin local shard ran the script end to end on Docker, including a tagged companion test.90ab4780:go test ./pkg/conformance/...(plus-race), golangci-lint, actionlint and shellcheck. CI results are in the PR checks.26cf9fd6, every check is green. In the Docker qualification run,changesfoundrelevant=true. The shards ran 95/94/94 of the 283 discovered tests.docker-generatedownloaded all three artifacts and verified 14 receipts across the shards. Not exercised in CI: the documentation-only branch, where the shards are skipped anddocker-generatepasses, because no docs-only PR has run against this workflow yet.🤖 Generated with Claude Code