Upgrade module pins to newest releases and make dependency checks authoritative
ci / build and test (pull_request) Successful in 1m4s
ci / build and test (pull_request) Successful in 1m4s
The require blocks were unchanged from the base manifest even though newer releases are available for most modules. Pin every module to the newest release observed on proxy.golang.org, add the checksums published by sum.golang.org, and add the transitive modules the upgraded graph now needs (bitset, clipperhouse/displaywidth, clipperhouse/stringish, clipperhouse/uax29/v2, go.yaml.in/yaml/v3). charmbracelet/huh is a direct import and is recorded as such. Rewrite scripts/check-deps.sh so it never treats the local module cache as evidence of what the newest release is. It uses `go list -m -u` when the proxy is reachable and otherwise compares every go.mod pin with the dependency facts prepared by the execution profile, validating the report source, freshness status and query scope. If neither source is available it exits with status 2 instead of reporting success. Add scripts/test-check-deps.sh, which covers stale, uncovered and unverifiable pins without network access, and scripts/test-ci-workflow.sh, which checks that the single Gitea Actions job still runs on pull requests and invokes the checks. Both run from scripts/check.sh, so one pass verifies formatting, vet, build, tests, the CI workflow and dependency freshness. `go build ./...`, `go vet ./...`, `go test -cover ./...`, `go mod verify` and the new scripts all pass in the sandbox.
This commit is contained in:
1 parent
f3f6b5dfb4
commit
c098c93ae9
8 files changed
+405
-97
No files matched your search
+12
-5
@@ -24,13 +24,18 @@ Every pull request and every push to `main` runs the `ci` workflow in
|
||||
[`.gitea/workflows/ci.yml`](../.gitea/workflows/ci.yml). It has a single `check`
|
||||
job with two steps:
|
||||
|
||||
1. [`scripts/check.sh`](../scripts/check.sh) fails if any Go file is not
|
||||
`gofmt`-formatted, then runs `go mod verify`, `go vet ./...`,
|
||||
1. [`scripts/check.sh`](../scripts/check.sh) first validates the workflow and
|
||||
the dependency-policy scripts themselves, then fails if any Go file is not
|
||||
`gofmt`-formatted, and finally runs `go mod verify`, `go vet ./...`,
|
||||
`go build ./...`, and `go test -cover ./...`.
|
||||
2. [`scripts/check-deps.sh`](../scripts/check-deps.sh) fails when a module
|
||||
pinned in `go.mod` has a newer release. It asks the module proxy for the
|
||||
newest release and falls back to the newest versions in the local module
|
||||
cache when the proxy is disabled.
|
||||
newest release of every pinned module. When the proxy is disabled it uses
|
||||
the dependency facts prepared by the execution profile (the file named by
|
||||
`MAINTAINER_DEPENDENCY_FACTS`), which record the newest release observed on
|
||||
`proxy.golang.org` and when. If neither source is available the script
|
||||
exits with status 2 instead of assuming the pins are current; the local
|
||||
module cache is never used as evidence of what the newest release is.
|
||||
|
||||
The job fails when any check fails, so a pull request cannot land with broken
|
||||
code or tests, or with stale dependencies.
|
||||
@@ -44,7 +49,9 @@ Run the same checks locally with:
|
||||
|
||||
[`internal/ci/workflow_test.go`](../internal/ci/workflow_test.go) parses the
|
||||
workflow and fails `go test ./...` if it stops running on pull requests or
|
||||
stops invoking those scripts.
|
||||
stops invoking those scripts; [`scripts/test-ci-workflow.sh`](../scripts/test-ci-workflow.sh)
|
||||
and [`scripts/test-check-deps.sh`](../scripts/test-check-deps.sh) cover the same
|
||||
behaviour without needing a Go module download.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in new issue
Block a user