Skip to content

♻️ refactor(controller): remaining workload reconcilers native v1beta1 (8e-4to7) - #174

Merged
konih merged 4 commits into
mainfrom
worktree-agent-a29c468da92367298
Jul 30, 2026
Merged

konih merged 4 commits into
mainfrom
worktree-agent-a29c468da92367298

Conversation

@konih

@konih konih commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

8e-4to7 — remaining four workload reconcilers native v1beta1

Applies the exact 8e-3 Queue template to the last four workload reconcilers. Each kind now Gets its object, adds/removes its finalizer, maps its toMQ*Spec, writes status/events, and wires SetupWithManager For(...) on messagingv1beta1. The shared type-switch files (adoption_policy.go, lifecycle_policy.go, suspend.go) gain a case *messagingv1beta1.<Kind>: beside the retained case *messagingv1alpha1.<Kind>: (kept compiling until 8e-8 deletes the v1alpha1 types). No v1alpha1 types or the conversion webhook are removed (that is 8e-8).

Per kind (one commit each)

  • Topic — Get/finalizer/ensureTopic/toMQTopicSpec/SetupWithManager → v1beta1; attribute-fold precedence (ADR-0021) unchanged.
  • Channel — → v1beta1; SDR/RCVR+TLS mapping, unsupported-type guard, and referential guard on deleting QMC preserved (message string left verbatim — pure version flip, no behavior change).
  • ChannelAuthRule — → v1beta1; BLOCKADDR/BLOCKUSER/USERMAP/SSLPEERMAP/QMGRMAP + missing-target requeue preserved.
  • AuthorityRecord — → v1beta1; channel/namelist/qmgr profile parity + define-only no-op edge preserved.

Grep-gate

grep -rn messagingv1alpha1 internal/controller/*_controller.go → 0 matches (no v1alpha1 reconcile import in any *_controller.go). Shared type-switch files still reference v1alpha1 cases by design (removed with the types in 8e-8).

Test re-pointing (mirrors the Queue template)

Per-kind reconciled objects, finalizers, kind enums, LocalObjectReference, DeletionPolicy/ForceOrphan flipped to v1beta1. QMC creation and shared status constants (ConditionSynced, ReasonAvailable, …) kept on v1alpha1 exactly as queue_reconciler_test.go does (value-identical / envtest conversion). Shared-helper tests (adoption_policy_test, suspend_test, status_helpers_test, mqobject_iface_test, reconcile_shared_test, fixtures_test) intentionally stay on v1alpha1 — they exercise the retained v1alpha1 switch path.

Files touched beyond the stated Touches (compile-driven necessity): reconcile_error_branches_test.go and drift_policy_test.go — both call kind-specific helpers/sample* that flipped to v1beta1, so their Topic/Channel portions were re-pointed. No validation files needed changes (validation does not import the reconcilers).

Gate results

  • task verify — ok (codegen clean, no CRD change)
  • task lint — 0 issues + go-arch-lint OK (after golangci-lint cache clean; the initial run replayed stale sibling-worktree cache entries — known MKurator quirk)
  • task test:run — all green; internal/ coverage 92.3% (floor 90%), api/ coverage 76.6% (floor 75%). Envtest reconciler specs (create/adopt/drift/suspend/delete per kind) ran here, plus test/admission and test/conversionwebhook green.
  • task scrub / task scrub:tree — ok (596 tracked files clean)
  • task format:check — ok (gofmt+goimports+golines)
  • go build ./..., go vet -tags e2e ./..., go vet -tags integration ./... — all clean
  • e2e — skipped-harness-unavailable (no local kind cluster provisioned). CI runs e2e (kustomize) on this PR.

Boundary respected: no api/v1alpha1 type or conversion-webhook deletion.

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.50000% with 10 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/controller/adoption_policy.go 50.00% 10 Missing ⚠️

📢 Thoughts on this report? Let us know!

@konih
konih marked this pull request as ready for review July 30, 2026 13:58
@konih
konih merged commit ee5a5fb into main Jul 30, 2026
26 checks passed
@konih
konih deleted the worktree-agent-a29c468da92367298 branch July 30, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant