Reviewer · Configurations
Scope and clean dependency overrides
Keep configuration entries (go.mod replace directives, .gitattributes patterns, version pins) scoped to exactly what changed, and ensure version references stay consistent and accurate across all related files.
Keep configuration entries (go.mod replace directives, .gitattributes patterns, version pins) scoped to exactly what changed, and ensure version references stay consistent and accurate across all related files.
- Scope minimally: a
replacedirective should target only the module(s) that actually changed. If onlyclientdepends on a fork, don’t add a redundantreplaceinapi/go.modtoo — this avoids unnecessary vendoring/code churn. Similarly, glob patterns in files like.gitattributesshould be as broad or narrow as the intent requires (e.g. prefer a general**/*.pb.goover an overly specific/daemon/**/*.pb.goif the rule should apply repo-wide). - Flag temporary overrides clearly and remove them before merge: a
replacepointing to a personal fork or pseudo-version for testing purposes must carry an explicit marker (e.g.// FIXME(user): testing <link-to-upstream-PR>) and a tracked follow-up to remove it once the upstream change is tagged/released. Don’t let a temporary/test replace directive land in a merged PR. - Keep versions consistent: when bumping a dependency, make sure the version in
go.mod, the PR title/description,go.sum, andvendor/modules.txtall agree. Mismatched versions (e.g.requiresaysv0.3.1while the PR title saysv0.3.2) make it impossible to verify what’s actually shipped and complicate future bisecting. - Favor discoverability for hand-maintained version pins: when a version is pinned inline in a script (e.g.
hack/make.ps1), prefer keeping the update-tooling annotation (e.g. arenovate:comment) next to the version itself rather than moving the logic entirely into a separate automation config, so the pin remains easy to find and reason about when reading or refactoring the code.
Example of a properly flagged temporary override:
// FIXME(thaJeztah): testing https://github.com/moby/go-archive/pull/93 — remove once tagged upstream
replace github.com/moby/go-archive => github.com/thaJeztah/go-archive v0.0.0-20260731141554-6c3be27c2c56