Skip to content

Conversation

@perdasilva
Copy link
Contributor

@perdasilva perdasilva commented Nov 28, 2025

Description

Addresses enhancement PR reviewer comments by:

  • Updates inline configuration documentation
  • Adds missing // +unionMember annotation to Inline
  • Adds // +kubebuilder:validation:MinProperties=1 validation to Inline to ensure empty configurations {} cannot be specified
  • Adds additional admission unit test inc. to test the added validation annotation

Reviewer Checklist

  • API Go Documentation
  • Tests: Unit Tests (and E2E Tests, if appropriate)
  • Comprehensive Commit Messages
  • Links to related GitHub Issue(s)

Copilot AI review requested due to automatic review settings November 28, 2025 15:23
@perdasilva perdasilva requested a review from a team as a code owner November 28, 2025 15:23
@netlify
Copy link

netlify bot commented Nov 28, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 6b65cca
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/692ef2b84e13370008e88851
😎 Deploy Preview https://deploy-preview-2366--olmv1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@openshift-ci openshift-ci bot requested review from bentito and dtfranz November 28, 2025 15:23
@perdasilva perdasilva changed the title Update inline config docs and annotations 🌱 Update inline config docs and annotations Nov 28, 2025
Copilot finished reviewing on behalf of perdasilva November 28, 2025 15:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the inline configuration documentation and adds the +unionMember annotation to the ClusterExtensionConfig.Inline field as suggested by an API review. The changes make the documentation clearer, fix a grammatical error in the original text, and ensure proper union type annotation for the Kubernetes API.

Key Changes:

  • Rewrote inline configuration documentation for better clarity and grammar
  • Added // +unionMember annotation to the Inline field in ClusterExtensionConfig
  • Updated all generated CRD manifests and API documentation to reflect the source changes

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
api/v1/clusterextension_types.go Updated inline configuration documentation comments and added +unionMember annotation
manifests/experimental.yaml Generated CRD manifest updated with new documentation text
manifests/experimental-e2e.yaml Generated E2E CRD manifest updated with new documentation text
helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensions.yaml Helm CRD manifest updated with new documentation text
docs/api-reference/olmv1-api-reference.md API reference documentation updated to match source code comments

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.51%. Comparing base (34394ce) to head (6b65cca).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2366      +/-   ##
==========================================
+ Coverage   70.61%   74.51%   +3.90%     
==========================================
  Files          93       93              
  Lines        7333     7333              
==========================================
+ Hits         5178     5464     +286     
+ Misses       1720     1435     -285     
+ Partials      435      434       -1     
Flag Coverage Δ
e2e 44.47% <ø> (-0.07%) ⬇️
experimental-e2e 48.78% <ø> (+34.83%) ⬆️
unit 58.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@tmshort
Copy link
Contributor

tmshort commented Dec 1, 2025

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 1, 2025
Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
Copilot AI review requested due to automatic review settings December 2, 2025 14:07
@openshift-ci
Copy link

openshift-ci bot commented Dec 2, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tmshort

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot finished reviewing on behalf of perdasilva December 2, 2025 14:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// +kubebuilder:validation:Type=object
// +kubebuilder:validation:MinProperties=1
// +optional
// +unionMember
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding this did not produce any change on CRD, should it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great call out! I went poking about and here's what I found out (with the help of Gemini):

Annotation Effect on CRD Schema Notes
// +union None (Visible) Treated as documentation only.
// +unionMember None Fields remain standard optional pointers.
// +unionDiscriminator None (usually) Does not automatically generate an Enum or validation.

This means that the CEL expressions must be manually created to enforce

While controller-gen generates no visible effect, in client-gen they seem to be used.

If you are generating a full-blown Kubernetes Clientset (using k8s.io/code-generator rather than just controller-runtime), these annotations become functional.

Specifically, they affect the generation of ApplyConfigurations.

    When using Server-Side Apply (SSA) in Go code, the generated ApplyConfiguration structs need to know if a field is a union.

    If tagged correctly, the generated Go client code for "applying" the object will know to clear the other fields in the union when you set a new one.

It also suggests to keep them for other developers to make the intent clear to other developers (not a huge argument for me since it's pretty clear anyway, but ok...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants