Skip to content

Commit e47d306

Browse files
authored
docs: route docs build alerts to #docs-alerts (#23293)
Switch docs CI Slack notifications from `#devrel-docs-updates` to `#docs-alerts`. Updated channel references in: - `docs/bootstrap.sh` (doc reference check failure alert) - `docs/examples/bootstrap.sh` (default channel for `send_slack_message`) - `docs/scripts/check_doc_references.sh` (doc-references PR notification + `SLACK_DOC_UPDATE_CHANNEL` default) - `docs/scripts/validate_api_ref_links.sh` (API ref link validation alert) Requested by Josh Crites in #docs-alerts. --- *Created by [claudebox](https://claudebox.work/v2/sessions/ed31fdd79c7253b6) · group: `slackbot`*
2 parents acb8493 + fbf1abb commit e47d306

6 files changed

Lines changed: 31 additions & 29 deletions

File tree

.github/workflows/ci3.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ jobs:
9696
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
9797
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
9898
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
99+
# Used by docs CI scripts to post to #docs-alerts (the SLACK_BOT_TOKEN bot lacks access there).
100+
AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN: ${{ secrets.AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN }}
99101
AZTEC_TOOLCHAIN_DEFAULT_MAJOR_VERSION: ${{ vars.AZTEC_TOOLCHAIN_DEFAULT_MAJOR_VERSION }}
100102
# For automatic documentation updates via Claude Code
101103
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

docs/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,20 +577,20 @@ Building on the DevRel review automation, the docs CI can analyze PRs and notify
577577
- Generate suggested documentation changes
578578

579579
3. **Slack Notification**: If documentation updates are suggested:
580-
- A message is sent to the configured Slack channel (default: `#devrel`)
580+
- A message is sent to the configured Slack channel (default: `#docs-alerts`)
581581
- The message includes the PR details, affected docs, and suggested changes
582582
- The DevRel team can review and apply the changes manually
583583

584584
**Requirements**:
585585

586586
- `ANTHROPIC_API_KEY` must be set in CI secrets
587-
- `SLACK_BOT_TOKEN` must be set for Slack notifications
587+
- `AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN` must be set for Slack notifications (this bot has access to `#docs-alerts`)
588588
- Claude Code CLI must be installed (`@anthropic-ai/claude-code`)
589589
- The PR must not be a draft
590590

591591
**Environment Variables**:
592592

593-
- `SLACK_DOC_UPDATE_CHANNEL` - Slack channel for notifications (default: `#devrel`)
593+
- `SLACK_DOC_UPDATE_CHANNEL` - Slack channel for notifications (default: `#docs-alerts`)
594594
- `DRY_RUN=1` - Skip Slack notification, just print what would be sent
595595

596596
**Implementation**: The automation is handled by `scripts/check_doc_references.sh`, which detects changed references, requests devrel review, sends a Slack notification, and dispatches ClaudeBox — all in a single pass.

docs/bootstrap.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ function check_references {
6161
echo_header "Check doc references"
6262
if ! ./scripts/check_doc_references.sh docs; then
6363
echo "⚠ Doc reference check failed (non-blocking)."
64-
if [[ -n "${SLACK_BOT_TOKEN:-}" ]]; then
64+
if [[ -n "${AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN:-}" ]]; then
6565
curl -s -X POST https://slack.com/api/chat.postMessage \
66-
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
66+
-H "Authorization: Bearer $AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN" \
6767
-H "Content-type: application/json" \
68-
-d "{\"channel\": \"#devrel-docs-updates\", \"text\": \"⚠️ Doc reference check script failed for ref \`${GITHUB_REF_NAME:-unknown}\`. Check CI logs.\"}" \
68+
-d "{\"channel\": \"#docs-alerts\", \"text\": \"⚠️ Doc reference check script failed for ref \`${GITHUB_REF_NAME:-unknown}\`. Check CI logs.\"}" \
6969
> /dev/null 2>&1 || true
7070
fi
7171
fi

docs/examples/bootstrap.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ function get_pr_number {
237237

238238
function send_slack_message {
239239
local message=$1
240-
local channel=${2:-"#devrel-docs-updates"}
241-
if [[ -z "${SLACK_BOT_TOKEN:-}" ]]; then
242-
echo "SLACK_BOT_TOKEN not set, skipping Slack notification"
240+
local channel=${2:-"#docs-alerts"}
241+
if [[ -z "${AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN:-}" ]]; then
242+
echo "AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN not set, skipping Slack notification"
243243
return 0
244244
fi
245245

@@ -249,7 +249,7 @@ function send_slack_message {
249249

250250
local response
251251
if ! response=$(curl -s --fail-with-body -X POST https://slack.com/api/chat.postMessage \
252-
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
252+
-H "Authorization: Bearer $AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN" \
253253
-H "Content-type: application/json" \
254254
--data "$data"); then
255255
echo "Slack API request failed (curl error)" >&2

docs/scripts/check_doc_references.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -euo pipefail
77
# 1. Extracts all 'references' fields from documentation markdown frontmatter
88
# 2. Checks if any referenced files were changed in the current PR
99
# 3. Requests AztecProtocol/devrel team as reviewers if files changed and PR is not draft
10-
# 4. Sends a Slack message to #devrel-docs-updates showing which changed files are referenced by which docs
10+
# 4. Sends a Slack message to #docs-alerts showing which changed files are referenced by which docs
1111
# 5. Dispatches ClaudeBox to analyze changes and update documentation
1212
# 6. Skips reviewer request if devrel team is already requested or a member has approved
1313
#
@@ -25,7 +25,7 @@ set -euo pipefail
2525
# GITHUB_REF - May contain PR number in format refs/pull/123/merge
2626
# GITHUB_BASE_REF - Base branch name (set by GitHub Actions)
2727
# GITHUB_TOKEN - GitHub token for gh CLI (set by GitHub Actions)
28-
# SLACK_BOT_TOKEN - Required for sending Slack messages
28+
# AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN - Required for sending Slack messages (has #docs-alerts access)
2929
# CI - Set to 1 in CI environment
3030

3131
# Only run in CI environment to avoid accidental local execution
@@ -37,21 +37,21 @@ fi
3737
# Function to send Slack message
3838
send_slack_message() {
3939
local message=$1
40-
if [[ -z "${SLACK_BOT_TOKEN:-}" ]]; then
41-
echo "SLACK_BOT_TOKEN not set, skipping Slack notification"
40+
if [[ -z "${AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN:-}" ]]; then
41+
echo "AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN not set, skipping Slack notification"
4242
return 0
4343
fi
4444

4545
local data=$(cat <<EOF
4646
{
47-
"channel": "#devrel-docs-updates",
47+
"channel": "#docs-alerts",
4848
"text": "$message"
4949
}
5050
EOF
5151
)
5252
local response
5353
if ! response=$(curl -s --fail-with-body -X POST https://slack.com/api/chat.postMessage \
54-
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
54+
-H "Authorization: Bearer $AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN" \
5555
-H "Content-type: application/json" \
5656
--data "$data"); then
5757
echo "Slack API request failed (curl error)" >&2
@@ -352,11 +352,11 @@ else
352352
fi
353353

354354
# Send or update Slack notification (one message per PR, updated on each run)
355-
SLACK_CHANNEL="${SLACK_DOC_UPDATE_CHANNEL:-devrel-docs-updates}"
355+
SLACK_CHANNEL="${SLACK_DOC_UPDATE_CHANNEL:-docs-alerts}"
356356
TS=""
357357
CHANNEL_ID=""
358358

359-
if [[ -n "${SLACK_BOT_TOKEN:-}" ]]; then
359+
if [[ -n "${AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN:-}" ]]; then
360360
# Build the Slack message
361361
NOW=$(date -u '+%Y-%m-%d %H:%M UTC')
362362
SLACK_MESSAGE="📚 *Documentation References Updated*\\n\\nThe following source files changed in <$PR_URL|PR #$PR_NUMBER> are referenced by documentation:\\n"
@@ -381,7 +381,7 @@ if [[ -n "${SLACK_BOT_TOKEN:-}" ]]; then
381381

382382
# Look up channel ID
383383
CHANNEL_ID=$(curl -sS "https://slack.com/api/conversations.list?types=public_channel&limit=200" \
384-
-H "Authorization: Bearer $SLACK_BOT_TOKEN" | jq -r ".channels[] | select(.name==\"$SLACK_CHANNEL\") | .id" 2>/dev/null || echo "")
384+
-H "Authorization: Bearer $AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN" | jq -r ".channels[] | select(.name==\"$SLACK_CHANNEL\") | .id" 2>/dev/null || echo "")
385385

386386
if [[ -n "$CHANNEL_ID" ]]; then
387387
# Search channel history for an existing message about this PR (paginate up to 1000 messages)
@@ -393,7 +393,7 @@ if [[ -n "${SLACK_BOT_TOKEN:-}" ]]; then
393393
HISTORY_URL="https://slack.com/api/conversations.history?channel=$CHANNEL_ID&limit=200"
394394
[[ -n "$CURSOR" ]] && HISTORY_URL="${HISTORY_URL}&cursor=$CURSOR"
395395

396-
HISTORY_RESP=$(curl -sS "$HISTORY_URL" -H "Authorization: Bearer $SLACK_BOT_TOKEN")
396+
HISTORY_RESP=$(curl -sS "$HISTORY_URL" -H "Authorization: Bearer $AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN")
397397

398398
EXISTING_TS=$(echo "$HISTORY_RESP" | \
399399
jq -r ".messages[]? | select(.text != null and .bot_id != null and (.text | contains(\"PR #$PR_NUMBER\"))) | .ts" 2>/dev/null | head -1 || echo "")
@@ -407,7 +407,7 @@ if [[ -n "${SLACK_BOT_TOKEN:-}" ]]; then
407407
# Update existing message
408408
echo "Updating existing Slack message for PR #$PR_NUMBER..."
409409
RESP=$(curl -sS -X POST https://slack.com/api/chat.update \
410-
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
410+
-H "Authorization: Bearer $AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN" \
411411
-H "Content-type: application/json" \
412412
-d "$(jq -n --arg c "$CHANNEL_ID" --arg ts "$EXISTING_TS" --arg t "$SLACK_MESSAGE" \
413413
'{channel:$c, ts:$ts, text:$t}')")
@@ -416,7 +416,7 @@ if [[ -n "${SLACK_BOT_TOKEN:-}" ]]; then
416416
# Post new message
417417
echo "Sending Slack notification to #${SLACK_CHANNEL}..."
418418
RESP=$(curl -sS -X POST https://slack.com/api/chat.postMessage \
419-
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
419+
-H "Authorization: Bearer $AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN" \
420420
-H "Content-type: application/json" \
421421
-d "$(jq -n --arg c "$CHANNEL_ID" --arg t "$SLACK_MESSAGE" '{channel:$c, text:$t}')")
422422
TS=$(echo "$RESP" | jq -r '.ts // empty')
@@ -433,5 +433,5 @@ if [[ -n "${SLACK_BOT_TOKEN:-}" ]]; then
433433
echo "⚠ Could not find Slack channel #$SLACK_CHANNEL"
434434
fi
435435
else
436-
echo "SLACK_BOT_TOKEN not set, skipping Slack notification"
436+
echo "AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN not set, skipping Slack notification"
437437
fi

docs/scripts/validate_api_ref_links.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,22 +211,22 @@ get_pr_context() {
211211
fi
212212
}
213213

214-
# Send a Slack message to #devrel-docs-updates
214+
# Send a Slack message to #docs-alerts
215215
# Args: $1 = message text
216216
send_slack_message() {
217217
local message=$1
218-
if [[ -z "${SLACK_BOT_TOKEN:-}" ]]; then
219-
echo "SLACK_BOT_TOKEN not set, skipping Slack notification"
218+
if [[ -z "${AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN:-}" ]]; then
219+
echo "AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN not set, skipping Slack notification"
220220
return 0
221221
fi
222222

223223
local data
224-
data=$(jq -n --arg channel "#devrel-docs-updates" --arg text "$message" \
224+
data=$(jq -n --arg channel "#docs-alerts" --arg text "$message" \
225225
'{channel: $channel, text: $text}')
226226

227227
local response
228228
if ! response=$(curl -s --fail-with-body -X POST https://slack.com/api/chat.postMessage \
229-
-H "Authorization: Bearer $SLACK_BOT_TOKEN" \
229+
-H "Authorization: Bearer $AZTEC_FOUNDATION_CI_SLACK_BOT_TOKEN" \
230230
-H "Content-type: application/json" \
231231
--data "$data"); then
232232
echo "Slack API request failed (curl error)" >&2
@@ -292,7 +292,7 @@ send_alert() {
292292
message+=$'\n'"*Action required:* Run \`yarn generate:aztec-nr-api\` and/or \`yarn generate:typescript-api\` to regenerate the API docs."
293293

294294
if send_slack_message "$message"; then
295-
echo "Slack notification sent to #devrel-docs-updates."
295+
echo "Slack notification sent to #docs-alerts."
296296
else
297297
echo "WARNING: Failed to send Slack notification." >&2
298298
fi

0 commit comments

Comments
 (0)