Skip to content

🌱 new tag symmetry and required validations - #2358

Merged
openshift-merge-bot[bot] merged 2 commits into
operator-framework:mainfrom
grokspawn:crd-gen-X
Dec 1, 2025
Merged

🌱 new tag symmetry and required validations#2358
openshift-merge-bot[bot] merged 2 commits into
operator-framework:mainfrom
grokspawn:crd-gen-X

Conversation

@grokspawn

Copy link
Copy Markdown
Contributor

Description

Adds new standard:description tag support to allow inclusion of standard-manifest-only field descriptions.
Adds new optional/required validation tag support to allow field tags to impact the required list of their parent field.
Adds unit tests for all new capabilities, since there are no existing uses of the new tags (yet!).

Reviewer Checklist

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

Signed-off-by: grokspawn <jordan@nimblewidget.com>
@grokspawn
grokspawn requested a review from a team as a code ownerNovember 21, 2025 18:47
CopilotAI review requested due to automatic review settings November 21, 2025 18:47
@netlify

netlifyBot commented Nov 21, 2025

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commite0806cf
🔍 Latest deploy loghttps://app.netlify.com/projects/olmv1/deploys/692880594bd9050008005d3d
😎 Deploy Previewhttps://deploy-preview-2358--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.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 adds symmetric support for standard-specific field descriptions (complementing the existing experimental-specific descriptions) and introduces optional/required validation tags that allow field annotations to dynamically control the required fields list in generated CRDs. The changes maintain backward compatibility while extending the CRD generation capabilities.

Key Changes

  • Added support for <opcon:standard:description> tags (symmetric to existing experimental tags)
  • Implemented <opcon:*:validation:Optional> and <opcon:*:validation:Required> tags to control field requirement status
  • Enhanced opconTweaks and opconTweaksMap functions to return and process requirement status, updating the required fields list accordingly
  • Added comprehensive unit tests covering all new tag functionality including edge cases

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

FileDescription
hack/tools/crd-generator/main.goExtended opconTweaks and opconTweaksMap to handle required status; refactored formatDescription to support both standard and experimental description tags symmetrically; added Optional/Required validation tag processing
hack/tools/crd-generator/main_test.goAdded comprehensive test suites for formatDescription, opconTweaks optional/required handling, and opconTweaksMap required list manipulation
hack/tools/crd-generator/README.mdDocumented new Optional and Required validation tags, and added Standard Description section to mirror Experimental Description documentation

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

Comment threadhack/tools/crd-generator/main.go Outdated
Comment threadhack/tools/crd-generator/main.go
Comment threadhack/tools/crd-generator/main.go Outdated
@codecov

codecovBot commented Nov 21, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.63%. Comparing base (1355ff7) to head (2f93a69).
⚠️ Report is 1 commits behind head on main.

Files with missing linesPatch %Lines
hack/tools/crd-generator/main.go92.00%2 Missing and 2 partials ⚠️
Additional details and impacted files
@@ Coverage Diff @@## main #2358 +/- ##
==========================================
- Coverage 74.23% 70.63% -3.61% 
==========================================
Files 91 91 Lines 7239 7266 +27 ==========================================
- Hits 5374 5132 -242 - Misses 1433 1699 +266 - Partials 432 435 +3 
FlagCoverage Δ
e2e44.32% <ø> (-0.04%)⬇️
experimental-e2e14.08% <ø> (-34.40%)⬇️
unit58.67% <92.00%> (+0.12%)⬆️

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.

Comment threadhack/tools/crd-generator/main.go Outdated
@pedjak

Copy link
Copy Markdown
Contributor

Adds unit tests for all new capabilities, since there are no existing uses of the new tags (yet!).

What is the motivation for adding this logic, if there are not need for it? Should we postpone it and add within a PR where such logic is needed?

@joelanford

Copy link
Copy Markdown
Member

@pedjak motivation is making the clusterextension.spec.serviceAccount field optional in the experimental channel. To me, it seems like a reasonable thing to split off from that.

Comment threadhack/tools/crd-generator/main.go
@joelanford

Copy link
Copy Markdown
Member

/approve

@openshift-ciopenshift-ciBot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 24, 2025
@pedjak

Copy link
Copy Markdown
Contributor

@pedjak motivation is making the clusterextension.spec.serviceAccount field optional in the experimental channel. To me, it seems like a reasonable thing to split off from that.

Thanks @joelanford for the context. I see now that is extracted from #2355

Comment threadhack/tools/crd-generator/main.go Outdated
Comment threadhack/tools/crd-generator/main.go Outdated
Signed-off-by: grokspawn <jordan@nimblewidget.com>

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 3 out of 3 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.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@rashmigottipatirashmigottipati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Nov 27, 2025
@grokspawn

Copy link
Copy Markdown
ContributorAuthor

/override

@grokspawn

Copy link
Copy Markdown
ContributorAuthor

/override experimental-e2e

@openshift-ci

Copy link
Copy Markdown

@grokspawn: Overrode contexts on behalf of grokspawn: experimental-e2e

Details

In response to this:

/override experimental-e2e

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@pedjakpedjak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@rashmigottipatirashmigottipati left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: joelanford, pedjak, rashmigottipati

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

The pull request process is described here

Details 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

@grokspawn

Copy link
Copy Markdown
ContributorAuthor

/override experimental-e2e

@openshift-ci

Copy link
Copy Markdown

@grokspawn: Overrode contexts on behalf of grokspawn: experimental-e2e

Details

In response to this:

/override experimental-e2e

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot
openshift-merge-botBot merged commit 91b03c7 into operator-framework:mainDec 1, 2025
31 of 32 checks passed
@grokspawn
grokspawn deleted the crd-gen-X branch December 1, 2025 13:04
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by an approver from all required OWNERS files.lgtmIndicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@grokspawn@pedjak@joelanford@rashmigottipati@tmshort