Skip to content

Comments

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

Merged
openshift-merge-bot[bot] merged 1 commit intooperator-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 intooperator-framework:mainfrom
anik120:config-schema-ignore-selector

Conversation

@anik120
Copy link
Member

@anik120 anik120 commented Feb 24, 2026

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

netlify bot commented Feb 24, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 5cb57ac
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/699e01ce4d14560008c3d3f6
😎 Deploy Preview https://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.

Copy link
Contributor

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 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
Contributor

tmshort commented Feb 24, 2026

/approve

@tmshort
Copy link
Contributor

tmshort commented Feb 24, 2026

/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Feb 24, 2026

[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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 24, 2026
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 24, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit b49a5b8 into operator-framework:main Feb 24, 2026
30 checks passed
@codecov
Copy link

codecov bot commented Feb 24, 2026

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     
Flag Coverage Δ
e2e 45.36% <ø> (+0.02%) ⬆️
experimental-e2e 53.82% <ø> (-0.10%) ⬇️
unit 57.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 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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants