Skip to content

✨ Fieldvalue user probes#2550

Open
dtfranz wants to merge 1 commit intooperator-framework:mainfrom
dtfranz:fieldvalue-user-probes
Open

✨ Fieldvalue user probes#2550
dtfranz wants to merge 1 commit intooperator-framework:mainfrom
dtfranz:fieldvalue-user-probes

Conversation

@dtfranz
Copy link
Contributor

@dtfranz dtfranz commented Mar 10, 2026

Description

WIP

Adds progressionProbes to ClusterExtensionRevision API

Needs:

  • Unit tests
  • Validation and or Sanitization for fieldPath and value since they are going into a CEL expression

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 10, 2026 13:13
@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 Mar 10, 2026
@openshift-ci
Copy link

openshift-ci bot commented Mar 10, 2026

[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 perdasilva 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

@netlify
Copy link

netlify bot commented Mar 10, 2026

Deploy Preview for olmv1 ready!

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

Adds support for user-defined spec.progressionProbes on ClusterExtensionRevision to gate phase progression based on custom assertions against rendered objects, with accompanying CRD/applyconfig updates and new e2e scenarios.

Changes:

  • Extend ClusterExtensionRevisionSpec with progressionProbes API types + deepcopy/applyconfig support.
  • Add CRD schema for progressionProbes to experimental manifests/Helm CRD.
  • Update the controller to build and attach user-defined progression probes to the boxcutter progress probe chain; add e2e scenarios for pass/fail behavior.

Reviewed changes

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

Show a summary per file
File Description
test/e2e/features/revision.feature Adds e2e scenarios covering progression probe pass/fail behavior (currently tagged @WIP).
manifests/experimental.yaml Updates experimental CRD schema to include spec.progressionProbes.
manifests/experimental-e2e.yaml Updates e2e experimental CRD schema to include spec.progressionProbes.
internal/operator-controller/controllers/clusterextensionrevision_controller.go Builds user probes from spec.progressionProbes and adds them to the progress probe chain.
helm/olmv1/base/operator-controller/crd/experimental/olm.operatorframework.io_clusterextensionrevisions.yaml Updates Helm CRD schema with spec.progressionProbes.
applyconfigurations/utils.go Registers apply-configuration kinds for the new embedded types.
applyconfigurations/api/v1/progressionprobe.go Generated apply-configuration for ProgressionProbe.
applyconfigurations/api/v1/probeselector.go Generated apply-configuration for ProbeSelector.
applyconfigurations/api/v1/probeassertion.go Generated apply-configuration for ProbeAssertion.
applyconfigurations/api/v1/fieldvalueprobe.go Generated apply-configuration for FieldValueProbe.
applyconfigurations/api/v1/clusterextensionrevisionspec.go Adds apply-configuration support for spec.progressionProbes.
api/v1/zz_generated.deepcopy.go Adds deepcopy support for the new API structs/fields.
api/v1/clusterextensionrevision_types.go Introduces the new API types and spec.progressionProbes.

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

@codecov
Copy link

codecov bot commented Mar 10, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 138 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.84%. Comparing base (6f23a79) to head (d1436fd).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
api/v1/zz_generated.deepcopy.go 25.39% 47 Missing ⚠️
applyconfigurations/api/v1/probeassertion.go 0.00% 14 Missing ⚠️
applyconfigurations/utils.go 0.00% 12 Missing ⚠️
applyconfigurations/api/v1/probeselector.go 0.00% 11 Missing ⚠️
applyconfigurations/api/v1/progressionprobe.go 0.00% 11 Missing ⚠️
...controllers/clusterextensionrevision_controller.go 78.04% 6 Missing and 3 partials ⚠️
applyconfigurations/api/v1/conditionprobe.go 0.00% 8 Missing ⚠️
applyconfigurations/api/v1/fieldsequalprobe.go 0.00% 8 Missing ⚠️
applyconfigurations/api/v1/fieldvalueprobe.go 0.00% 8 Missing ⚠️
...figurations/api/v1/clusterextensionrevisionspec.go 0.00% 6 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2550      +/-   ##
==========================================
- Coverage   68.60%   67.84%   -0.77%     
==========================================
  Files         131      137       +6     
  Lines        9330     9534     +204     
==========================================
+ Hits         6401     6468      +67     
- Misses       2438     2571     +133     
- Partials      491      495       +4     
Flag Coverage Δ
e2e 41.24% <0.00%> (-1.01%) ⬇️
experimental-e2e 51.10% <30.76%> (-0.48%) ⬇️
unit 52.92% <13.04%> (-0.89%) ⬇️

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 fieldvalue-user-probes branch from 3e0efb5 to c1ddbb3 Compare March 11, 2026 06:39
@dtfranz dtfranz marked this pull request as ready for review March 11, 2026 06:41
Copilot AI review requested due to automatic review settings March 11, 2026 06:41
@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 Mar 11, 2026
@openshift-ci openshift-ci bot requested review from joelanford and trgeiger March 11, 2026 06:41
Provides an API which allows custom probe definitions to determine readiness of the CER phases. Objects can be selected for in one of two ways: by GroupKind, or by Label (matchLabels and matchExpressions). They can then be tested via any of: Condition, FieldsEqual, and FieldValue. Condition checks that the object has a condition matching the type and status provided. FieldsEqual uses two provided field paths and checks for equality. FieldValue uses a provided field path and checks that the value is equal to the provided expected value.

Signed-off-by: Daniel Franz <dfranz@redhat.com>
@dtfranz dtfranz force-pushed the fieldvalue-user-probes branch from c1ddbb3 to d1436fd Compare March 11, 2026 06:45
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 18 out of 18 changed files in this pull request and generated 7 comments.


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

Comment on lines +1074 to +1079
expectedResult: probing.Result{
Status: probing.StatusFalse,
Messages: []string{
`missing key: "spec.foo"`,
},
},
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

The expected message for the missing-field case doesn’t match the actual probe output. FieldValueProbe returns missing key: "spec.foo", but this test asserts "spec.foo" missing, so the test will fail. Update the expected message (or align the probe’s message format) so they match.

Copilot uses AI. Check for mistakes.
Comment on lines +216 to +220
- selector:
type: GroupKind
groupKind:
group: core
kind: ConfigMap
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

For core ("" apiGroup) resources like ConfigMap, the GroupKind selector’s group should be an empty string (or omitted if allowed), not core. As written, this selector likely won’t match any core resources, so the probe won’t be exercised (and may cause the scenario to behave unexpectedly).

Copilot uses AI. Check for mistakes.
Comment on lines +226 to +230
- selector:
type: GroupKind
groupKind:
group: core
kind: Service
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

This GroupKind selector also uses group: core, which won’t match Kubernetes core resources (whose group is the empty string). Use group: "" here as well so the selector actually targets the intended objects.

Copilot uses AI. Check for mistakes.
Comment on lines +226 to +235
- selector:
type: GroupKind
groupKind:
group: core
kind: Service
assertions:
- type: FieldsEqual
fieldsEqual:
fieldA: "metadata.labels.foo"
fieldB: "metadata.labels.bar"
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

This probe is configured to select Kind Service, but the scenario doesn’t create any Service objects (it creates a ServiceAccount in phase2). As a result, the FieldsEqual probe won’t be applied to anything, so the scenario won’t validate the intended behavior. Either change the selector kind to ServiceAccount or add a matching Service object to the phases.

Copilot uses AI. Check for mistakes.
- assertions
- selector
type: object
maxItems: 50
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

The CRD schema here allows spec.progressionProbes up to 50 items, but the Go type annotation sets +kubebuilder:validation:MaxItems=20 for the same field (api/v1/clusterextensionrevision_types.go). This mismatch suggests the CRD YAML may be out of sync with the API types/controller-gen output; align the limits (and regenerate the CRDs) to avoid drift.

Suggested change
maxItems: 50
maxItems: 20

Copilot uses AI. Check for mistakes.
- assertions
- selector
type: object
maxItems: 50
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Same schema drift issue as manifests/experimental.yaml: spec.progressionProbes is set to maxItems: 50 here, but the Go API type uses +kubebuilder:validation:MaxItems=20. Please align the limits and regenerate the CRD YAML so it matches the source types.

Suggested change
maxItems: 50
maxItems: 20

Copilot uses AI. Check for mistakes.
- assertions
- selector
type: object
maxItems: 50
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

Same schema drift issue: this CRD YAML sets spec.progressionProbes to maxItems: 50, while the Go type annotation sets MaxItems=20. Please make the Helm CRD, manifests, and Go types consistent (ideally by regenerating the CRD YAML from the API types).

Suggested change
maxItems: 50
maxItems: 20

Copilot uses AI. Check for mistakes.
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.

2 participants