Skip to content

🌱 (fix) ClusterExtensionRevision had inconsistent owner labeling and confusing code#2344

Closed
camilamacedo86 wants to merge 1 commit into
operator-framework:mainfrom
camilamacedo86:fix-label-annotations
Closed

🌱 (fix) ClusterExtensionRevision had inconsistent owner labeling and confusing code#2344
camilamacedo86 wants to merge 1 commit into
operator-framework:mainfrom
camilamacedo86:fix-label-annotations

Conversation

@camilamacedo86
Copy link
Copy Markdown
Contributor

@camilamacedo86 camilamacedo86 commented Nov 18, 2025

Problem

ClusterExtensionRevision had inconsistent owner labeling and confusing code:

  1. Inconsistent Labels: Managed objects use owner-kind + owner-name, but ClusterExtensionRevision used only owner
  2. Confusing Code: Variable named storeLbls actually contained annotations
  3. Unclear API: Hard to understand what parameters were for

Solution

Fixed owner label consistency and improved code clarity while keeping bundle metadata in annotations (no breaking changes).

Changes

Owner Label Unification

  • All objects now use owner-kind + owner-name consistently

Code Clarity

  • Renamed storeLbls → separate revisionLabels + revisionAnnotations
  • Clear function signatures showing labels vs annotations

Bundle Metadata Location

  • Kept in annotations (informational, no query use case, no length limits)

Why This Matters

  • Consistency: Same labeling pattern across all OLM resources
  • Maintainability: Clear, self-documenting code
  • Safety: No breaking changes, no length restrictions
  • Simplicity: Easier to review and merge

@camilamacedo86 camilamacedo86 requested a review from a team as a code owner November 18, 2025 18:42
Copilot AI review requested due to automatic review settings November 18, 2025 18:48
@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 18, 2025

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 17e40e1
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/691d8d1e44d6ba000834894e
😎 Deploy Preview https://deploy-preview-2344--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
Copy Markdown
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@camilamacedo86 camilamacedo86 changed the title 🐛 fix: Use labels for bundle metadata and unify owner labels WIP 🐛 fix: Use labels for bundle metadata and unify owner labels Nov 18, 2025
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 18, 2025
@camilamacedo86 camilamacedo86 changed the title WIP 🐛 fix: Use labels for bundle metadata and unify owner labels 🐛 fix: Use labels for bundle metadata and unify owner labels Nov 18, 2025
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 18, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.30%. Comparing base (6ef62de) to head (17e40e1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2344      +/-   ##
==========================================
+ Coverage   74.19%   74.30%   +0.10%     
==========================================
  Files          91       91              
  Lines        7228     7239      +11     
==========================================
+ Hits         5363     5379      +16     
+ Misses       1433     1429       -4     
+ Partials      432      431       -1     
Flag Coverage Δ
e2e 44.29% <15.38%> (-0.11%) ⬇️
experimental-e2e 48.55% <84.61%> (+0.16%) ⬆️
unit 58.54% <92.30%> (+0.06%) ⬆️

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.

@camilamacedo86 camilamacedo86 changed the title 🐛 fix: Use labels for bundle metadata and unify owner labels 🐛 Fix: Use labels for queryable bundle metadata and unify owner labels Nov 18, 2025
Comment thread test/upgrade-e2e/post_upgrade_test.go Outdated
@joelanford
Copy link
Copy Markdown
Member

Is there a use case for querying by any of the values that are currently in annotations? As far as I know, those annotations are there to serve as hints to the resolver (?), not to be queried.

If there aren't any specific query use cases yet, maybe we should hold off on changing this right now.

Annotations have fewer restrictions on their value, so I think we should only put values in labels when we know we need to query by them?

Maybe @pedjak would have a better rubric than I do on the label vs annotation debate in this case.

Copilot AI review requested due to automatic review settings November 19, 2025 08:31
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Nov 19, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign thetechnick for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@camilamacedo86 camilamacedo86 changed the title 🐛 Fix: Use labels for queryable bundle metadata and unify owner labels 🌱 (fix) ClusterExtensionRevision had inconsistent owner labeling and confusing code Nov 19, 2025

This comment was marked as outdated.

@operator-framework operator-framework deleted a comment from Copilot AI Nov 19, 2025
@operator-framework operator-framework deleted a comment from Copilot AI Nov 19, 2025
@operator-framework operator-framework deleted a comment from Copilot AI Nov 19, 2025
@operator-framework operator-framework deleted a comment from Copilot AI Nov 19, 2025
@operator-framework operator-framework deleted a comment from Copilot AI Nov 19, 2025
Copilot AI review requested due to automatic review settings November 19, 2025 08:58
Copy link
Copy Markdown
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

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

Comments suppressed due to low confidence (1)

internal/operator-controller/applier/boxcutter_test.go:410

  • [nitpick] Inconsistent field ordering in ObjectMeta initialization. Here Labels comes before Annotations, but in the test case at line 798-804, Annotations comes before Labels. Consider using consistent ordering throughout the file for better maintainability.
							Annotations: revisionAnnotations,
						},
						Spec: ocv1.ClusterExtensionRevisionSpec{
							Phases: []ocv1.ClusterExtensionRevisionPhase{
								{

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

Copilot AI review requested due to automatic review settings November 19, 2025 09:22
Rename ClusterExtensionRevision owner label from `owner` to `owner-name`
for consistency. Also rename misleading `storeLbls` variable to
`revisionAnnotations` to clarify it contains annotations, not labels.

This removes the duplicate ClusterExtensionRevisionOwnerLabel constant
and uses labels.OwnerNameKey directly throughout the codebase.
Copy link
Copy Markdown
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

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.

@camilamacedo86
Copy link
Copy Markdown
Contributor Author

Hi @joelanford

Thank you for your input.

Is there a use case for querying by any of the values that are currently in annotations? As far as I know, those annotations are there to serve as hints to the resolver (?), not to be queried.
If there aren't any specific query use cases yet, maybe we should hold off on changing this right now.
Annotations have fewer restrictions on their value, so I think we should only put values in labels when we know we need to query by them?
Maybe @pedjak would have a better rubric than I do on the label vs annotation debate in this case.

This PR is doing more than just moving the annotations to labels. I reverted the changes and kept the other fix. BUTI will open a new PR only for that so the smaller change doesn’t get blocked by this discussion.**
I won’t push strongly for this if the team disagrees.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants