Skip to content

NO-ISSUE: ofcir-acquire: skip Slack notification when slackhook secret is missing#80290

Open
omertuc wants to merge 1 commit into
openshift:mainfrom
omertuc:noslack
Open

NO-ISSUE: ofcir-acquire: skip Slack notification when slackhook secret is missing#80290
omertuc wants to merge 1 commit into
openshift:mainfrom
omertuc:noslack

Conversation

@omertuc

@omertuc omertuc commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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

Summary by CodeRabbit

This PR modifies the ofcir-acquire step in OpenShift's CI infrastructure to gracefully handle cluster profiles that lack a Slack webhook secret. Cluster profiles such as equinix-edge-enablement don't provision a slackhook secret, 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_slack function that verifies the slackhook file exists under CLUSTER_PROFILE_DIR before 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)

…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>
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 9, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@omertuc: This pull request explicitly references no jira issue.

Details

In response to this:

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

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.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 73a64d78-9994-44a4-aa89-98cd0fd9dccd

📥 Commits

Reviewing files that changed from the base of the PR and between 6ae1354 and 66db4ec.

📒 Files selected for processing (1)
  • ci-operator/step-registry/ofcir/acquire/ofcir-acquire-commands.sh

Walkthrough

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

Changes

Slack notification defensive check

Layer / File(s) Summary
Slack notification guard
ci-operator/step-registry/ofcir/acquire/ofcir-acquire-commands.sh
The send_slack function adds an early check for the existence of the ${CLUSTER_PROFILE_DIR}/slackhook file. If the file is not present, the function prints a message and returns without attempting to send the notification.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • openshift/release#77861: Both PRs update shell logic that sends Slack notifications to first handle a missing Slack webhook/token file (skipping notification when the webhook source file isn't present).

Suggested labels

lgtm

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: adding a guard to skip Slack notifications when the slackhook secret is missing, which directly addresses the crash described in the PR objectives.
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 a bash script file with no Ginkgo tests; custom check for Ginkgo test name stability is not applicable to this change.
Test Structure And Quality ✅ Passed This PR modifies shell scripts, not Ginkgo test code. The custom check for "Test Structure and Quality" applies only to Ginkgo tests, making it not applicable to this PR.
Microshift Test Compatibility ✅ Passed This PR modifies only a Bash CI script with no Ginkgo e2e tests added. The custom check only applies when new Ginkgo tests are added, so it is not applicable here.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. The changes only modify a shell script (ofcir-acquire-commands.sh) for CI/CD infrastructure, not test code. The SNO compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only a CI infrastructure shell script (not a deployment manifest, operator code, or controller), making no scheduling-related changes. Check is not applicable to this PR type.
Ote Binary Stdout Contract ✅ Passed File is a bash CI step script in openshift/release, not an OTE binary. The OTE contract applies only to binaries communicating with openshift-tests via JSON.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. Changes are to bash shell scripts only (ofcir-acquire-commands.sh), making the IPv6/disconnected network test compatibility check not applicable.
No-Weak-Crypto ✅ Passed PR contains no weak cryptographic algorithms, custom crypto implementations, or non-constant-time comparisons. Changes are defensive file existence checks in bash script.
Container-Privileges ✅ Passed PR modifies only a shell script function to check file existence; no privileged container settings, capabilities, or Kubernetes security configurations are introduced or modified.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds a guard check that logs only "No slackhook found" message. The guard prevents execution of code that constructs SLACK_AUTH_TOKEN with sensitive credentials, improving security.

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

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

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

@omertuc

omertuc commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@openshift-ci openshift-ci Bot requested review from smg247 and sosiouxme June 9, 2026 12:45
@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

Copy link
Copy Markdown
Contributor

[REHEARSALNOTIFIER]
@omertuc: 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
pull-ci-openshift-image-based-install-operator-main-e2e-ibio openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-main-e2e-ibio-v4v6 openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-main-e2e-ibio-v6v4 openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.9-e2e-ibio openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-5.0-e2e-ibio openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-5.0-e2e-ibio-v4v6 openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-5.0-e2e-ibio-v6v4 openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.17-e2e-ibio openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.10-e2e-ibio openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.11-e2e-ibio openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.8-e2e-ibio openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.7-e2e-ibio openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-main-ibio-reinstall openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-main-ibio-reinstall-v4v6 openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-main-ibio-reinstall-v6v4 openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.9-ibio-reinstall openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-5.0-ibio-reinstall openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-5.0-ibio-reinstall-v4v6 openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-5.0-ibio-reinstall-v6v4 openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.17-ibio-reinstall openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.10-ibio-reinstall openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.11-ibio-reinstall openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-image-based-install-operator-backplane-2.8-ibio-reinstall openshift/image-based-install-operator presubmit Registry content changed
pull-ci-openshift-cluster-network-operator-master-e2e-metal-ipi-ovn-ipv6 openshift/cluster-network-operator presubmit Registry content changed
pull-ci-openshift-cluster-network-operator-release-5.1-e2e-metal-ipi-ovn-ipv6 openshift/cluster-network-operator presubmit Registry content changed

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

@omertuc

omertuc commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

/pj-rehearse pull-ci-rh-ecosystem-edge-recert-main-baremetalds-sno-recert-cluster-rename

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

@omertuc: now processing your pj-rehearse request. Please allow up to 10 minutes for jobs to trigger or cancel.

@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@omertuc: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/rehearse/rh-ecosystem-edge/recert/main/baremetalds-sno-recert-cluster-rename 66db4ec link unknown /pj-rehearse pull-ci-rh-ecosystem-edge-recert-main-baremetalds-sno-recert-cluster-rename

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

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants