From 061f22d30686d554e86f383984ff9cf03dfdcdb6 Mon Sep 17 00:00:00 2001 From: Muse Sweep Date: Mon, 19 Oct 2026 06:10:48 -0500 Subject: [PATCH 1/2] ci(map,identity): add go mod tidy guard to the last two unguarded Go module workflows (#349) --- .github/workflows/identity-build.yml | 9 +++++++++ .github/workflows/map-build.yml | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/identity-build.yml b/.github/workflows/identity-build.yml index 4cd8a20600..3e3418f6e3 100644 --- a/.github/workflows/identity-build.yml +++ b/.github/workflows/identity-build.yml @@ -46,6 +46,15 @@ jobs: go-version-file: pkgs/identity/go.mod cache-dependency-path: pkgs/identity/go.sum + - name: Verify go.mod and go.sum are tidy + working-directory: pkgs/identity + # Same gap as pkgs/map (#349): build/vet pass on an untidy + # module, so drift would be silent. Tidy is build-tag agnostic, + # so this one step covers both matrix tag variants. + # `go mod tidy -diff` prints the diff and exits nonzero when + # go.mod or go.sum is not tidy, without modifying the files. + run: go mod tidy -diff + - name: Build working-directory: pkgs/identity run: go build -tags ${{ matrix.tags }} ./... diff --git a/.github/workflows/map-build.yml b/.github/workflows/map-build.yml index c532d27724..dc015c47fd 100644 --- a/.github/workflows/map-build.yml +++ b/.github/workflows/map-build.yml @@ -42,6 +42,16 @@ jobs: go-version-file: pkgs/map/go.mod cache-dependency-path: pkgs/map/go.sum + - name: Verify go.mod and go.sum are tidy + working-directory: pkgs/map + # Every sibling module already has this guard (go-modules-build + # for #347, mcpx.yml for nix#436, mod-tidy.yml for graph); map and + # identity were the last two without one, and build/vet pass on + # an untidy module, so drift here would be silent (#349). + # `go mod tidy -diff` prints the diff and exits nonzero when + # go.mod or go.sum is not tidy, without modifying the files. + run: go mod tidy -diff + - name: Build working-directory: pkgs/map run: go build ./... From 8f36e3dce0204dc3020a1b961c4fad677502eae2 Mon Sep 17 00:00:00 2001 From: Muse Sweep Date: Mon, 19 Oct 2026 06:14:57 -0500 Subject: [PATCH 2/2] =?UTF-8?q?ci(map,identity):=20use=20tidy+status=20gua?= =?UTF-8?q?rd=20pattern=20=E2=80=94=20pinned=20Go=201.21/1.22=20tidy=20has?= =?UTF-8?q?=20no=20-diff=20flag=20(#349)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/identity-build.yml | 14 +++++++++++--- .github/workflows/map-build.yml | 14 +++++++++++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/identity-build.yml b/.github/workflows/identity-build.yml index 3e3418f6e3..5337864a27 100644 --- a/.github/workflows/identity-build.yml +++ b/.github/workflows/identity-build.yml @@ -51,9 +51,17 @@ jobs: # Same gap as pkgs/map (#349): build/vet pass on an untidy # module, so drift would be silent. Tidy is build-tag agnostic, # so this one step covers both matrix tag variants. - # `go mod tidy -diff` prints the diff and exits nonzero when - # go.mod or go.sum is not tidy, without modifying the files. - run: go mod tidy -diff + # Pattern copied from go-modules-build.yml: these modules pin + # Go 1.21/1.22, whose `go mod tidy` has no -diff flag (added in + # Go 1.24; mcpx.yml can use it only because mcpx pins Go 1.27), + # so run tidy and fail if it changed anything. + run: | + go mod tidy + if [[ -n "$(git status --short -- go.mod go.sum)" ]]; then + echo "go mod tidy changed go.mod or go.sum; commit the tidy changes." + git diff -- go.mod go.sum + exit 1 + fi - name: Build working-directory: pkgs/identity diff --git a/.github/workflows/map-build.yml b/.github/workflows/map-build.yml index dc015c47fd..290a2a62c1 100644 --- a/.github/workflows/map-build.yml +++ b/.github/workflows/map-build.yml @@ -48,9 +48,17 @@ jobs: # for #347, mcpx.yml for nix#436, mod-tidy.yml for graph); map and # identity were the last two without one, and build/vet pass on # an untidy module, so drift here would be silent (#349). - # `go mod tidy -diff` prints the diff and exits nonzero when - # go.mod or go.sum is not tidy, without modifying the files. - run: go mod tidy -diff + # Pattern copied from go-modules-build.yml: these modules pin + # Go 1.21/1.22, whose `go mod tidy` has no -diff flag (added in + # Go 1.24; mcpx.yml can use it only because mcpx pins Go 1.27), + # so run tidy and fail if it changed anything. + run: | + go mod tidy + if [[ -n "$(git status --short -- go.mod go.sum)" ]]; then + echo "go mod tidy changed go.mod or go.sum; commit the tidy changes." + git diff -- go.mod go.sum + exit 1 + fi - name: Build working-directory: pkgs/map