Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions ci-operator/config/redhat-developer/rhdh/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# RHDH CI Configuration

## New Release Branch Checklist

When creating a new release branch (e.g., `release-1.11`):

### Slack Webhook

1. Create a new Slack channel following the established naming scheme (see existing channels in the [Nightly Test Alerts Slack app](https://api.slack.com/apps/A08U4AP1YTY/incoming-webhooks) for reference).
2. In the same Slack app, create a new incoming webhook for the newly created channel.
3. Store the webhook URL in the vault as `SLACK_ALERTS_WEBHOOK_URL_X_Y` (e.g., `SLACK_ALERTS_WEBHOOK_URL_1_11` for `release-1.11`).
4. The `redhat-developer-rhdh-send-alert` step automatically detects the release version from `JOB_NAME` and looks for the versioned webhook file at `/tmp/secrets/SLACK_ALERTS_WEBHOOK_URL_X_Y`. If not found, it falls back to `/tmp/secrets/SLACK_ALERTS_WEBHOOK_URL`.

### Job Concurrency

After running `make update` for the new release branch, manually set `max_concurrency` on presubmit jobs in `ci-operator/jobs/redhat-developer/rhdh/`. This value is not auto-generated for new jobs. Use the main branch presubmits as reference for the correct values.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,21 @@ if [[ "$JOB_TYPE" != "periodic" ]]; then
fi

RELEASE_BRANCH_NAME=$(echo "${JOB_SPEC}" | jq -r '.extra_refs[].base_ref' 2>/dev/null || echo "${JOB_SPEC}" | jq -r '.refs.base_ref')
SLACK_NIGHTLY_WEBHOOK_URL=$(cat /tmp/secrets/SLACK_NIGHTLY_WEBHOOK_URL)
export RELEASE_BRANCH_NAME SLACK_NIGHTLY_WEBHOOK_URL
export RELEASE_BRANCH_NAME

SLACK_ALERTS_WEBHOOK_URL_FILE="/tmp/secrets/SLACK_ALERTS_WEBHOOK_URL"
if [[ "${JOB_NAME}" =~ release-([0-9]+\.[0-9]+) ]]; then
RELEASE_VERSION="${BASH_REMATCH[1]}"
VERSIONED_FILE="/tmp/secrets/SLACK_ALERTS_WEBHOOK_URL_${RELEASE_VERSION//./_}"
if [[ -f "${VERSIONED_FILE}" ]]; then
echo "Using release-specific webhook URL from ${VERSIONED_FILE}"
SLACK_ALERTS_WEBHOOK_URL_FILE="${VERSIONED_FILE}"
else
echo "Versioned webhook file ${VERSIONED_FILE} not found, falling back to default."
fi
fi
SLACK_ALERTS_WEBHOOK_URL=$(cat "${SLACK_ALERTS_WEBHOOK_URL_FILE}")
export SLACK_ALERTS_WEBHOOK_URL

get_artifacts_url() {
local namespace=$1
Expand Down Expand Up @@ -175,7 +188,7 @@ main() {
echo "No fine-grained results available, sending default message."
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\":failed: \`$JOB_NAME\`, 📜 <$URL_CI_RESULTS|logs>, 📦 <$URL_ARTIFACTS_TOP|artifacts>, <!subteam^S07BMJ56R8S> <@U08UP0REWG1>.\"}" \
"$SLACK_NIGHTLY_WEBHOOK_URL"
"$SLACK_ALERTS_WEBHOOK_URL"
exit 1
else
echo "Sending Slack notification with the following text:"
Expand All @@ -184,7 +197,7 @@ main() {
echo "==================================================="
if ! curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"${SLACK_ALERT_MESSAGE}\"}" \
"$SLACK_NIGHTLY_WEBHOOK_URL"; then
"$SLACK_ALERTS_WEBHOOK_URL"; then
echo "Failed to send alert message to Slack, error: $?"
exit 1
else
Expand Down