Repository navigation
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
Two disabled Ginkgo specs and three dead exported helpers have accumulated. Nothing records why, so they rot: the specs look like coverage, and the helpers look like supported API that is safe to call.
Dead specs
internal/controller/replicationsource_test.go:265—XIt("creates a snapshot of the source PVC and restores it as the sync source", ...). Neighbouring enabled specs cover the bound-snapshot path, but this case is skipped with no comment or linked issue. Either it is a real coverage gap in snapshot-as-source handling (re-enable) or it is obsolete (delete).internal/controller/utils/affinity_test.go:277—XWhen("a PVC is being used only by a VolSync-owned pod", ...)with the comment// Disabled since the code was removed. VolSync ignores its own pods now. This is just dead weight; delete it.
Dead code
Verified with grep over all *.go (including tests):
VolumeHandler.SetAccessModes(internal/controller/volumehandler/volumehandler.go:225) — zero callers anywhere.volumehandler.CopyMethodoption (internal/controller/volumehandler/new.go:104) — zero callers.volumehandler.VolumeSnapshotClassNameoption (internal/controller/volumehandler/new.go:128) — zero callers.
(GetAccessModes is used by the restic mover, AccessModes/Capacity/StorageClassName by tests; those are fine.)
These are in internal/, so removing them is not a public API break.
Proposal
- Delete the
XWhenblock inaffinity_test.go. - Triage the
XItinreplicationsource_test.go: re-enable it, or delete it and open a separate issue if snapshot-as-source deserves coverage. - Delete the three unused helpers/options (or, if they are intended for future movers, cover them with a test and note the intent in a comment).
- Add a short note to the contributor docs (or a lint/check) that disabled specs must carry a reason and a linked issue.
Acceptance criteria
- No
XIt/XDescribe/XWhen/XContextremains without a comment linking an issue. - No exported helper in
internal/has zero non-test callers without documented intent. -
go build ./...and the Go suite unchanged; no CI time added.
(AI generated)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
- StatusShow more project fieldsDone
Activity