From 6910b197d019bde9624f434de6001baa39df2a47 Mon Sep 17 00:00:00 2001 From: autonomic-bot Date: Sun, 31 May 2026 14:00:02 +0000 Subject: [PATCH] fix(testme-on-pr): read cc-ci/testme context URL not first-status URL When multiple commit statuses exist (e.g. an Adversary probe + the real run), the first status in the array may not be the cc-ci run. Filter by context 'cc-ci/testme' to get the correct Drone build URL. --- .claude/skills/recipe-upgrade/testme-on-pr.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.claude/skills/recipe-upgrade/testme-on-pr.sh b/.claude/skills/recipe-upgrade/testme-on-pr.sh index dd60982..5c27980 100755 --- a/.claude/skills/recipe-upgrade/testme-on-pr.sh +++ b/.claude/skills/recipe-upgrade/testme-on-pr.sh @@ -42,8 +42,11 @@ while [ "$(date +%s)" -lt "$deadline" ]; do | python3 -c "import json,sys try: d=json.load(sys.stdin) except Exception: d={} +# Look for cc-ci/testme context first (most specific); fall back to first status URL sts=d.get('statuses') or [] -print(d.get('state','') or 'none', (sts[0].get('target_url') if sts else '') or '')" 2>/dev/null || echo "none ") +ctx_url=next((s.get('target_url','') for s in sts if s.get('context')=='cc-ci/testme'), '') +url=ctx_url or (sts[0].get('target_url','') if sts else '') +print(d.get('state','') or 'none', url or '')" 2>/dev/null || echo "none ") case "$state" in success) echo "VERDICT=GREEN"; echo "BUILD=${url}"; exit 0;; failure|error) echo "VERDICT=RED"; echo "BUILD=${url}"; exit 2;;