CRD support for Release Qualifiers#771
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bradmwilliams The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (18)
💤 Files with no reviewable changes (11)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (5)
📝 WalkthroughWalkthroughAdds release-qualifier modeling: CRD schema and ReleasePayload API extensions, qualifier summary/status types, notification schema updates (Jira/Slack), ReleaseQualifier field changes, removal of legacy merge/prettyprint code and tests, and regenerated deepcopy logic. ChangesRelease Qualifier API and Schema Integration
🎯 4 (Complex) | ⏱️ ~60 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/hold |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/releasequalifiers/notifications/jira/types.go (1)
53-67: ⚡ Quick winEnforce escalation window/threshold constraints in schema.
The new fields document hard constraints, but the type does not enforce them. Invalid values (for example,
overLastRuns: 0orpassPercentage: 101) can be persisted and lead to undefined escalation behavior.Suggested validation markers
type Escalation struct { @@ - OverLastRuns *int `json:"overLastRuns,omitempty" yaml:"overLastRuns,omitempty"` + // +kubebuilder:validation:Minimum=1 + OverLastRuns *int `json:"overLastRuns,omitempty" yaml:"overLastRuns,omitempty"` @@ - PassPercentage *int `json:"passPercentage,omitempty" yaml:"passPercentage,omitempty"` + // +kubebuilder:validation:Minimum=0 + // +kubebuilder:validation:Maximum=100 + PassPercentage *int `json:"passPercentage,omitempty" yaml:"passPercentage,omitempty"`🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pkg/releasequalifiers/notifications/jira/types.go` around lines 53 - 67, Add Kubernetes validation markers to enforce the documented constraints on the Jira escalation window/threshold fields: annotate OverLastRuns with +kubebuilder:validation:Minimum=1 to forbid zero/negative values, annotate PassPercentage with +kubebuilder:validation:Minimum=0 and +kubebuilder:validation:Maximum=100 to constrain the 0–100 range, and add a +kubebuilder:validation:Pattern (e.g., ^\d+(h|d|w)$) for OverPeriod to enforce the "1h|24h|2d|1w" style format; apply these markers immediately above the OverLastRuns, PassPercentage, and OverPeriod fields in types.go so the schema generation will reject invalid values.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pkg/releasequalifiers/notifications/jira/types.go`:
- Around line 53-67: Add Kubernetes validation markers to enforce the documented
constraints on the Jira escalation window/threshold fields: annotate
OverLastRuns with +kubebuilder:validation:Minimum=1 to forbid zero/negative
values, annotate PassPercentage with +kubebuilder:validation:Minimum=0 and
+kubebuilder:validation:Maximum=100 to constrain the 0–100 range, and add a
+kubebuilder:validation:Pattern (e.g., ^\d+(h|d|w)$) for OverPeriod to enforce
the "1h|24h|2d|1w" style format; apply these markers immediately above the
OverLastRuns, PassPercentage, and OverPeriod fields in types.go so the schema
generation will reject invalid values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 76f8d5e2-f7f7-4f64-9da7-d864b2520eb9
📒 Files selected for processing (13)
artifacts/release.openshift.io_releasepayloads.yamlpkg/apis/release/v1alpha1/types.gopkg/apis/release/v1alpha1/zz_generated.deepcopy.gopkg/jira/jira.gopkg/releasequalifiers/merge.gopkg/releasequalifiers/merge_test.gopkg/releasequalifiers/notifications/jira/types.gopkg/releasequalifiers/notifications/jira/zz_generated.deepcopy.gopkg/releasequalifiers/notifications/slack/types.gopkg/releasequalifiers/prettyprint.gopkg/releasequalifiers/prettyprint_test.gopkg/releasequalifiers/types.gopkg/releasequalifiers/zz_generated.deepcopy.go
💤 Files with no reviewable changes (4)
- pkg/releasequalifiers/prettyprint.go
- pkg/releasequalifiers/merge_test.go
- pkg/releasequalifiers/merge.go
- pkg/releasequalifiers/prettyprint_test.go
d970182 to
70f8009
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
artifacts/release.openshift.io_releasepayloads.yaml (1)
238-240: 💤 Low valueAdd pattern validation for Slack escalation
periodto match JiraoverPeriod.
artifacts/release.openshift.io_releasepayloads.yamldefines Slackperiodastype: stringwith nopattern(e.g., lines 238-240), while JiraoverPeriodalready enforcespattern: ^\d+(h|d|w)$; the Slack Go typepkg/releasequalifiers/notifications/slack/types.goalso has no kubebuilderPatternannotation forPeriod.🔧 Suggested fix to add pattern validation
period: description: Period defines the time window over which failures are counted type: string + pattern: ^\d+(h|d|w)$🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@artifacts/release.openshift.io_releasepayloads.yaml` around lines 238 - 240, Add the same regex validation for Slack `period` as Jira's `overPeriod` by updating the CRD schema in artifacts/release.openshift.io_releasepayloads.yaml to include pattern: ^\d+(h|d|w)$ for the Slack `period` property, and also add the kubebuilder validation annotation to the Slack Go type (pkg/releasequalifiers/notifications/slack/types.go) by annotating the Period field with // +kubebuilder:validation:Pattern:=^\d+(h|d|w)$ so both the OpenAPI schema and the Go struct enforce the same format.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@artifacts/release.openshift.io_releasepayloads.yaml`:
- Around line 238-240: Add the same regex validation for Slack `period` as
Jira's `overPeriod` by updating the CRD schema in
artifacts/release.openshift.io_releasepayloads.yaml to include pattern:
^\d+(h|d|w)$ for the Slack `period` property, and also add the kubebuilder
validation annotation to the Slack Go type
(pkg/releasequalifiers/notifications/slack/types.go) by annotating the Period
field with // +kubebuilder:validation:Pattern:=^\d+(h|d|w)$ so both the OpenAPI
schema and the Go struct enforce the same format.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: ac1e023a-3d83-4d4b-adbd-acfff25b1185
📒 Files selected for processing (12)
artifacts/release.openshift.io_releasepayloads.yamlpkg/apis/release/v1alpha1/types.gopkg/apis/release/v1alpha1/zz_generated.deepcopy.gopkg/releasequalifiers/merge.gopkg/releasequalifiers/merge_test.gopkg/releasequalifiers/notifications/jira/types.gopkg/releasequalifiers/notifications/jira/zz_generated.deepcopy.gopkg/releasequalifiers/notifications/slack/types.gopkg/releasequalifiers/prettyprint.gopkg/releasequalifiers/prettyprint_test.gopkg/releasequalifiers/types.gopkg/releasequalifiers/zz_generated.deepcopy.go
💤 Files with no reviewable changes (4)
- pkg/releasequalifiers/prettyprint.go
- pkg/releasequalifiers/prettyprint_test.go
- pkg/releasequalifiers/merge.go
- pkg/releasequalifiers/merge_test.go
✅ Files skipped from review due to trivial changes (2)
- pkg/releasequalifiers/notifications/jira/zz_generated.deepcopy.go
- pkg/apis/release/v1alpha1/zz_generated.deepcopy.go
🚧 Files skipped from review as they are similar to previous changes (4)
- pkg/releasequalifiers/zz_generated.deepcopy.go
- pkg/releasequalifiers/notifications/jira/types.go
- pkg/releasequalifiers/types.go
- pkg/apis/release/v1alpha1/types.go
5e6d44b to
b7114b8
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@artifacts/release.openshift.io_releasepayloads.yaml`:
- Around line 143-147: The CRD schema still defines the qualifier field as
labels instead of the new failureLabels, which will cause pruning when clients
send failureLabels; update each duplicated qualifiers schema block (the
qualifiers object that currently contains a property named labels) to rename
that property to failureLabels (type: array, items: type: string) and then
regenerate the CRD from the updated Go types so the change is reflected across
all three occurrences.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: fa8a4b64-0220-450c-93ec-745bc8c20015
📒 Files selected for processing (12)
artifacts/release.openshift.io_releasepayloads.yamlpkg/apis/release/v1alpha1/types.gopkg/apis/release/v1alpha1/zz_generated.deepcopy.gopkg/releasequalifiers/merge.gopkg/releasequalifiers/merge_test.gopkg/releasequalifiers/notifications/jira/types.gopkg/releasequalifiers/notifications/jira/zz_generated.deepcopy.gopkg/releasequalifiers/notifications/slack/types.gopkg/releasequalifiers/prettyprint.gopkg/releasequalifiers/prettyprint_test.gopkg/releasequalifiers/types.gopkg/releasequalifiers/zz_generated.deepcopy.go
💤 Files with no reviewable changes (4)
- pkg/releasequalifiers/prettyprint.go
- pkg/releasequalifiers/merge.go
- pkg/releasequalifiers/prettyprint_test.go
- pkg/releasequalifiers/merge_test.go
✅ Files skipped from review due to trivial changes (3)
- pkg/releasequalifiers/zz_generated.deepcopy.go
- pkg/releasequalifiers/notifications/jira/zz_generated.deepcopy.go
- pkg/apis/release/v1alpha1/zz_generated.deepcopy.go
🚧 Files skipped from review as they are similar to previous changes (4)
- pkg/releasequalifiers/notifications/slack/types.go
- pkg/releasequalifiers/types.go
- pkg/apis/release/v1alpha1/types.go
- pkg/releasequalifiers/notifications/jira/types.go
34148d9 to
6b202bc
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/releasequalifiers/notifications/slack/types.go`:
- Around line 28-29: The Period field's kubebuilder pattern currently allows
zero-length values like "0h"; update the validation regex for the Period string
(the Period field in pkg/releasequalifiers/notifications/slack/types.go) to
require a positive integer (e.g. change to a pattern that uses [1-9]\d* for the
number portion so only values like "1h", "10d", "2w" are allowed) while keeping
the same time-unit suffix (h|d|w).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2b5c0a77-1dfe-40c1-9a83-c3f97926a969
📒 Files selected for processing (12)
artifacts/release.openshift.io_releasepayloads.yamlpkg/apis/release/v1alpha1/types.gopkg/apis/release/v1alpha1/zz_generated.deepcopy.gopkg/releasequalifiers/merge.gopkg/releasequalifiers/merge_test.gopkg/releasequalifiers/notifications/jira/types.gopkg/releasequalifiers/notifications/jira/zz_generated.deepcopy.gopkg/releasequalifiers/notifications/slack/types.gopkg/releasequalifiers/prettyprint.gopkg/releasequalifiers/prettyprint_test.gopkg/releasequalifiers/types.gopkg/releasequalifiers/zz_generated.deepcopy.go
💤 Files with no reviewable changes (4)
- pkg/releasequalifiers/prettyprint_test.go
- pkg/releasequalifiers/prettyprint.go
- pkg/releasequalifiers/merge.go
- pkg/releasequalifiers/merge_test.go
✅ Files skipped from review due to trivial changes (3)
- pkg/releasequalifiers/zz_generated.deepcopy.go
- pkg/apis/release/v1alpha1/zz_generated.deepcopy.go
- pkg/releasequalifiers/notifications/jira/zz_generated.deepcopy.go
🚧 Files skipped from review as they are similar to previous changes (4)
- pkg/releasequalifiers/types.go
- pkg/apis/release/v1alpha1/types.go
- pkg/releasequalifiers/notifications/jira/types.go
- artifacts/release.openshift.io_releasepayloads.yaml
6b202bc to
1beb4dd
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/releasequalifiers/notifications/slack/types.go`:
- Around line 32-33: MinFailures currently uses int plus omitempty so 0 is
omitted and the kubebuilder minimum=1 never validates an explicit zero; change
the field to a pointer type (MinFailures *int `json:"minFailures,omitempty"
yaml:"minFailures,omitempty"`) so an explicit 0 is preserved and the CRD
minimum: 1 will reject it, and then update any code that reads MinFailures
(e.g., any validation, defaulting or usage sites that access MinFailures
directly) to handle nil (treat nil as unset) and dereference safely;
alternatively, if you prefer the 0==unset semantics, add a comment above
MinFailures explaining that 0 is treated as unset and keep the current type.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: a92f5497-b872-4aed-b777-638d8139f9f5
📒 Files selected for processing (12)
artifacts/release.openshift.io_releasepayloads.yamlpkg/apis/release/v1alpha1/types.gopkg/apis/release/v1alpha1/zz_generated.deepcopy.gopkg/releasequalifiers/merge.gopkg/releasequalifiers/merge_test.gopkg/releasequalifiers/notifications/jira/types.gopkg/releasequalifiers/notifications/jira/zz_generated.deepcopy.gopkg/releasequalifiers/notifications/slack/types.gopkg/releasequalifiers/prettyprint.gopkg/releasequalifiers/prettyprint_test.gopkg/releasequalifiers/types.gopkg/releasequalifiers/zz_generated.deepcopy.go
💤 Files with no reviewable changes (4)
- pkg/releasequalifiers/prettyprint.go
- pkg/releasequalifiers/prettyprint_test.go
- pkg/releasequalifiers/merge.go
- pkg/releasequalifiers/merge_test.go
✅ Files skipped from review due to trivial changes (3)
- pkg/releasequalifiers/zz_generated.deepcopy.go
- pkg/releasequalifiers/notifications/jira/zz_generated.deepcopy.go
- pkg/apis/release/v1alpha1/zz_generated.deepcopy.go
🚧 Files skipped from review as they are similar to previous changes (4)
- pkg/apis/release/v1alpha1/types.go
- pkg/releasequalifiers/types.go
- pkg/releasequalifiers/notifications/jira/types.go
- artifacts/release.openshift.io_releasepayloads.yaml
rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
1beb4dd to
9e1a6bf
Compare
|
@bradmwilliams: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
CRD changes to enable Release Qualifying Jobs
rh-pre-commit.version: 2.4.0
rh-pre-commit.check-secrets: ENABLED
Summary by CodeRabbit
New Features
Breaking Changes
Chores