Skip to content

🌱 (test): Selector field exclusion in registry+v1 bundle configuration - #2525

Merged
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
anik120:config-schema-ignore-selector
Feb 24, 2026
Merged

🌱 (test): Selector field exclusion in registry+v1 bundle configuration#2525
openshift-merge-bot[bot] merged 1 commit into
operator-framework:mainfrom
anik120:config-schema-ignore-selector

Conversation

@anik120

Copy link
Copy Markdown
Member

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:

  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

Reviewer Checklist

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

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."
CopilotAI review requested due to automatic review settings February 24, 2026 19:53
@netlify

netlifyBot commented Feb 24, 2026

Copy link
Copy Markdown

Deploy Preview for olmv1 ready!

NameLink
🔨 Latest commit5cb57ac
🔍 Latest deploy loghttps://app.netlify.com/projects/olmv1/deploys/699e01ce4d14560008c3d3f6
😎 Deploy Previewhttps://deploy-preview-2525--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 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 selector field in deploymentConfig is 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.

@tmshort

Copy link
Copy Markdown
Contributor

/approve

@tmshort

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci

Copy link
Copy Markdown

[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

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

@openshift-ciopenshift-ciBot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2026
@openshift-ciopenshift-ciBot added the lgtm Indicates that a PR is ready to be merged. label Feb 24, 2026
@openshift-merge-bot
openshift-merge-botBot merged commit b49a5b8 into operator-framework:mainFeb 24, 2026
30 checks passed
@codecov

codecovBot commented Feb 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.09%. Comparing base (4121321) to head (5cb57ac).
⚠️ Report is 2 commits behind head on main.

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 
FlagCoverage Δ
e2e45.36% <ø> (+0.02%)⬆️
experimental-e2e53.82% <ø> (-0.10%)⬇️
unit57.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.

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.

3 participants

@anik120@tmshort