Migrate off labkit v1 to labkit/v2
What does this MR do?
Removes the gitlab.com/gitlab-org/labkit (v1) dependency. The runner required
both v1 and labkit/v2; this drops v1 so only v2 remains.
The remaining v1 usage was two packages:
labkit/fields → labkit/v2/fields. A pure import-path change. Only
DurationS and HTTPStatusCode are used, and both have identical values in v2
("duration_s" and "status"), so emitted log field names are unchanged.
labkit/fips → new local helpers/fips. labkit/v2 has no fips package,
which is what blocked the automated major-version bump in !7084 (closed). Only two
functions were used:
Enabled()— returnscrypto/boring.Enabled(), same as labkit's.Check()— logs whether FIPS crypto is active. It now logs vialogrusinstead oflabkit/log(which would pull labkit v1 straight back in), and no longer returns abool. labkit had already deprecated that return value in favour ofEnabled(), and the runner's only caller (main.go) ignored it.
The package is split on the fips build tag that Makefile.build.mk and
Makefile.runner_helper.mk already use for the FIPS binaries. This follows the
same approach fleeting took in
fleeting!116.
Unlike fleeting's version, this one omits SupportedAlgorithms() /
DefaultAlgorithms() and their SSH algorithm filtering — the runner never used
them.
Dropping the v1 requirement also removes four transitive dependencies:
grpc-ecosystem/go-grpc-middleware/v2, oklog/ulid/v2, sebest/xff and
gitlab-org/go/reopen.
Why was this MR needed?
!7084 (closed) (Renovate's labkit → v2 bump) cannot be completed mechanically: the
import paths change and there is no v2 home for fips. Renovate also failed to
generate a go.sum on that branch (mod: not found in its artifact step). This
supersedes it.
Verification
go build ./...andgo veton all touched packages.GOEXPERIMENT=boringcrypto go build -tags fips ./helpers/fips/— the FIPS-tagged variant compiles the way CI builds it.go test ./commands/— coverssetFipsHelperImageFlavor.go mod tidyproduces no changes beyond the removals above.
What are the relevant issue numbers?
Supersedes !7084 (closed).