Skip to content

api: add cel validation of GrpcStatus#8803

Open
kkk777-7 wants to merge 2 commits intoenvoyproxy:mainfrom
kkk777-7:improve-grpc-status-type
Open

api: add cel validation of GrpcStatus#8803
kkk777-7 wants to merge 2 commits intoenvoyproxy:mainfrom
kkk777-7:improve-grpc-status-type

Conversation

@kkk777-7
Copy link
Copy Markdown
Member

@kkk777-7 kkk777-7 commented Apr 21, 2026

What this PR does / why we need it:
Improve: add validation of valid values.
Related: #8800

Which issue(s) this PR fixes:

Fixes #

Release Notes: No

@kkk777-7 kkk777-7 requested a review from a team as a code owner April 21, 2026 07:06
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 21, 2026

Deploy Preview for cerulean-figolla-1f9435 canceled.

Name Link
🔨 Latest commit 7c0538a
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69e72e14939da5000803d281

// +optional
GrpcStatus *int32 `json:"grpcStatus,omitempty"`
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=16
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f661cda5a4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread api/v1alpha1/fault_injection.go Outdated
GrpcStatus *int32 `json:"grpcStatus,omitempty"`
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=16
GrpcStatus *uint32 `json:"grpcStatus,omitempty"`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep grpcStatus signed to avoid upgrade decode breakage

Changing grpcStatus from *int32 to *uint32 is a backward-incompatible API shape change for stored CRs: clusters could already have BackendTrafficPolicy objects with negative grpcStatus values (previously allowed before the new bounds), and those objects will fail to decode into the typed client/controller after upgrade. This can surface as informer/list/watch decode errors and block reconciliation for affected resources. You can enforce the new valid range without this break by keeping the Go type as int32 and relying on Minimum=0/Maximum=16 validation.

Useful? React with 👍 / 👎.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.40%. Comparing base (a7545ce) to head (7c0538a).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8803      +/-   ##
==========================================
- Coverage   74.40%   74.40%   -0.01%     
==========================================
  Files         245      245              
  Lines       38973    38977       +4     
==========================================
+ Hits        28998    28999       +1     
- Misses       7971     7974       +3     
  Partials     2004     2004              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
@kkk777-7 kkk777-7 force-pushed the improve-grpc-status-type branch from f661cda to 3b79171 Compare April 21, 2026 07:49
Signed-off-by: kkk777-7 <kota.kimura0725@gmail.com>
@kkk777-7 kkk777-7 changed the title update: grpcstatus type api: add cel validation of GrpcStatus Apr 21, 2026
@kkk777-7
Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

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