You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ci: add build-tag matrix to catch test build breakage (disable_rclone/disable_rsync currently broken) #2186
The documented TAGS=disable_<mover> build tags are never compiled in CI, and the test build is currently broken for two of the five tags. go build/make build does not type-check _test.go files, so this has gone unnoticed.
$ go vet -tags disable_rclone ./internal/... ./kubectl-volsync/...vet: internal/controller/suite_test.go:118:16: undefined: rclone.Register
$ go vet -tags disable_rsync ./internal/... ./kubectl-volsync/...vet: internal/controller/suite_test.go:117:15: undefined: rsync.Register
disable_restic, disable_rsynctls, and disable_syncthing vet clean.
Cause
The mover packages are build-tag gated (internal/controller/mover/rclone/builder.go:1, internal/controller/mover/rsync/builder.go:1, etc.), but the controller suite imports and registers two of them unconditionally:
TAGS=disable_rsync make test (documented at Makefile:36, tag list at Makefile:33-50) cannot compile, so the documented workflow is broken for 2 of 5 movers.
Reduced-mover builds are the kind of configuration downstream products use (e.g. FIPS builds, per-mover image trimming), and they are only smoke-tested by go build, which ignores test files.
Proposal
Move the mover imports/registrations in the controller suite into build-tagged test files, e.g. suite_movers_rsync_test.go with //go:build !disable_rsync, so the suite compiles with any subset registered.
Add a CI job with a matrix over the five tags that runs go vet -tags <tag> ./.... This needs no envtest, no cluster, and no containers; each invocation takes a few seconds.
Optionally run make test TAGS=disable_syncthing (or similar) for one tag to prove the suite also passes in a reduced build, not just compiles.
Acceptance criteria
go vet -tags <tag> ./... passes for all five disable_* tags.
A CI job fails when a new mover is added without matching tag hygiene.
No change to e2e runtime; Test-operator job unchanged (or at most ~1 minute slower).
Activity
Fail the mover vet job when a mover file lacks its disable tag