API, Codegen, Packaging, and Parity Audit Workflow (`dev-api-and-codegen`)
1. Preconditions & Inputs
Before modifying API schemas, RBAC markers, or chart templates, or running a pre-PR parity audit, read references/parity-checklist.md for the source-to-derived parity matrix.
2. Guardrails
- Do not hand-edit generated files, and sync manually paired artifacts: Treat all generated outputs in references/parity-checklist.md (plus
PROJECT) as read-only outputs ofmake manifests generateandmake version-sync, and manually sync all non-generated paired files in that table. - Preserve API identity, status subresource, and immutable Deployment selector labels: Do not alter
WorkloadMixinggroup/version (k8s-bridge.x-k8s.io/v1alpha1),Namespacedscope, or+kubebuilder:subresource:status, and never addapp.kubernetes.io/componentorapp.kubernetes.io/versionto.spec.selector.matchLabelsinhelm/templates/deployment.yamlorconfig/manager/manager.yaml.
3. Step-by-Step Procedure
Step 1: Edit `WorkloadMixing` Go Types or Controller `+kubebuilder:rbac` Markers
- CRD Schema & Validation: Edit struct fields and Kubebuilder markers in
api/v1alpha1/workloadmixing_types.go(keep paired validation and defaults ininternal/controller/slurmjob/translator.goin sync; see references/parity-checklist.md). - Controller RBAC Permissions: If controller permissions changed, update the
+kubebuilder:rbacannotations aboveReconcileininternal/controller/*/*_controller.go.
Step 2: Run Code and Manifest Generation
Regenerate CRDs, RBAC roles, helm/crds/, and DeepCopy methods:
make manifests generate
Step 3: Synchronize Paired Artifacts & Audit Pre-PR Repository Parity
Walk through every modified row in references/parity-checklist.md and synchronize all derived/paired artifacts.
4. Verification
Verify that version sync, code generation, formatting, static analysis, Kustomize/Helm rendering, and unit/envtest suites succeed with zero uncommitted drift:
make version-sync manifests generate fmt vet lint kustomize
git diff --exit-code
./bin/kustomize build config/default > /dev/null && ./bin/kustomize build config/samples > /dev/null
helm lint ./helm && helm template k8s-bridge ./helm --namespace k8s-bridge-system > /dev/null
make test
5. Handoffs & Related Skills
- To implement controller reconciliation or
JobSettranslation for new CRD fields: Read skills/dev-controller-and-translator/SKILL.md. - To write unit or
envtesttests for new API fields: Read skills/test-unit-and-lint/SKILL.md. - To run the full-cluster Kind or GKE GPU E2E suite before merging: Read skills/test-e2e-cluster/SKILL.md.