Skip to content

✨ Default Probes Refactor#2586

Merged
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
dtfranz:default-probes-cer
Mar 26, 2026
Merged

✨ Default Probes Refactor#2586
openshift-merge-bot[bot] merged 1 commit intooperator-framework:mainfrom
dtfranz:default-probes-cer

Conversation

@dtfranz
Copy link
Contributor

@dtfranz dtfranz commented Mar 23, 2026

Migrates the default progression probes out of the CER controller into the boxcutter applier in order to use the ProgressionProbes API to transparently stamp out the checks. All probes will now check that status.observedGeneration==metadata.generation before executing probes, or execute them normally if objects do not contain those fields.

Description

Reviewer Checklist

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

Copilot AI review requested due to automatic review settings March 23, 2026 14:52
@openshift-ci openshift-ci bot requested review from OchiengEd and perdasilva March 23, 2026 14:52
@netlify
Copy link

netlify bot commented Mar 23, 2026

Deploy Preview for olmv1 ready!

Name Link
🔨 Latest commit 6562402
🔍 Latest deploy log https://app.netlify.com/projects/olmv1/deploys/69c54cd908cad40008194833
😎 Deploy Preview https://deploy-preview-2586--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

Refactors how default progression probes are applied by moving the built-in/default probe set out of the ClusterExtensionRevision controller and into the applier-generated ClusterExtensionRevision spec, and extends the ProgressionProbes API with an observedGeneration gating option.

Changes:

  • Add observedGeneration to ProgressionProbe (API/types + applyconfigurations + CRD schemas) and wire it into probe building.
  • Generate/stamp default progression probes in the applier when constructing ClusterExtensionRevision objects (and update unit expectations).
  • Update E2E feature specs to explicitly include progression probes when applying ClusterExtensionRevision directly.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/e2e/features/revision.feature Adds explicit progressionProbes to CER YAML used in E2E scenarios.
manifests/experimental.yaml Adds CRD schema for progressionProbes[].observedGeneration.
manifests/experimental-e2e.yaml Same CRD schema update for E2E manifests.
helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml Helm-packaged CRD schema updated with observedGeneration.
api/v1/clusterextensionrevision_types.go Adds ObservedGeneration to ProgressionProbe and renames Go constants for probe type enums.
api/v1/zz_generated.deepcopy.go Adds deepcopy support for ObservedGeneration *bool.
applyconfigurations/api/v1/progressionprobe.go Adds ObservedGeneration field + WithObservedGeneration() builder.
internal/operator-controller/controllers/clusterextensionrevision_controller.go Stops injecting controller-side default probes; builds observedGeneration-wrapped probes from CER spec.
internal/operator-controller/applier/boxcutter.go Stamps default probes onto generated CER specs via defaultProgressionProbes().
internal/operator-controller/applier/boxcutter_test.go Updates expected generated CER spec to include default probes.

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

@dtfranz dtfranz force-pushed the default-probes-cer branch from 94d5d71 to 8eb532b Compare March 23, 2026 14:58
Copilot AI review requested due to automatic review settings March 23, 2026 15:01
@dtfranz dtfranz force-pushed the default-probes-cer branch from 8eb532b to 4457677 Compare March 23, 2026 15:01
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

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


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

@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

❌ Patch coverage is 90.47619% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.44%. Comparing base (a307a6d) to head (6562402).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
internal/operator-controller/applier/boxcutter.go 86.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2586      +/-   ##
==========================================
+ Coverage   65.84%   68.44%   +2.59%     
==========================================
  Files         137      137              
  Lines        9560     9593      +33     
==========================================
+ Hits         6295     6566     +271     
+ Misses       2795     2525     -270     
- Partials      470      502      +32     
Flag Coverage Δ
e2e 38.96% <0.00%> (+27.78%) ⬆️
experimental-e2e 51.69% <85.71%> (+0.62%) ⬆️
unit 52.92% <66.66%> (+0.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.

@dtfranz dtfranz force-pushed the default-probes-cer branch from 4457677 to 55b3524 Compare March 24, 2026 08:43
Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Great 🥇
/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 24, 2026
// +optional
// +kubebuilder:default:=false
// <opcon:experimental>
ObservedGeneration *bool `json:"observedGeneration,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

I would not name it the same as .status.observedGeneration it is confusing. Also, not sure if we need pointer here, probably not.

Is there a case when this field needs to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I don't really think so. If either field doesn't exist, the probe will just be executed directly. I'm personally fine with removing it and always wrapping the probes within.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the API field 👍 Let me know what you think!

Copilot AI review requested due to automatic review settings March 26, 2026 01:11
@dtfranz dtfranz force-pushed the default-probes-cer branch from 55b3524 to 0af007d Compare March 26, 2026 01:11
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

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


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

@dtfranz dtfranz force-pushed the default-probes-cer branch from 0af007d to 44ed914 Compare March 26, 2026 07:45
Copilot AI review requested due to automatic review settings March 26, 2026 07:52
@dtfranz dtfranz force-pushed the default-probes-cer branch from 44ed914 to 1756aaf Compare March 26, 2026 07:52
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

Copilot reviewed 5 out of 5 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.

Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

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

The description still says "adds flag to the API to allow checking status.observedGeneration==metadata.generation" but this API field was removed based on review feedback. Should be updated before merge.

// Deprecated: use ProbeTypeConditionEqual instead.
ProbeTypeFieldCondition = ProbeTypeConditionEqual
// Deprecated: use ProbeTypeFieldsEqual instead.
ProbeTypeFieldEqual = ProbeTypeFieldsEqual
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this needed, could not we replace things in code. Given that this API is still TP, I do not think we need to introduce any deprecation.

Copy link
Contributor Author

@dtfranz dtfranz Mar 26, 2026

Choose a reason for hiding this comment

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

This was recommended by copilot, +1ed by Camila. I'd also prefer not to have it, but then we'd have to deal with the api-diff check failing.
Removed

}),
),
)).
WithProgressionProbes(
Copy link
Contributor

Choose a reason for hiding this comment

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

The test duplicates the entire default probe set inline (~100 lines) rather than comparing against defaultProgressionProbes() directly. Any future change to defaults requires updating both the function and the test expectation in lockstep. Consider comparing against the function output or extracting the expected value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pulled this out 👍

@dtfranz dtfranz force-pushed the default-probes-cer branch from 1756aaf to 464075b Compare March 26, 2026 14:57
Migrates the default progression probes out of the CER controller into the boxcutter applier in order to use the ProgressionProbes API to transparently stamp out the checks. All probes will now check that status.observedGeneration==metadata.generation before executing probes, or execute them normally if objects do not contain those fields.

Signed-off-by: Daniel Franz <dfranz@redhat.com>
@dtfranz dtfranz force-pushed the default-probes-cer branch from 464075b to 6562402 Compare March 26, 2026 15:12
Copilot AI review requested due to automatic review settings March 26, 2026 15:12
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

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


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

Copy link
Contributor

@pedjak pedjak left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 26, 2026
@openshift-ci
Copy link

openshift-ci bot commented Mar 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, pedjak

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:
  • OWNERS [camilamacedo86,pedjak]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pedjak
Copy link
Contributor

pedjak commented Mar 26, 2026

/override go-apidiff

@openshift-ci
Copy link

openshift-ci bot commented Mar 26, 2026

@pedjak: Overrode contexts on behalf of pedjak: go-apidiff

Details

In response to this:

/override go-apidiff

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.

@camilamacedo86
Copy link
Contributor

/override go-apidiff
/override go-apidiff/go-apidiff

@openshift-ci
Copy link

openshift-ci bot commented Mar 26, 2026

@camilamacedo86: /override requires failed status contexts, check run or a prowjob name to operate on.
The following unknown contexts/checkruns were given:

  • go-apidiff/go-apidiff

Only the following failed contexts/checkruns were expected:

  • Verify PR title
  • crd-diff
  • e2e
  • experimental-e2e
  • extension-developer-e2e
  • go-apidiff
  • go-verdiff
  • goreleaser
  • lint
  • netlify/olmv1/deploy-preview
  • st2ex-e2e
  • tide
  • unit-test-basic
  • upgrade-st2st-e2e
  • verify

If you are trying to override a checkrun that has a space in it, you must put a double quote on the context.

Details

In response to this:

/override go-apidiff
/override go-apidiff/go-apidiff

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.

@camilamacedo86
Copy link
Contributor

/override go-apidiff

@openshift-ci
Copy link

openshift-ci bot commented Mar 26, 2026

@camilamacedo86: Overrode contexts on behalf of camilamacedo86: go-apidiff

Details

In response to this:

/override go-apidiff

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-merge-bot openshift-merge-bot bot merged commit 789df82 into operator-framework:main Mar 26, 2026
32 of 34 checks passed
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. go-apidiff-override lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants