ci: share the module check between CI and Security via a composite action - #262
Closed
Syndic wants to merge 1 commit into
Closed
ci: share the module check between CI and Security via a composite action#262Syndic wants to merge 1 commit into
Syndic wants to merge 1 commit into
Conversation
…tion ci.yml and security.yml both need `check_modules.py` — CI gates golangci-lint's module matrix on it, security.yml gates govulncheck's and pip-audit's — and jobs cannot be depended on across workflows, so both must run it. Each carried its own copy of the steps, restating the Python pin and two action SHAs with nothing holding the two together: a diverged copy would have run the same check under a different interpreter in each workflow, silently. Extract the steps to `.github/actions/check-modules`. This shares the definition, not the execution — the check still runs twice per PR, in parallel, ~10s each. A reusable workflow would not have changed that either; GitHub instantiates a called workflow's jobs into each caller's run and dedupes nothing. The pin moves out of `.github/workflows/` with the steps, so renovate.json's marker-driven customManager widens to `.github/actions/*/action.yml`. Verified the widened pattern claims the new site and adds nothing else: the two existing action.yml files carry no `# renovate:` markers. `test_check_modules_action` guards both couplings, each of which fails silently — a caller that re-inlines the steps, and a pattern that stops reaching the pin. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Syndic
force-pushed
the
ci/extract-check-modules-action
branch
from
August 22, 2026 21:50
64b9444 to
17c41e8
Compare
Owner
Author
|
Superseded. Rather than share the module check between the two workflows, we're dropping it from |
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
ci.ymlandsecurity.ymleach carried their own copy of themodules-checkjob's steps. Thisextracts them to
.github/actions/check-modulesand points both jobs at it.Why
Both workflows need
check_modules.py— CI gatesgolangci-lint's module matrix on it,security.ymlgatesgovulncheck's andpip-audit's — and jobs can't be depended on acrossworkflows, so both have to run it.
The problem wasn't the duplicated run, it was the duplicated definition: each copy restated the
Python pin and two action SHAs, and nothing failed if they diverged. The check could silently have
run under a different interpreter in each workflow.
This does not make it run once. The check still runs twice per PR, in parallel, ~10s each
(measured on run
32598382377: both jobs started21:01:34Z, finished 8s and 10s later). Areusable workflow wouldn't have changed that either — GitHub instantiates a called workflow's jobs
into each caller's run and dedupes nothing. Merging the two workflow files is the only thing that
would, and it would cost the independent
concurrencygroups plus force every CI-side job behind anif:gate — and anif:-gated required check reports as skipped, which branch protection countsas passed. That's the failure
codeql-all'sif: always()and//meta/scripts:test_codeql_toolchainalready exist to prevent, so it isn't a trade worth making for 10 seconds.
Reviewer notes
The Renovate change is the load-bearing part. The marker-driven
customManageris scoped by filepath to
^\.github/workflows/.*\.ya?ml$. Moving the pinnedpython-version: "3.14"into.github/actions/would have taken it out of Renovate's view entirely — and per README's"Marker-driven", that failure is silent and has already happened twice in this repo.
renovate.jsontherefore widens the pattern to also claim
^\.github/actions/.*/action\.ya?ml$.Per the README's "confirm it claims the sites you expect and nothing else", I simulated the
manager over the tree. It picks up the new site as
python 3.14and adds nothing else: the twoexisting
action.ymlfiles (commit-file-via-app,setup-bazel-remote) carry no# renovate:markers.
test_check_modules_actionguards three couplings, all of which fail silently — a caller thatre-inlines the steps, a pattern that stops reaching the pin, and a pin that diverges from the four
ci.ymlsites still carrying one. Same shape astest_precommit_docs/test_codeql_toolchain: noscript half, rides
bazel test //..., costs no CI job.Also relocated ci.yml's Python-pin comment block above
go-work-check, since the job it sat on nolonger has a pin.
Validation
bazel test //...— 25/25 pass;gazelleproduced no diff.pattern, re-inlining the step in
ci.yml, and setting the action's pin to3.13.check_modules.pypasses against the edited workflows;ruff format --check,ruff check, andty checkclean repo-wide.modules-checkresolves to exactly
[checkout, ./.github/actions/check-modules]in both.🤖 Generated with Claude Code