ci: validate intra-repo module pins are reachable from the default branch#630
Draft
nadahalli wants to merge 1 commit into
Draft
ci: validate intra-repo module pins are reachable from the default branch#630nadahalli wants to merge 1 commit into
nadahalli wants to merge 1 commit into
Conversation
…anch This monorepo's modules require sibling modules (chain_capabilities/* -> libs, -> chain_capabilities/common) by pseudo-version, with no replace directives, so a pinned SHA must live on the default branch or external consumers and fresh builds break with "unknown revision". A consumer was pinned to a libs commit (c4b42d8) that was only ever on a feature branch; once it was GC'd, every downstream build (chainlink image builds, this repo's fresh builds) failed to resolve it. Builds that ran while the commit still existed were stale-green, so nothing flagged it. Add script/validate-intra-module-refs.sh (greps every go.mod for capabilities/* pseudo-version pins and asserts each SHA is reachable from the default branch), a `make validate-module-refs` target, and a required CI job wired into the checks gate. Pair it with `make update-common-capabilities`, which must only target merged commits.
|
👋 nadahalli, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
|
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
Adds a required check that every intra-repo module pin
(github.com/smartcontractkit/capabilities/* required by another module via
pseudo-version) resolves to a commit reachable from the default branch.
capabilities/* pseudo-version pins, extracts the SHA, and asserts
git merge-base --is-ancestor <sha> origin/main.make validate-module-refstarget.validate-module-refsCI job, added to thechecksgate.Why
This is a multi-module monorepo: chain_capabilities/{evm,solana,aptos}
require libs and chain_capabilities/common by pseudo-version, with no
replace directives. So a pinned SHA must live on the default branch, or
external consumers and fresh builds here fail with "unknown revision".
A consumer was pinned to a libs commit (c4b42d8) that only ever lived on
a feature branch. Once that branch was gone and the commit was GC'd, every
downstream build broke: chainlink image builds (it installs these as LOOPP
plugins) and fresh builds in this repo. Builds that ran while the commit
still existed were stale-green, so nothing surfaced it until much later.
This check catches that class at PR time, while the off-default-branch pin
is still resolvable.
Pairs with
make update-common-capabilities, which should only ever targeta commit already merged to the default branch.
Verified