Skip to content

ci: add build-tag matrix to catch test build breakage (disable_rclone/disable_rsync currently broken) #2186

Open

Description

@JohnStrunk

Summary

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:

// internal/controller/suite_test.go:117-119
Expect(rsync.Register()).To(Succeed())
Expect(rclone.Register()).To(Succeed())
//	Expect(restic.Register()).To(Succeed())

Impact

  • 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

  1. 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.
  2. 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.
  3. 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).

(AI generated)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions