🌱 (test): Selector field exclusion in registry+v1 bundle configuration#2525
Conversation
PR operator-framework#2454 implemented the selector field exclusion in the schema generator and generated schema, but there was no explicit validation test demonstrating that users would receive a clear error message if they tried to use it. This PR introduces a test that: 1. Documents the behavior explicitly - Makes it clear through tests that selector is not just omitted, but actively rejected 2. Prevents regression - Ensures future schema changes don't accidentally allow the selector field 3. Validates user experience - Confirms users get a helpful error message rather than silent failure Test Output ``` rawConfig: []byte(`{ "deploymentConfig": { "selector": { "matchLabels": { "app": "test" } } } }`), expectedErrMessage: `unknown field "selector"` ``` Related - PR operator-framework#2454: Initial implementation of registry+v1 bundle schema generation - Schema description already notes: "Note: The 'selector' field from v0's SubscriptionConfig is not included as it was never used."
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
This PR adds a test to ensure that the selector field (from OLMv0's SubscriptionConfig) is properly rejected when used in registry+v1 bundle configuration. The test validates that users receive a clear error message rather than experiencing silent failure or undefined behavior.
Changes:
- Adds a test case validating that
selectorfield indeploymentConfigis rejected with a clear error message - Complements PR #2454's implementation by explicitly documenting and testing the exclusion behavior
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/approve |
|
/lgtm |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
b49a5b8
into
operator-framework:main
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2525 +/- ##
==========================================
- Coverage 72.15% 72.09% -0.06%
==========================================
Files 103 103
Lines 8686 8686
==========================================
- Hits 6267 6262 -5
- Misses 1937 1940 +3
- Partials 482 484 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
PR #2454 implemented the selector field exclusion in the schema generator and generated schema, but there was no explicit validation test demonstrating that users would receive a clear error message if they tried to use it. This PR introduces a test that:
Test Output
Related
Reviewer Checklist