From 1547fa240dafd363edd07847e7ac66045ffce37b Mon Sep 17 00:00:00 2001 From: Danny Neira <16809145+dannyneira@users.noreply.github.com> Date: Thu, 9 Jul 2026 18:27:01 -0600 Subject: [PATCH 1/2] fix: capture PR URL before composing Slack notification message The previous SKILL.md snippet had the pr_url capture line commented out, so the agent would hit a NameError when composing the Slack message body. - Uncomment and activate the subprocess call to gh pr view --json url - Add subprocess to imports - Remove stale Grafana token reference from workflow comment Co-Authored-By: Oz --- .agents/skills/release_updates/SKILL.md | 9 ++++++--- .github/workflows/release-docs-update.yml | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.agents/skills/release_updates/SKILL.md b/.agents/skills/release_updates/SKILL.md index 7ed6c31c..5675aeee 100644 --- a/.agents/skills/release_updates/SKILL.md +++ b/.agents/skills/release_updates/SKILL.md @@ -174,10 +174,13 @@ python3 .agents/skills/release_updates/scripts/run_release_updates.py \ After the PR is created, post a notification to the `#oncall-client` Slack channel (`C06MT1NRBFV`): ```python -import json, os, sys, urllib.request +import json, os, subprocess, sys, urllib.request + +# Capture the URL of the PR you just created +pr_url = subprocess.check_output( + ['gh', 'pr', 'view', '--json', 'url', '--jq', '.url'], text=True +).strip() -# pr_url: obtain from the PR created in the previous step, e.g.: -# pr_url = subprocess.check_output(['gh', 'pr', 'view', '--json', 'url', '--jq', '.url'], text=True).strip() token = os.environ.get('DOCS_SLACK_BOT_TOKEN') channel = 'C06MT1NRBFV' # #oncall-client if not token: diff --git a/.github/workflows/release-docs-update.yml b/.github/workflows/release-docs-update.yml index 06f1013a..c3ebc1cc 100644 --- a/.github/workflows/release-docs-update.yml +++ b/.github/workflows/release-docs-update.yml @@ -106,9 +106,9 @@ jobs: PY # Installs the stable oz CLI and runs the release_updates skill in the - # release-docs Oz environment (K5KStCm5aYvhfBJb8cHol6), which has - # DOCS_AGENT_GRAFANA_TOKEN configured for on-call reviewer assignment. + # release-docs Oz environment (K5KStCm5aYvhfBJb8cHol6). # WARP_API_KEY is the Docs Agent's API key. + # DOCS_SLACK_BOT_TOKEN must be added to the environment for Slack notifications. - name: Install Oz CLI run: | curl -sL "https://app.warp.dev/download/cli?os=linux&package=deb&arch=x86_64" -o /tmp/oz.deb From 3b83c3aa80a0469ecd50c9d977e352309799b64a Mon Sep 17 00:00:00 2001 From: Danny Neira <16809145+dannyneira@users.noreply.github.com> Date: Fri, 10 Jul 2026 10:22:04 -0600 Subject: [PATCH 2/2] fix: skip Slack notification gracefully when no PR was created If the release run is a no-op (no docs changes), gh pr view exits non-zero and CalledProcessError would crash the snippet. Now we catch that and exit cleanly with a log message. Co-Authored-By: Oz --- .agents/skills/release_updates/SKILL.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.agents/skills/release_updates/SKILL.md b/.agents/skills/release_updates/SKILL.md index 5675aeee..1bddb9ff 100644 --- a/.agents/skills/release_updates/SKILL.md +++ b/.agents/skills/release_updates/SKILL.md @@ -176,10 +176,16 @@ After the PR is created, post a notification to the `#oncall-client` Slack chann ```python import json, os, subprocess, sys, urllib.request -# Capture the URL of the PR you just created -pr_url = subprocess.check_output( - ['gh', 'pr', 'view', '--json', 'url', '--jq', '.url'], text=True -).strip() +# Capture the URL of the PR you just created. +# If no PR exists (no-op run with no docs changes), skip silently. +try: + pr_url = subprocess.check_output( + ['gh', 'pr', 'view', '--json', 'url', '--jq', '.url'], + text=True, stderr=subprocess.DEVNULL + ).strip() +except subprocess.CalledProcessError: + print('No PR found — skipping Slack notification (no-op run)') + sys.exit(0) token = os.environ.get('DOCS_SLACK_BOT_TOKEN') channel = 'C06MT1NRBFV' # #oncall-client