feat(workflow): restore repo variable gate with dedicated poller app#7780
Merged
Conversation
Bring back the CI_POLLER_HAS_PENDING variable gate so the cron is truly zero-cost when idle (no runner provisioned). Use a dedicated GitHub App (CI_POLLER_APP_CLIENT_ID) for variable access since neither GITHUB_TOKEN nor sentry-internal-app has the actions_variables:write permission. The app secret is stored in the production environment for branch protection. Flow: - ci-pending.yml: adds ci-pending label (sentry-internal-app) and sets CI_POLLER_HAS_PENDING=true (poller app) - ci-poller.yml: gated by if: vars.CI_POLLER_HAS_PENDING == "true", resets to "false" when all issues resolved (poller app)
d07e8df to
aede05e
Compare
- ci-poller.yml: split "disable poller" into two steps — GITHUB_TOKEN for gh issue list (read), poller token only for gh variable set (write). The poller app may only have actions_variables permission. - ci-pending.yml: reorder so label addition (critical) runs before poller token generation (non-critical). If the poller token step fails, the label is already applied.
- Poller token step moved after CI check step so a token failure cannot block CI status checking - Cleanup steps (remaining check + disable) use if: always() so CI_POLLER_HAS_PENDING does not get stuck on "true" if the CI check step fails - Poller token only generated when needed (count == 0)
…est-effort steps - ci-poller.yml: disable step checks steps.poller-token.outcome == success so it does not run (and fail) when token generation failed - ci-pending.yml: poller token + variable set steps use continue-on-error since they are best-effort optimizations that must not block the critical label addition
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c4f7d01. Configure here.
When workflow_dispatch bypasses the variable gate (variable is "false") and finds pending issues that CI has not finished yet, the variable must be set back to "true" so subsequent cron ticks continue checking. Previously only the count==0 path was handled (disable). Now both paths are covered: enable when issues remain, disable when resolved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Bring back the
CI_POLLER_HAS_PENDINGvariable gate so the cron is truly zero-cost when idle — no runner provisioned at all.Uses a dedicated GitHub App (
CI_POLLER_APP_CLIENT_ID) for variable writes since neitherGITHUB_TOKENnor sentry-internal-app has theactions_variables:writepermission. The app secret is in theproductionenvironment for branch protection.How it works
ci-pending.ymlissues: openedci-pendinglabel (sentry-internal-app) + sets variable totrue(poller app)ci-poller.ymlschedule: */5if: vars.CI_POLLER_HAS_PENDING == 'true'— skips when false (no runner). Checks CI, flips labels, sets variable tofalsewhen done.Cost
ifis false, no runner provisionedPre-requisites (already done)
CI_POLLER_HAS_PENDING=falseCI_POLLER_APP_CLIENT_IDCI_POLLER_APP_PRIVATE_KEY