Skip to content

🔥 feat(api)!: stop serving v1alpha1 — single-version CRDs, remove conversion webhook (8e-8a) - #175

Merged
konih merged 8 commits into
mainfrom
feat/8e-8a-stop-serving-v1alpha1
Jul 30, 2026
Merged

konih merged 8 commits into
mainfrom
feat/8e-8a-stop-serving-v1alpha1

Conversation

@konih

@konih konih commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

8e-8a — stop serving v1alpha1 (single-version CRDs, remove conversion webhook)

🔴 PUBLIC-CRD, breaking. Stops the six messaging.mkurator.dev CRDs serving v1alpha1: they are now single-version (v1beta1 served + stored) and the conversion webhook wiring is gone. The v1alpha1 Go types + internal/webhook/v1alpha1 + internal/webhook/conversion packages stay on disk (unwired) for the 8e-8b follow-up.

What changed

  1. CRDs single-version (codegen path). Narrowed controller-gen CRD/webhook paths to ./api/v1beta1/... + ./internal/webhook/v1beta1/... in both Taskfile.yml (manifests) and hack/verify.sh (its own controller-gen call) — deepcopy still spans ./api/.... Regenerated config/crd/bases + charts/mkurator/crds + docs/crds: single-version, no conversion: stanza.
  2. cmd/main.go: dropped messagingv1alpha1.AddToScheme, webhookconversion.SetupWithManager, webhookv1alpha1.SetupWithManager (packages kept, just unwired).
  3. Conversion kustomize wiring removed: config/crd/patches/{webhook,cainjection}_in_*.yaml, config/crd/kustomizeconfig.yaml, and the CRD-target CA-injection replacement block in config/default/kustomization.yaml. The v1beta1 validating-webhook wiring is untouched.
  4. Helm regen (P1): charts/mkurator/crds/* single-version, no conversion; dropped the 6 v1alpha1 blocks from the chart's ValidatingWebhookConfiguration template; rewrote hack/helm-verify-crds.sh (assert single-version + no conversion) and hack/helm-verify-admission.sh (6 v1beta1 paths).
  5. Test surgery: deleted test/conversionwebhook/, test/e2e/conversion_e2e_test.go + unused helpers, the internal/webhook/v1alpha1 envtest suite (cel_validation_test.go+suite_test.go); re-pointed test/admission, test/samples, e2e YAMLs to v1beta1; deleted the AUTH-15 "pre-union spoke" e2e (premise gone). grep -rn v1alpha1 test/ is empty.
  6. Stored-version guard e2e (decision C): asserts status.storedVersions == ["v1beta1"] for all six kinds and fails loud if any still lists the legacy spoke — converts the bricked-upgrade P0 into a red gate. Plus a post-install CR write+read smoke (proves the single-version CRD accepts writes with no dangling conversion; runs in kustomize + helm smoke).
  7. CHANGELOG breaking Removed + new docs/UPGRADE.md "Removing v1alpha1" section (pre-flight storedVersions check + bricked-upgrade warning).

⚠️ Scope surprises the reviewer must see

  • internal/controller/*_test.go had to be repointed too (NOT in the task's file list). 11 envtest suites created/listed v1alpha1 objects through the API server (66/67 controller specs failed once CRDs went single-version). Fixed surgically: flipped only the envtest (k8sClient) call-sites to v1beta1; left the 9 fake-client unit suites on v1alpha1 (fake client uses the runtime scheme — v1alpha1 still registered — so they pass unchanged AND keep coverage on the kept v1alpha1 source branches for 8e-8b). queuemanagerconnection_native_v1beta1_test.go keeps its v1alpha1 type/constant refs (write-recorder + finalizer-equality; kept types, no served-version dependency).
  • AUTH-14/15 coverage removed: the AUTH-15 e2e (test/e2e) and the internal/webhook/v1alpha1 CEL envtest tested behavior that ceases to exist once v1alpha1 is unserved. Consistent with the operator's 8e hard-cut decision (supersedes fix(api): preserve authentication union across v1alpha1 spoke round trip (AUTH-14) #168), but naming it explicitly.

Gates (local)

  • task verify ✅ (codegen-clean, single-version) · task format:check ✅ · task scrub ✅
  • task test:run ✅ — internal 91.8% (≥90 floor) · api 76.6% (≥75 floor)
  • task helm:lint ✅ · task helm:test ✅ (22)
  • go build ./..., go vet (default/e2e/integration tags) ✅
  • task lint — clean for this worktree (the reported issues are all in a sibling agent's parallel worktree ../agent-a29c…; CI builds a clean checkout)
  • e2e: skipped-harness-unavailable locally (no kind cluster / docker down) — relying on CI e2e (kustomize) + e2e (helm).

Do not merge / self-approve — awaiting independent review + green CI.

konih added 7 commits July 30, 2026 16:22
…(8e-8a)

- narrow controller-gen CRD/webhook codegen to ./api/v1beta1 + ./internal/webhook/v1beta1
  (Taskfile manifests + hack/verify.sh) so CRDs are single-version v1beta1 and the
  v1alpha1 validating-webhook entries drop out; deepcopy still spans ./api/... so the
  kept-but-unwired v1alpha1 Go types stay generated (8e-8b deletes them)
- regenerate config/crd/bases + charts/mkurator/crds: single-version, no conversion stanza
- remove conversion kustomize wiring: webhook_in_*/cainjection_in_* patches,
  kustomizeconfig.yaml, config/default CR-target CA-injection replacement block
- cmd/main.go: drop messagingv1alpha1 scheme + conversion/v1alpha1 webhook SetupWithManager
- hack/helm-verify-crds.sh: assert single-version, no conversion; helm-verify-admission.sh: 6 v1beta1 paths
- delete v1alpha1 QMC sample (AUTH-15 twin); refresh docs/crds prose
- v1alpha1 Go types + webhook/conversion packages KEPT on disk (unwired) for 8e-8b
…a1 (8e-8a)

- delete test/conversionwebhook/ and test/e2e/conversion_e2e_test.go + unused helpers
  (setQueueStorageVersion/queueStored*/queueServed*/eventuallyExpectQueueSynced,
  upgradeMKuratorCRDs, expectCRDConversionWebhook)
- flip all e2e CR manifests to messaging.mkurator.dev/v1beta1; delete the AUTH-15
  'pre-union spoke' e2e (premise gone with the removed spoke version)
- re-point test/admission/webhook_envtest_test.go + test/samples/samples_test.go +
  test/e2e/events_helpers.go to v1beta1; consolidate duplicate QMC helper
- delete internal/webhook/v1alpha1 envtest suite (cel_validation_test.go + suite_test.go)
  that created v1alpha1 objects against single-version CRDs; KEEP the pure-unit
  webhook_unit_test.go/setup_test.go (fake client) and all non-test source for 8e-8b
- refresh test/schema/README + e2e diagnostic dumps
- grep -rn v1alpha1 test/ is now empty
…8e-8a)

- assert status.storedVersions == [v1beta1] for all six kinds; FAIL LOUD if any CRD
  still lists the legacy spoke version (converts the bricked-upgrade P0 into a red gate)
- create+read-back a v1beta1 QMC post-install to prove the single-version CRD accepts
  writes with no dangling conversion webhook (roast P1); runs in kustomize + helm smoke
- legacy token assembled via concatenation so 'grep -rn v1alpha1 test/' stays empty
- CHANGELOG Removed entry (drives the minor bump): v1alpha1 unserved, CRDs
  single-version, conversion webhook gone; upgrade from <=v0.12 needs the
  stored-object rewrite+prune first
- docs/UPGRADE.md: new 'Removing v1alpha1' section with pre-flight storedVersions
  check and the bricked-upgrade warning
…ean)

An earlier verify run using the pre-narrowing controller-gen paths had clobbered
config/crd/bases back to dual-version; regenerate cleanly so bases + helm CRDs +
docs/crds are single-version v1beta1 with no conversion. task verify is green.
Scope surprise: 11 internal/controller/*_test.go envtest suites created/listed
v1alpha1 objects through the API server, which no longer serves v1alpha1 once the
CRDs are single-version (66/67 controller specs failed at the shared cleanup).

- flip only the envtest (k8sClient) call-sites to v1beta1 (fixtures deleteAllOf,
  suite scheme, reconciler suites); fix v1beta1 pointer shape for CredentialsSecretRef
- LEAVE the 9 fake-client unit suites on v1alpha1 — the fake client uses the runtime
  scheme (v1alpha1 still registered), so they pass unchanged AND keep coverage on the
  kept v1alpha1 source branches (reconcile_shared/suspend/adoption/etc.) for 8e-8b
- queuemanagerconnection_native_v1beta1_test.go keeps its v1alpha1 TYPE/constant refs
  (write-recorder assertion + cross-version finalizer equality) — kept types, no
  served-version dependency; it already created v1beta1 objects

Floors hold: internal 91.8% (>=90), api 76.6% (>=75).
…e (8e-8a)

The chart's ValidatingWebhookConfiguration template hard-coded all 12 webhooks
(6 v1alpha1 + 6 v1beta1); the v1alpha1 handlers are no longer wired and v1alpha1
is unserved, so a rendered v1alpha1 webhook would fail admission. Keep only the 6
v1beta1 webhooks; helm-verify-admission now asserts 6. Refresh webhook-service comment.
@konih
konih marked this pull request as ready for review July 30, 2026 15:02
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The shared setupMQObjectController Watches(&v1alpha1.QueueManagerConnection{})
plus the requestsForConnection fan-out + connectionReady/predicates/mapper were
still v1alpha1. Once 8e-8a drops v1alpha1 from the manager scheme, that source.Kind
watch can't register ('no kind is registered for v1alpha1.QueueManagerConnection'),
so the connection-ready trigger never fires and every workload reconcile times out.
Flip the whole connection-watch block + its unit tests to v1beta1.
@sonarqubecloud

Copy link
Copy Markdown

@konih
konih merged commit b4ed2b2 into main Jul 30, 2026
26 checks passed
@konih
konih deleted the feat/8e-8a-stop-serving-v1alpha1 branch July 30, 2026 15:43
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