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
- Treat `semanticrouter_types.go` as the schema hotspot and `semanticrouter_webhook.go` as the admission-validation hotspot, not as catch-all homes for every operator config change.
11
-
- Keep sample and webhook regression tests aligned with the operator contract without pushing fixture-specific logic into production types.
10
+
- Schema lives in `semanticrouter_types.go` plus `semanticrouter_types_*.go` family files; keep the root types file limited to `SemanticRouter` / `Spec` / `Status` CR wiring.
11
+
- Admission: `semanticrouter_webhook.go` registers only; `semanticrouter_validate_deployment.go` covers infra (HPA, probes, ingress, persistence); `semanticrouter_validate_configspec*.go` covers `spec.config` by the same families as `semanticrouter_types_configspec.go`.
12
+
- Keep sample and webhook regression tests aligned with the operator contract without pushing fixture-specific logic into production types. Register curated samples in `sample_fixtures_manifest_test.go` (`curatedOperatorSamples`).
12
13
13
14
## Change Rules
14
15
15
16
- Do not add controller-side canonical config translation logic into API type or webhook files.
16
-
- When a spec family grows, prefer dedicated schema-family or validation-helper files over widening `semanticrouter_types.go`or `semanticrouter_webhook.go`.
17
+
- When a spec family grows, extend the matching `semanticrouter_types_*.go`, `semanticrouter_validate_configspec_*.go`, and controller `canonical_config_operator_*.go`files instead of widening `semanticrouter_webhook.go` or the CR root types file.
17
18
- Keep generated CRD, sample fixtures, and webhook tests aligned with the API contract in the same change; do not leave schema drift for a later patch.
18
19
- If a change requires edits in both schema declaration and semantic validation, keep the files separate and make the shared contract seam explicit instead of widening one hotspot.
0 commit comments