Skip to content

Commit 9938852

Browse files
committed
docs: update the dependency guide for the pin cleanup
The cleanup PRs changed several of the things this guide described: - the gofumpt scripts were removed, so both mentions go - the ko version is now single-sourced in the Makefile rather than repeated in two scripts - the @latest invocations are pinned, so the "known debt, leave them alone" note becomes "do not introduce one" - the tools module that imports k8s.io/kops now has a replace to the root
1 parent 5697da3 commit 9938852

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

docs/dependency-updates.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ under `tests/e2e/scenarios/`, and small modules under `tools/`. Points to know:
107107
- The root module holds the `vendor/` tree and any `replace` directives.
108108
- `hack/go.mod` uses a Go `tool` directive block to pin the lint/codegen tooling.
109109
- `tests/e2e/go.mod` carries a `replace` pointing at the repo root, so it tracks local changes.
110-
- Some of the small `tools/` modules have **no `replace` back to the root**, so they resolve the
111-
published `k8s.io/kops` from the module proxy and do not see local changes.
110+
- The small modules under `tools/` that import `k8s.io/kops` also carry a `replace` to the root. If
111+
you add a module that imports the root, give it one too, or it will silently compile against the
112+
last published release instead of this tree.
112113

113114
### Recipe
114115

@@ -203,15 +204,15 @@ Versions pinned as literals instead, each needing a hand edit:
203204

204205
| File | Pin |
205206
|---|---|
206-
| `Makefile` | `CODEGEN_VERSION` (see [Go modules](#go-modules)) and the `ko` version in the `KO` variable |
207+
| `Makefile` | `CODEGEN_VERSION` (see [Go modules](#go-modules)) and `KO_VERSION`, which the `hack/` and `discovery/` scripts read back out of the Makefile rather than repeating |
207208
| `hack/verify-shellcheck.sh` | `SHELLCHECK_VERSION` **and** `SHELLCHECK_IMAGE`, which carries both a tag and a digest — a comment in the file says to keep them in sync, and all three values change together |
208209
| `hack/verify-terraform.sh` | `TF_TAG` |
209-
| `hack/{verify,update}-gofumpt.sh` | a `go install mvdan.cc/gofumpt@<version>` line in each |
210210
| `clusterapi/gen.go` | a `go run sigs.k8s.io/controller-tools/cmd/controller-gen@<version>` line |
211211
| `images/mkdocs/requirements.txt` | the mkdocs Python packages — see [Miscellaneous](#miscellaneous-surfaces) |
212212

213-
Some tool invocations use `@latest` and are therefore not reproducible. Treat these as known debt:
214-
do not "bump" them, and do not convert them to pins as a side effect of an unrelated change.
213+
Do not introduce `@latest` in a `go run` or `go install` invocation — it makes the build
214+
irreproducible and lets an upstream release break the repo with no local commit. Pin the version, or
215+
better, run the tool out of the `hack` module so there is one pin.
215216

216217
## GitHub Actions
217218

@@ -583,9 +584,6 @@ Each Prow check is its own job invoking a single make target (`pull-kops-verify-
583584
`make verify-gomod`, and so on); `pull-kops-verify-generated` runs `make verify-generate`, which
584585
resolves to just `verify-crds`. `make ci` is the closest single local approximation to the union.
585586

586-
One gap: `hack/verify-gofumpt.sh` is wired into no `make` target and is run by no job in either
587-
system. If you care about it, run it by hand.
588-
589587
## Commit and pull request conventions
590588

591589
### Commits

0 commit comments

Comments
 (0)