Skip to content

fix(workflow): use release-bot token for cross-repo API calls#7843

Merged
BYK merged 3 commits intomainfrom
fix/ci-poller-repo-access
Apr 17, 2026
Merged

fix(workflow): use release-bot token for cross-repo API calls#7843
BYK merged 3 commits intomainfrom
fix/ci-poller-repo-access

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 17, 2026

Problem

The poller was failing silently on repos where sentry-internal-app is not installed (sentry-xbox, sentry-playstation, sentry-switch, service-registry, etc.), causing publish issues to be stranded in ci-pending indefinitely — even when CI had actually finished.

Failing run: https://github.com/getsentry/publish/actions/runs/24555234527/job/71789954013

The logs show the root cause:

Checking CI for getsentry/sentry-playstation@0.13.7-20260417 commit 90ac59d0 (issue #7840)...
commit_status={"message":"Not Found","documentation_url":"..."}error
(0 statuses) pending=1 unsuccessful=0 total=1

Two bugs

1. Missing repo access

sentry-internal-app isn't installed on all private getsentry repos. Switch cross-repo API calls (check-suites, commit status, check-runs) to the sentry-release-bot token — the same app used by publish.yml with owner: getsentry which has access to all org repos.

2. Error leak through --jq pipeline

gh api ... --jq '.state' 2>/dev/null || echo "error" silently passes the error JSON through as the value when the jq filter fails on a 404 response. Now we check the exit code explicitly via a gh_api_release helper that captures stdout+stderr and propagates failure.

Cost

No change — same API calls, different token. sentry-internal-app stays in charge of label changes on this repo (needed to trigger publish.yml).

Two bugs fixed:

1. sentry-internal-app is not installed on all getsentry repos, so
   the poller got 404s for sentry-xbox, sentry-playstation, sentry-switch,
   service-registry, etc. Use the sentry-release-bot token for the
   cross-repo calls (check-suites, status, check-runs) since it has
   access to all getsentry repos (same app used by publish.yml).

2. gh api failures were silently passing through as the error JSON
   string when using --jq + 2>/dev/null. This caused CI status checks
   to appear successful when the API call actually failed, stranding
   issues in ci-pending forever. Now we check exit code explicitly
   via a helper function.

Keeps sentry-internal-app for label changes on this repo (since those
events trigger publish.yml — GITHUB_TOKEN events are suppressed).
@BYK BYK requested a review from a team as a code owner April 17, 2026 09:38
Comment thread .github/workflows/ci-poller.yml
Replace gh_api_release ... || true with explicit if/then pattern so
the error handling is not silently swallowed. Failures are still
non-fatal (fall back to issue SHA) but the intent is clearer and the
helper warning messages propagate correctly.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 06103fd. Configure here.

Comment thread .github/workflows/ci-poller.yml Outdated
@BYK BYK merged commit 2fc5274 into main Apr 17, 2026
10 checks passed
@BYK BYK deleted the fix/ci-poller-repo-access branch April 17, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant