Skip to content

Add Slack reporter for capz-e2e-production periodic job#80867

Open
RadekCap wants to merge 1 commit into
openshift:mainfrom
RadekCap:capz-e2e-production-slack-connector
Open

Add Slack reporter for capz-e2e-production periodic job#80867
RadekCap wants to merge 1 commit into
openshift:mainfrom
RadekCap:capz-e2e-production-slack-connector

Conversation

@RadekCap

@RadekCap RadekCap commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes

  • ci-operator/config/Azure/ARO-HCP/Azure-ARO-HCP-main__capz-e2e.yaml — add reporter_config to the production test
  • ci-operator/jobs/Azure/ARO-HCP/Azure-ARO-HCP-main-periodics.yaml — add reporter_config.slack to 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-capz Slack 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:

  • Source configuration (Azure-ARO-HCP-main__capz-e2e.yaml): Defines the reporter settings for the production test variant
  • Generated job definition (Azure-ARO-HCP-main-periodics.yaml): The Prow periodic job that includes the Slack reporter configuration

This 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.

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>
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

A reporter_config block is added to the production test job in Azure-ARO-HCP-main__capz-e2e.yaml. It configures Slack reporting to channel #hcm-aro-team-capz for success, failure, and error states, with a message template that includes the job name, final state, and a link to job logs.

Changes

capz-e2e Production Job Reporting

Layer / File(s) Summary
production job reporter_config
ci-operator/config/Azure/ARO-HCP/Azure-ARO-HCP-main__capz-e2e.yaml
Adds a reporter_config section to the production job specifying the Slack channel #hcm-aro-team-capz, the states to report (success, failure, error), and a templated notification message with job name, state, and logs URL.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding Slack reporter configuration for the capz-e2e-production periodic job, which aligns with the changeset's primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR modifies only YAML configuration files (ci-operator/config/Azure/ARO-HCP/Azure-ARO-HCP-main__capz-e2e.yaml) containing Slack reporter config, not Ginkgo test definitions. No test names modified.
Test Structure And Quality ✅ Passed Check not applicable: PR modifies CI/CD configuration files (YAML), not Ginkgo test code.
Microshift Test Compatibility ✅ Passed PR only modifies CI/CD YAML configuration (Slack notifications), not adding any Ginkgo e2e tests, so MicroShift compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR adds only CI/CD config changes (YAML); no new Ginkgo e2e tests added, so SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed Check not applicable: PR modifies only CI-operator configuration for Slack notifications, not deployment manifests, operator code, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed This PR modifies only YAML configuration files for CI/CD jobs. The OTE Binary Stdout Contract check applies to executable code (main functions, test setup), not configuration files. No code changes...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds only CI configuration for Slack notifications to an existing test job; no new Ginkgo e2e tests are introduced, so the check for IPv6/disconnected network compatibility does not apply.
No-Weak-Crypto ✅ Passed PR contains only YAML configuration changes for Slack notifications; no weak crypto algorithms (MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB), custom crypto implementations, or secret comparison code f...
Container-Privileges ✅ Passed PR modifies only Slack reporter configuration for CI job notifications; no container privilege escalation features (privileged mode, hostPID, hostNetwork, hostIPC, SYS_ADMIN, allowPrivilegeEscalati...
No-Sensitive-Data-In-Logs ✅ Passed The reporter_config only logs non-sensitive data (job name, status state, and logs URL) to Slack. No passwords, tokens, API keys, PII, or customer data are exposed in the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

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.

❤️ Share

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

@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@openshift-ci openshift-ci Bot requested review from deads2k and mmazur June 22, 2026 19:14
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@RadekCap: the pj-rehearse plugin accommodates running rehearsal tests for the changes in this PR. Expand 'Interacting with pj-rehearse' for usage details. The following rehearsable tests have been affected by this change:

Test name Repo Type Reason
periodic-ci-Azure-ARO-HCP-main-capz-e2e-production N/A periodic Ci-operator config changed

Prior to this PR being merged, you will need to either run and acknowledge or opt to skip these rehearsals.

Interacting with pj-rehearse

Comment: /pj-rehearse to run up to 5 rehearsals
Comment: /pj-rehearse skip to opt-out of rehearsals
Comment: /pj-rehearse {test-name}, with each test separated by a space, to run one or more specific rehearsals
Comment: /pj-rehearse more to run up to 10 rehearsals
Comment: /pj-rehearse max to run up to 25 rehearsals
Comment: /pj-rehearse auto-ack to run up to 5 rehearsals, and add the rehearsals-ack label on success
Comment: /pj-rehearse list to get an up-to-date list of affected jobs
Comment: /pj-rehearse abort to abort all active rehearsals
Comment: /pj-rehearse network-access-allowed to allow rehearsals of tests that have the restrict_network_access field set to false. This must be executed by an openshift org member who is not the PR author

Once you are satisfied with the results of the rehearsals, comment: /pj-rehearse ack to unblock merge. When the rehearsals-ack label is present on your PR, merge will no longer be blocked by rehearsals.
If you would like the rehearsals-ack label removed, comment: /pj-rehearse reject to re-block merging.

@coderabbitai coderabbitai Bot left a comment

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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 725f9dd and d7c7abf.

⛔ Files ignored due to path filters (1)
  • ci-operator/jobs/Azure/ARO-HCP/Azure-ARO-HCP-main-periodics.yaml is excluded by !ci-operator/jobs/**
📒 Files selected for processing (1)
  • ci-operator/config/Azure/ARO-HCP/Azure-ARO-HCP-main__capz-e2e.yaml

Comment on lines +212 to +213
report_template: ':failed: Job *{{.Spec.Job}}* ended with *{{.Status.State}}*.
<{{.Status.URL}}|View logs>'

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

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.

Suggested change
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.

@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

@RadekCap: all tests passed!

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.

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.

1 participant