8000 feat(components): add ComponentStability contract to proto and CRD admission by VLukiantsev · Pull Request #1538 · google/xmc · GitHub
[go: up one dir, main page]

Skip to content

feat(components): add ComponentStability contract to proto and CRD admission - #1538

Merged
VLukiantsev merged 7 commits into
mainfrom
feat/component-stability-api-b580941989
Nov 3, 2026
Merged

VLukiantsev merged 7 commits into
mainfrom
feat/component-stability-api-b580941989

Conversation

@VLukiantsev
@VLukiantsev VLukiantsev commented Nov 2, 2026 •
Copy link
Copy Markdown
Collaborator

Summary

Introduces the ComponentStability contract (COMPONENT_STABILITY_UNSPECIFIED, COMPONENT_STABILITY_EXPERIMENTAL, COMPONENT_STABILITY_PREVIEW, COMPONENT_STABILITY_STABLE) and acknowledge_experimental field in ComponentSpec (Layer 1 of 4 for b/580941989). Enforces Kubernetes CRD CEL admission validation on components.xmc.dev so enabling an EXPERIMENTAL component requires explicit spec.acknowledgeExperimental: true.

Motivation & Context

The AI Components platform ships components across three maturity levels (EXPERIMENTAL, PREVIEW, STABLE). While STABLE and PREVIEW components can be enabled without extra confirmation, EXPERIMENTAL components may change incompatibly or lose data across upgrades and therefore require explicit administrator acknowledgement before activation. Enforcing this contract at Kubernetes API server admission (x-kubernetes-validations) prevents unacknowledged EXPERIMENTAL components from being enabled via kubectl apply or helm upgrade, while still allowing disabled (spec.enabled: false) EXPERIMENTAL components to ship in profiles.

Key Changes

  • api/protos/components/v1alpha1/components.proto: Added ComponentStability enum (UNSPECIFIED = 0, EXPERIMENTAL = 1, PREVIEW = 2, STABLE = 3), stability (field 11) and acknowledge_experimental (field 12) on ComponentSpec, and stability (field 4) on ComponentPredicate.
  • deploy/helm/templates/components/crd.yaml: Added spec.stability (enum: [EXPERIMENTAL, PREVIEW, STABLE]), spec.acknowledgeExperimental (type: boolean, default: false), and the CEL rule !(self.enabled && has(self.stability) && self.stability == 'EXPERIMENTAL') || self.acknowledgeExperimental == true.
  • pkg/components/bridge/components_admission_test.go: Added envtest suites (TestCRDStabilityValidation, TestCRDPreExistingCROmittedStabilityFieldsUpdate) covering invalid enum values, enabled unacknowledged EXPERIMENTAL rejection, disabled EXPERIMENTAL admission, acknowledged EXPERIMENTAL admission, PREVIEW/STABLE admission, and in-place CRD upgrades for pre-existing CRs.

Assumptions

  • Protobuf vs. CRD Enum Naming: Protobuf uses standard prefixed enum names (COMPONENT_STABILITY_EXPERIMENTAL, COMPONENT_STABILITY_PREVIEW, COMPONENT_STABILITY_STABLE) to satisfy buf lint and package scoping rules, while the Kubernetes CRD components.xmc.dev uses Kubernetes-idiomatic unprefixed enum strings (EXPERIMENTAL, PREVIEW, STABLE).
  • Feature Flag Scope: All component management functionality remains gated behind enable_components=true; deployments with enable_components=false are unaffected.

Verification & Testing

  • Commands Executed:
    • bazel test //api/... //pkg/components/bridge:bridge_test
    • ./.githooks/pre-commit (92/92 affected Bazel test targets passed)
  • Live GKE Cluster Verification (... with enable_components: true):
    • Upgraded GKE environment ... via python3 tools/dev_env/dev_env.py gke-upgrade and verified deploy/ctk_v2/verify_xmc.py (17/17 pods 1/1 Running, all 3 catalog Component CRs Ready=True, Synced=True).
Scenario Action on Live GKE Cluster (...) Observed Result Status
1. Unacknowledged Experimental Rejection kubectl apply Component with enabled: true, stability: EXPERIMENTAL Rejected by API server: spec.acknowledgeExperimental must be set to true when enabling an EXPERIMENTAL component (spec.stability == 'EXPERIMENTAL') ✅ PASS
2. Disabled Experimental Admission kubectl apply Component with enabled: false, stability: EXPERIMENTAL Admitted and reconciled to COMPONENT_STATE_DISABLED ✅ PASS
3. Acknowledged Experimental Admission kubectl apply Component with enabled: true, stability: EXPERIMENTAL, acknowledgeExperimental: true Admitted and reconciled by xmc-bridge ✅ PASS
4. Existing Catalog Components Inspected clickhouse, redpanda, ingestion-gateway CRs All 3 CRs carry spec.stability: STABLE and remain Ready=True ✅ PASS

Related Issues / Bugs

Fixes bug 580941989

TAG=agy
CONV=bfd7efa2-aaa4-46db-a3f1-59cc171656b6


Stack created with GitHub Stacks CLI • Give Feedback 💬

@VLukiantsev
VLukiantsev added this pull request to stack #1542 November 2, 2026 21:02
@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces component stability levels (EXPERIMENTAL, PREVIEW, STABLE) to the Component API and CRD, requiring explicit administrator acknowledgement to enable experimental components. It also adds corresponding CEL validation rules and admission tests. Feedback on the changes suggests refining the CEL validation rule in the Helm template to avoid redundant boolean comparisons and prevent potential evaluation errors by guarding the optional acknowledgeExperimental field with has().

@VLukiantsev
Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a component stability maturity model by adding stability and acknowledge_experimental fields to the component specification, along with a CEL validation rule in the CRD to enforce administrator acknowledgement when enabling experimental components. Feedback on the changes suggests using DryRun options in the integration tests to prevent potential flakiness from AlreadyExists errors during CRD updates, and simplifying the CEL validation rule in the Helm template to improve readability.

@VLukiantsev
Copy link
Copy Markdown
Collaborator Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a component stability contract by adding a ComponentStability enum and stability-related fields to the component specifications. It also implements a Kubernetes CEL validation rule in the CRD to ensure that enabling an experimental component requires explicit administrator acknowledgement. The feedback highlights that the test helper stripCRDStabilityFields blindly removes all x-kubernetes-validations under spec, which is fragile and could unintentionally strip other future validation rules; it is recommended to selectively filter out only the stability-related validation rule instead.

@VLukiantsev
VLukiantsev marked this pull request as ready for review November 3, 2026 09:20
@VLukiantsev VLukiantsev added the priority::2-high top of mind. should not wait. label Nov 3, 2026
janzak-dev
janzak-dev previously approved these changes Nov 3, 2026
Comment thread deploy/profiles/stable-2026a/README.md Resolved
@github-actions github-actions Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Incremental PR Approval

PR author is a code owner and changes since last approval (2 lines) are within the 50-line grace delta.

Preserving prior approval by @janzak-dev on commit 247c58e.

…mission

Define ComponentStability (UNSPECIFIED, EXPERIMENTAL, PREVIEW, STABLE) and acknowledge_experimental in ComponentSpec, enforce admission-level CEL validation on Component.xmc.dev when enabling EXPERIMENTAL components, and add envtest coverage.

TAG=agy

CONV=bfd7efa2-aaa4-46db-a3f1-59cc171656b6
…mission probe

Simplify the Component CRD CEL validation rule for EXPERIMENTAL acknowledgement
to avoid double negation and guard acknowledgeExperimental with has(), and pass
DryRunAll to the CRD update readiness probe in TestCRDPreExistingCROmittedStabilityFieldsUpdate.

TAG=agy
CONV=bfd7efa2-aaa4-46db-a3f1-59cc171656b6
…lityFields

Selectively filters out x-kubernetes-validations rules referencing stability when simulating a pre-upgrade CRD schema in TestCRDPreExistingCROmittedStabilityFieldsUpdate.

TAG=agy
CONV=bfd7efa2-aaa4-46db-a3f1-59cc171656b6
…sion rule

Adds the ComponentStability contract table (STABLE, PREVIEW, EXPERIMENTAL) and CRD CEL admission documentation to pkg/components/README.md and cmd/xmc_bridge/README.md.

TAG=agy
CONV=bfd7efa2-aaa4-46db-a3f1-59cc171656b6
Update deploy/profiles/stable-2026a/README.md to document only the
Kubernetes CRD CEL admission check in Layer 1 (PR #1538); xmc-bridge and
component-linter enforcement are documented in PRs #1539 and #1540.

Comment link: #1538 (comment)
Fixes bug 580941989

TAG=agy
CONV=bfd7efa2-aaa4-46db-a3f1-59cc171656b6
@VLukiantsev
VLukiantsev force-pushed the feat/component-stability-api-b580941989 branch from c205671 to edf6abe Compare November 3, 2026 11:57
@github-actions github-actions Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Incremental PR Approval

PR author is a code owner and changes since last approval (2 lines) are within the 50-line grace delta.

Preserving prior approval by @janzak-dev on commit 247c58e.

@VLukiantsev
VLukiantsev added this pull request to the merge queue Nov 3, 2026
Merged via the queue into main with commit a4b84bc Nov 3, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority::2-high top of mind. should not wait.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0