Skip to content

OPRUN-4228: Add Boxcutter OTE tests - #560

Closed
anik120 wants to merge 2 commits into
openshift:mainfrom
anik120:add-boxcutter-ote-tests
Closed

OPRUN-4228: Add Boxcutter OTE tests#560
anik120 wants to merge 2 commits into
openshift:mainfrom
anik120:add-boxcutter-ote-tests

Conversation

@anik120

@anik120anik120 commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

@openshift-ci-robotopenshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Nov 18, 2025
@openshift-ci-robot

openshift-ci-robot commented Nov 18, 2025

Copy link
Copy Markdown

@anik120: This pull request references OPRUN-4228 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.21.0" version, but no target version was set.

Details

In response to this:

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: anik120
Once this PR has been reviewed and has the lgtm label, please assign grokspawn 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

@anik120

Copy link
Copy Markdown
ContributorAuthor

/hold

for openshift/cluster-olm-operator#151 to merge first

@openshift-ciopenshift-ciBot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 18, 2025
@openshift-ci-robot

openshift-ci-robot commented Nov 18, 2025

Copy link
Copy Markdown

@anik120: This pull request references OPRUN-4228 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.21.0" version, but no target version was set.

Details

In response to this:

For EP: openshift/enhancements#1890

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 openshift-eng/jira-lifecycle-plugin repository.

mkdir -p $(@D)
$(GO_BINDATA) -pkg boxcuttercatalog -o $@ -prefix "testdata/boxcutter/catalog" testdata/boxcutter/catalog/...
go fmt ./$(@D)/...

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.

I can see that we have a lot of it already :-(
Not a great solution

@tmshort I think we will need to look for a way to improve it at some stage
it is not maintainable.

Comment threadopenshift/tests-extension/go.mod
@anik120
anik120force-pushed the add-boxcutter-ote-tests branch 3 times, most recently from 72637ae to 7d4cb15CompareNovember 18, 2025 17:23
Expect(foundOwnerRef).To(BeTrue(), "ClusterExtension should be in owner references")

By("verifying the revision has proper labels")
Expect(revision.Labels).To(HaveKeyWithValue("olm.operatorframework.io/owner", name),

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.

That will be owner-name and can we have a const on top of the file.
I think we will use more than once

err = k8sClient.Get(ctx, client.ObjectKey{Name: revision2Name}, &revision2)
Expect(err).ToNot(HaveOccurred(), "revision-2 should exist")

By("verifying revision-2 is Active")

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.

Shoild we not check that the revision-1 is Archived ?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@camilamacedo86

https://github.com/operator-framework/operator-controller/blob/main/internal/operator-controller/applier/boxcutter.go#L311-L407

From what I can see in the code that's in main, the apply() function creates a new revision when upgrading, but doesn't modify the lifecycle state of previous revisions. Unit tests also show that revisions must be manually set to Archived state. And then GC logic (setPreviousRevisions) only deletes revisions that are already in Archived state.

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.

Can you please check with the main changes? See the demo: #560 (comment)

Comment threadopenshift/tests-extension/test/olmv1-boxcutter.go Outdated
Comment threadopenshift/tests-extension/test/olmv1-boxcutter.go Outdated
Comment threadopenshift/tests-extension/test/olmv1-boxcutter.go Outdated
Comment threadopenshift/tests-extension/test/olmv1-boxcutter.go Outdated
Comment threadopenshift/tests-extension/test/olmv1-boxcutter.go Outdated
Comment threadopenshift/tests-extension/test/olmv1-boxcutter.go Outdated
Comment on lines +289 to +293
// NOTE: GC only deletes ARCHIVED revisions beyond the limit of 5.
// Active revisions are NEVER deleted regardless of count.
// We archive 6 revisions here, so when we later trigger a new revision,
// the oldest archived revision (revision-1) should be deleted,
// keeping 5 archived revisions (2-6) + active revisions (7-9).

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.

All of this workaround should not be required after we get sync with downstream; operator-framework/operator-controller#2315

(see the demo in the PR)

err := k8sClient.Get(ctx, client.ObjectKey{Name: revisionName}, &revision)
g.Expect(err).ToNot(HaveOccurred())

revision.Spec.LifecycleState = olmv1.ClusterExtensionRevisionLifecycleStateArchived

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.

We shouldn’t archive it manually — that should be handled by OLM, right?

So we need to test the expected behavior, and if it’s failing, then we’ll know it needs to be fixed. I believe operator-framework/operator-controller#2315 will address it.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Oh so looks like this isn't in downstream yet. However, based on a quick look, looks like the archiving behavior is unchanged - ie there's still no automatic archiving behavior - @perdasilva is this intended?

Ack that once this PR downstreams I need to change incorporate the switch from spec.previous field to label-based discovery using olm.operatorframework.io/owner label

@camilamacedo86camilamacedo86Nov 20, 2025

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.

ie there's still no automatic archiving behavior

Can you please test it out?
See the demo: https://asciinema.org/a/qupccwlIdeprj8VvjF7OOko9t
It is fixed with: operator-framework/operator-controller#2315

ext.Annotations["test.boxcutter/trigger-gc"] = "true"
err = k8sClient.Update(ctx, &ext)
g.Expect(err).ToNot(HaveOccurred())
}).WithTimeout(helpers.DefaultTimeout).WithPolling(helpers.DefaultPolling).Should(Succeed())

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.

I do not think that we should test it.
What IHMO we need to check is when we uninstall a ClusterExtension all revisions are not left orphoned and are either removed.

Signed-off-by: Anik Bhattacharjee <anbhatta@redhat.com>
Signed-off-by: Anik Bhattacharjee <anbhatta@redhat.com>
@anik120
anik120force-pushed the add-boxcutter-ote-tests branch from 7d4cb15 to 9dac49cCompareNovember 20, 2025 14:56
@openshift-ci

Copy link
Copy Markdown
Contributor

@anik120: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test nameCommitDetailsRequiredRerun command
ci/prow/e2e-aws-olmv1-ext9dac49clinktrue/test e2e-aws-olmv1-ext
ci/prow/e2e-aws-techpreview-olmv1-ext9dac49clinktrue/test e2e-aws-techpreview-olmv1-ext
ci/prow/openshift-e2e-aws9dac49clinktrue/test openshift-e2e-aws
ci/prow/tests-extension9dac49clinktrue/test tests-extension

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@openshift-bot

Copy link
Copy Markdown

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ciopenshift-ciBot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 20, 2026
@openshift-merge-robotopenshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 20, 2026
@openshift-merge-robot

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

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

Copy link
Copy Markdown

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ciopenshift-ciBot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 22, 2026
@coderabbitai

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • do-not-merge/work-in-progress

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7586f2b9-f6c2-492a-b8f7-cc41ad2428b8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@camilamacedo86

Copy link
Copy Markdown
Contributor

Close this one in favour of: #672

/close

@openshift-ciopenshift-ciBot closed this Mar 26, 2026
@openshift-ci

Copy link
Copy Markdown
Contributor

@camilamacedo86: Closed this PR.

Details

In response to this:

Close this one in favour of: #672

/close

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.

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

Labels

do-not-merge/holdIndicates that a PR should not merge because someone has issued a /hold command.jira/valid-referenceIndicates that this PR references a valid Jira ticket of any type.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.needs-rebaseIndicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@anik120@openshift-ci-robot@openshift-bot@openshift-merge-robot@camilamacedo86