Repository navigation
Conversation
…ter module The Dockerfile deleted go.mod's replace and ran 'go mod tidy' at build time. Tidy resolves packages missing from go.mod at latest and shifts direct deps (x/sync 0.22->0.23, x/net, x/sys, x/text, x/crypto, genproto, otel 1.46->1.47 in a scratch simulation), so an image built from a pinned commit was not reproducible, and an upstream release needing a newer go than the pinned builder broke the build with no change in this repo. The router binary imports neither the framework module nor the deploy-side library, so give cmd/chip-router its own module (go.mod/go.sum checked in; versions equal to what the parent resolved) and build from those pins only: go mod download from go.mod+go.sum, then go build -mod=readonly. Same pattern as framework/leak/cmd. The library module's go.mod no longer requires the binary's dependencies.
|
|
Author
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.
Stacked on #2877 (recreation of the closed #2861; the base is its branch, so only the delta is in the diff). Retarget to
mainafter #2877 merges.Problem
The router image build deleted
go.mod'sreplaceand rango mod tidyat build time (Dockerfile, added in #2861/#2873).tidyresolves packages missing fromgo.modat latest and shifts direct dependencies, so the image for a given commit is not reproducible. In a scratch simulation it movedgolang.org/x/sync0.22→0.23 (the router'serrgroup),x/net,x/sys,x/text,x/crypto, genproto/rpc and otel 1.46→1.47. Consumers build this image from a pinned CTF commit (chainlink'ssetup.tomlclones the repo at acommitand buildsframework/components/chiprouter/Dockerfilewith the module dir as context), so a later upstream release, or one needing a newergothan the pinned builder, can break the build for an unchanged commit.Change
cmd/chip-routeris now its own Go module (go.mod/go.sumchecked in; every retained version equals what the parent module resolved before). The binary imports neitherframeworknor the deploy-side library, so its graph is small: 6 direct + 9 indirect requires. Same pattern asframework/leak/cmd.Dockerfile:COPY go.mod go.sum→go mod download→COPYsources →go build -mod=readonly. Nosed, notidy. The dependency layer is cached again.go.mod/go.sumshrink: it no longer requires grpc, cloudevents, chipingress or protobuf (only the binary used them).chiprouter/.changeset/v1.0.5.md: one added bullet.No change to router behavior:
main.go/main_test.goare untouched.Verification
cmd/chip-routermodule:gofmtclean,go vetclean,go test -race -count=20ok,golangci-lint(repo config) 0 issues.go build ./... && go vet ./...ok;go mod tidyleaves both modules unchanged (idempotent).GOFLAGS=-mod=readonly,go buildexits 0 andgo.mod/go.sumstay byte-identical, so the checked-in files are sufficient.go.mod+go.sumpresent →go mod download→ sources →go build -mod=readonly,linux/amd64, fresh cache) in a clean directory: exit 0 for each step.Not verified
docker build: the Docker daemon was not running where this was prepared. TheCOPY cmd/chip-router/...paths assume the module dir as the build context (as in chainlink'sdocker_ctx = "framework/components/chiprouter"). Please rundocker build -f framework/components/chiprouter/Dockerfile framework/components/chiprouteronce before merging.api-diffmay report thecmd/chip-routerpackage as removed from thechiproutermodule (it moved into its own module); nothing imports apackage main.