Update renovate and pinning behavior, run tools from go.mod (#4759)
- Renovate config:recommended (config:base is deprecated) and matchPackageNames globs instead of the deprecated matchPackagePrefixes. Vulnerability alerts get a fast path: 2-day quarantine, no concurrency/hourly/schedule limits. Go modules are no longer grouped into one "go deps" PR — each gets its own, so a bad bump can be reverted alone. The pion modules stay grouped as a documented exception: they're co-released and interdependent, so individual PRs wouldn't build. First-party github.com/livekit/** skips the 2-week quarantine. go.mod's go directive is no longer an update target — the build toolchain is pinned in the Dockerfile instead. Dockerfile deps get pinDigests; the golang image is ungrouped with separateMinorPatch so a patch and a minor bump are each separately approvable. Custom manager to bump the builder image's -alpineA.B suffix together with its digest, which the stock docker manager holds fixed. - Pinning Both Dockerfiles pin golang and alpine by digest alongside the readable tag. GOTOOLCHAIN=local so a go.mod bump fails loudly instead of silently downloading a different toolchain. apk upgrade in the runtime stage — a digest pin plus the 2-week quarantine would otherwise ship base-package CVEs Alpine has already fixed. This relies on a cold layer cache, which holds today because the release workflow configures no buildx cache; there's a comment saying so. Workflows resolve the Go version from the Dockerfile via .github/scripts/go-version.sh, so tests, releases and images share one toolchain. - Tools All four code generators now come from the module graph, and tools/tools.go (the pre-Go-1.24 blank-import idiom) is replaced by go.mod tool directives: tool how why goimports go tool lives in x/tools — its own module is the one being selected gotestfmt go tool zero dependencies, nothing to skew wire go run pins x/tools v0.24.1; building it in our graph changes its output counterfeiter go run unchanged, matches its //go:generate directives The wire distinction is load-bearing. Building wire inside our module raises it from the x/tools v0.24.1 it pins to our v0.48.0, and that module version difference changes what it generates: it falls back to v/v2/v3 instead of deriving real identifiers from the type. wire_gen.go is regenerated here to match the in-module build — a cosmetic rename of 9 lines, with no other change to the generated code. golangci-lint deliberately keeps its action rather than becoming a tool: it pins its own x/tools (v0.44.0 vs our v0.48.0) for the analyzers it bundles, adding it to go.mod would double our go.mod/go.sum (158→338 / 441→889 lines), and the action supplies caching, only-new-issues and PR annotations that invoking a binary can't. Its version stays manual by request.
This commit is contained in:
@@ -14,12 +14,19 @@
|
||||
|
||||
# Mock LiveKit API server for SDK conformance testing. Build from the repo
|
||||
# root: docker build -f cmd/test-server/Dockerfile -t livekit/test-server .
|
||||
FROM golang:1.26-alpine AS builder
|
||||
#
|
||||
# Pinned by digest so the build is reproducible even if the tag is republished.
|
||||
# The tag is kept alongside it for readability; Renovate updates both together.
|
||||
FROM golang:1.26.6-alpine3.24@sha256:af8d6740070b8906d12eae1c3e3ea0957fb63f492051ea05e354c38ef9fe88df AS builder
|
||||
|
||||
ARG TARGETARCH
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
# Build with exactly the toolchain in this image; fail (don't silently download)
|
||||
# if go.mod ever requires a newer version, so the pinned image stays authoritative.
|
||||
ENV GOTOOLCHAIN=local
|
||||
|
||||
COPY go.mod go.mod
|
||||
COPY go.sum go.sum
|
||||
RUN go mod download
|
||||
@@ -30,7 +37,12 @@ COPY version/ version/
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH GO111MODULE=on go build -a -o livekit-test-server ./cmd/test-server
|
||||
|
||||
FROM alpine
|
||||
FROM alpine:3.24.1@sha256:28bd5fe8b56d1bd048e5babf5b10710ebe0bae67db86916198a6eec434943f8b
|
||||
|
||||
# Pull the latest security patches for base packages within the pinned Alpine
|
||||
# release; the digest above is only refreshed by a Renovate PR. See the note in
|
||||
# the repo-root Dockerfile about the cold-cache assumption.
|
||||
RUN apk upgrade --no-cache
|
||||
|
||||
COPY --from=builder /workspace/livekit-test-server /livekit-test-server
|
||||
|
||||
|
||||
Reference in New Issue
Block a user