NO-ISSUE: ofcir-acquire: skip Slack notification when slackhook secret is missing#80290
NO-ISSUE: ofcir-acquire: skip Slack notification when slackhook secret is missing#80290omertuc wants to merge 1 commit into
Conversation
…t is missing Cluster profiles like equinix-edge-enablement don't have a slackhook secret, causing ofcir-acquire to crash on the missing file read when OFCIR acquisition fails. Guard the send_slack function so it skips gracefully instead of breaking the error path. Errors seen in CI: cat: /var/run/secrets/ci.openshift.io/cluster-profile/slackhook: No such file or directory SLACK_AUTH_TOKEN=... no_token Assisted-by: Claude Opus 4.6 <noreply@anthropic.com>
|
@omertuc: This pull request explicitly references no jira issue. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
WalkthroughA shell script function that sends Slack notifications is updated to check whether a webhook token file exists before attempting to read it. If the file is missing, the function prints a message and returns early, preventing errors from accessing a non-existent file. ChangesSlack notification defensive check
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 14 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (14 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@derekhiggins seems like something you worked on, could you please have a look? Example failure https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_release/79782/rehearse-79782-pull-ci-rh-ecosystem-edge-recert-main-baremetalds-sno-recert-cluster-rename/2064318028857741312 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: omertuc 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]
A total of 5176 jobs have been affected by this change. The above listing is non-exhaustive and limited to 25 jobs. A full list of affected jobs can be found here Interacting with pj-rehearseComment: Once you are satisfied with the results of the rehearsals, comment: |
|
/pj-rehearse pull-ci-rh-ecosystem-edge-recert-main-baremetalds-sno-recert-cluster-rename |
|
@omertuc: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel. |
|
@omertuc: The following test failed, say
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. |
Cluster profiles like equinix-edge-enablement don't have a slackhook secret, causing ofcir-acquire to crash on the missing file read when OFCIR acquisition fails. Guard the send_slack function so it skips gracefully instead of breaking the error path.
Errors seen in CI:
Assisted-by: Claude Opus 4.6 noreply@anthropic.com
Summary by CodeRabbit
This PR modifies the
ofcir-acquirestep in OpenShift's CI infrastructure to gracefully handle cluster profiles that lack a Slack webhook secret. Cluster profiles such asequinix-edge-enablementdon't provision aslackhooksecret, and when OFCIR resource acquisition fails, the step was crashing while attempting to read the non-existent webhook token file.The fix adds a guard check in the
send_slackfunction that verifies theslackhookfile exists underCLUSTER_PROFILE_DIRbefore attempting to read it. If the file is missing, the function logs an informational message and returns early without sending the Slack notification, allowing the acquisition process to fail cleanly without secondary errors breaking the error reporting path.Files changed:
ci-operator/step-registry/ofcir/acquire/ofcir-acquire-commands.sh(+4 lines)