Add Slack reporter for capz-e2e-production periodic job#80867
Conversation
Configure Slack notifications to #hcm-aro-team-capz for the periodic-ci-Azure-ARO-HCP-main-capz-e2e-production job, reporting on success, failure, and error states. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WalkthroughA Changescapz-e2e Production Job Reporting
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: RadekCap The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
[REHEARSALNOTIFIER]
Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals. Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
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 `@ci-operator/config/Azure/ARO-HCP/Azure-ARO-HCP-main__capz-e2e.yaml`:
- Around line 212-213: The report_template field in the
Azure-ARO-HCP-main__capz-e2e.yaml file always uses the `:failed:` emoji
regardless of job outcome, causing success notifications to be labeled as
failures. Modify the report_template to conditionally select the emoji based on
the `.Status.State` field value, so that successful jobs display a success emoji
and failed jobs display the failure emoji. Replace the hardcoded `:failed:` with
a conditional expression that evaluates the job state and returns the
appropriate emoji accordingly.
🪄 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: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 84fe8281-1a3a-4ca9-af13-52c1babe5f64
⛔ Files ignored due to path filters (1)
ci-operator/jobs/Azure/ARO-HCP/Azure-ARO-HCP-main-periodics.yamlis excluded by!ci-operator/jobs/**
📒 Files selected for processing (1)
ci-operator/config/Azure/ARO-HCP/Azure-ARO-HCP-main__capz-e2e.yaml
| report_template: ':failed: Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. | ||
| <{{.Status.URL}}|View logs>' |
There was a problem hiding this comment.
Use a state-aware emoji in the Slack template.
On Line 212, the template always starts with :failed:, so success notifications are labeled like failures. Make the icon conditional on .Status.State.
Suggested patch
- report_template: ':failed: Job *{{.Spec.Job}}* ended with *{{.Status.State}}*.
- <{{.Status.URL}}|View logs>'
+ report_template: '{{ if eq .Status.State "success" }}:white_check_mark:{{ else }}:failed:{{ end }} Job *{{.Spec.Job}}* ended with *{{.Status.State}}*.
+ <{{.Status.URL}}|View logs>'📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| report_template: ':failed: Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. | |
| <{{.Status.URL}}|View logs>' | |
| report_template: '{{ if eq .Status.State "success" }}:white_check_mark:{{ else }}:failed:{{ end }} Job *{{.Spec.Job}}* ended with *{{.Status.State}}*. | |
| <{{.Status.URL}}|View logs>' |
🤖 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 `@ci-operator/config/Azure/ARO-HCP/Azure-ARO-HCP-main__capz-e2e.yaml` around
lines 212 - 213, The report_template field in the
Azure-ARO-HCP-main__capz-e2e.yaml file always uses the `:failed:` emoji
regardless of job outcome, causing success notifications to be labeled as
failures. Modify the report_template to conditionally select the emoji based on
the `.Status.State` field value, so that successful jobs display a success emoji
and failed jobs display the failure emoji. Replace the hardcoded `:failed:` with
a conditional expression that evaluates the job state and returns the
appropriate emoji accordingly.
|
@RadekCap: 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. |
Summary
#hcm-aro-team-capzfor theperiodic-ci-Azure-ARO-HCP-main-capz-e2e-productionjobperiodic-ci-stolostron-capi-tests-configure-prow-mgmt-periodics-capz-e2eChanges
ci-operator/config/Azure/ARO-HCP/Azure-ARO-HCP-main__capz-e2e.yaml— addreporter_configto theproductiontestci-operator/jobs/Azure/ARO-HCP/Azure-ARO-HCP-main-periodics.yaml— addreporter_config.slackto the generated job🤖 Generated with Claude Code
Summary by CodeRabbit
This PR adds Slack notification integration for the ARO-HCP Kubernetes infrastructure CI job. Specifically, it configures the production CAPZ (Cluster API Provider for Azure) end-to-end test job to send status updates to the
#hcm-aro-team-capzSlack channel.The changes enable notifications for all three job outcome states (success, failure, and error), with each message displaying the job name, final status, and a direct link to the job logs. The production test runs on a weekly schedule (8 PM UTC weekdays).
The configuration is applied at two levels in the OpenShift CI infrastructure:
Azure-ARO-HCP-main__capz-e2e.yaml): Defines the reporter settings for the production test variantAzure-ARO-HCP-main-periodics.yaml): The Prow periodic job that includes the Slack reporter configurationThis follows the established pattern already in use by other ARO-HCP CI jobs and improves observability for the team by proactively notifying them of test results through Slack.