CI: download modules one directory at a time, retried
The hub rate-limits public git reads per address, and a cold module cache fetched four hub repos at once, past the burst: vet failed with HTTP 429 on every run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+17
−2
Makefile+17 −2
CI passed — run details
diff --git a/Makefile b/Makefile| index 325fa46..2f2a794 100644 |
| --- a/Makefile |
| +++ b/Makefile |
| @@ -4,7 +4,7 @@ export GOPRIVATE := $(GOPRIVATE),amadan.net/oficina/estilo.git |
| private_comma := , |
| export GOPRIVATE := $(if $(GOPRIVATE),$(GOPRIVATE)$(private_comma))amadan.net/oficina/estilo.git,amadan.net/carlos/platform.git |
| -.PHONY: build release test test-vet test-fmt test-build test-go test-race |
| +.PHONY: build release deps test test-vet test-fmt test-build test-go test-race |
| # One binary, CGO_ENABLED=0, cgo-free SQLite (AGENTS.md / Deploys). Set |
| # per-target rather than exported globally, because test-race is a |
| @@ -65,7 +65,22 @@ release: |
| # `go test` next, and -race — by far the slowest step — last. |
| test: test-vet test-fmt test-build test-go test-race |
| -test-vet: |
| +# The modules first, one directory at a time and retried. The hub |
| +# rate-limits public git reads per address (5 a second, a burst of 10), |
| +# and a cold module cache fetches estilo, rastrillo, the platform and |
| +# this repo at once — more than the burst — so vet failed every run |
| +# with HTTP 429 however long the runner waited between runs. What one |
| +# attempt fetched stays cached, so each retry asks for less. |
| +deps: |
| + @for dir in . handoff roster connect; do \ |
| + n=0; until (cd $$dir && go mod download); do \ |
| + n=$$((n+1)); [ $$n -lt 6 ] || exit 1; \ |
| + echo "go mod download in $$dir failed (the hub's git rate limit?); retrying in $$((n*5))s"; \ |
| + sleep $$((n*5)); \ |
| + done; \ |
| + done |
| + |
| +test-vet: deps |
| CGO_ENABLED=0 go vet ./... |
| cd handoff && CGO_ENABLED=0 go vet ./... |
| cd roster && CGO_ENABLED=0 go vet ./... |