Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,16 @@ updates:

# Go modules were not covered above, so Go advisories reached us only as a red
# trivy-scan gate and had to be bumped by hand -- CVE-2026-84304 (grpc) in #203.
# Dependabot needs one entry per go.mod; there is no recursive directory match.
#
# `directories` is a shorthand for the two go.mod files, NOT a way to bundle them:
# Dependabot still opens one PR per directory. Bundling would need
# `group-by: dependency-name`, which is version-updates-only and splits one PR per
# dependency -- so it would leave security bumps, the reason this entry exists,
# unbundled. The root go.work is what keeps those per-directory PRs green; see #212.
- package-ecosystem: gomod
directory: /gen/go
directories:
- /gen/go
- /remote-worker
schedule:
interval: weekly
groups:
Expand All @@ -39,14 +46,3 @@ updates:
- 'google.golang.org/grpc*'
- 'google.golang.org/protobuf*'
- 'google.golang.org/genproto*'

- package-ecosystem: gomod
directory: /remote-worker
schedule:
interval: weekly
groups:
grpc-protobuf:
patterns:
- 'google.golang.org/grpc*'
- 'google.golang.org/protobuf*'
- 'google.golang.org/genproto*'
25 changes: 25 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,19 @@ jobs:
git diff --cached --exit-code -- packages/k8s-sandbox/src/gen gen \
|| { echo "::error::Generated stubs are out of date or untracked. Run 'buf generate' and commit."; exit 1; }

# A module left out of go.work falls back to standalone resolution and brings
# back the stale-go.mod failure the workspace exists to prevent (#212).
- name: Verify go.work covers every module
run: |
covered="$(go work edit -json | jq -r '.Use[].DiskPath')"
rc=0
while read -r mod; do
dir="./$(dirname "$mod")"
grep -qxF "$dir" <<<"$covered" \
|| { echo "::error file=$mod::$mod is not listed in go.work -- add \"$dir\" to the use block."; rc=1; }
done < <(git ls-files | grep -E '(^|/)go\.mod$')
exit $rc

- name: Build and test Go stubs
run: cd gen/go && go build ./... && go test ./...

Expand All @@ -154,3 +167,15 @@ jobs:
test -z "$(gofmt -l .)" || { echo "::error::gofmt needs running:"; gofmt -l .; exit 1; }
go vet ./...
go test -race ./...

# Advisory only. In workspace mode a stale go.mod no longer breaks the build, so
# this is hygiene rather than correctness -- and failing here would put Dependabot's
# coupled bumps back in the red, which is the whole point of #212. Neither module is
# consumed externally (gen/go is reached only through the local replace), so drift
# can be tidied whenever convenient.
- name: Check go.mod tidiness (advisory)
run: |
for mod in gen/go remote-worker; do
(cd "$mod" && go mod tidy -diff) \
|| echo "::warning file=$mod/go.mod::$mod/go.mod is not tidy -- run 'cd $mod && go mod tidy'"
done
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ docs/plans/*
# E2 writes each run's measured table here; experiments/RESULTS.md is the committed
# baseline and is no longer overwritten by a test run (see experiments/README.md).
experiments/.results/

# Workspace-only checksums. Redundant with each module go.sum, and the checksum
# database still verifies downloads without it -- one less sum file to keep in sync.
go.work.sum
15 changes: 15 additions & 0 deletions go.work
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Both Go modules are coupled: remote-worker consumes gen/go through a local
// `replace`, and the `proto` CI job builds both. Without a workspace, any bump to a
// gen/go dependency leaves remote-worker/go.mod stale and the build fails with
// "updates to go.mod needed" -- which Dependabot cannot fix, because the tidy has to
// land in the same commit as the bump and its branches are not maintainer-writable.
// In workspace mode the go command resolves one MVS across both modules, so the
// modules can be bumped independently. See issue #212.
//
// Keep this `go` line in sync with both go.mod files (and CI's go-version-file).
go 1.25.0

use (
./gen/go
./remote-worker
)
3 changes: 3 additions & 0 deletions remote-worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# RELAY_ADDR=sandbox-relay.default.svc:8443 (no port-forward needed in-cluster).
FROM golang:1.25-alpine AS build
WORKDIR /src
# go.work first: it is what lets the two modules be bumped independently (see #212).
# Without it the build here resolves each go.mod on its own and fails on a stale one.
COPY go.work ./
COPY gen/go/ ./gen/go/
COPY remote-worker/ ./remote-worker/
WORKDIR /src/remote-worker
Expand Down
Loading