Skip to content

feat(runner-policy): add scheduled caller for standards-sync-stuck-automerge-alert - #251

Merged
kyle-sexton merged 2 commits into
mainfrom
feat/210-alert-caller
Jul 22, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
feat/210-alert-caller

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: caller rollout for merged melodic-software/ci-workflows#213 (issue #210 closed)

Related

ci-workflows#210, ci-workflows#213, ci-workflows#223

Summary

Test plan

  • npm run test:runner-policy — 228/228 pass
  • npm run lint:runner-policy — Runner policy passed
  • actionlint .github/workflows/standards-sync-stuck-automerge-alert.yml — clean
  • zizmor .github/workflows/standards-sync-stuck-automerge-alert.yml — no findings
  • npx biome check components/runner-policy/policy.json — no fixes needed
  • Flip pinned SHA to ci-workflows#223's merge SHA once it merges, mark ready for review

🤖 Generated with Claude Code

https://claude.ai/code/session_01KYvF6bWGqemS9aYFfWJRiW

…tomerge-alert

standards owns the sync trigger point and already holds the App secrets
sync.yml uses, so it hosts the scheduled caller for the new stuck-automerge
watchdog reusable (melodic-software/ci-workflows#213) rather than medley.

Pinned SHA and runner-policy contract are provisional: they target the
reusable as it exists on merged #213, which authors its tracking issue with
the caller ambient GITHUB_TOKEN and therefore needs a caller-granted
issues:write. That combination cannot satisfy runner-policy's
write-caller-permissions invariant (identity-passthrough-only secret
mapping) against this reusable's kebab-case app-client-id/app-private-key
inputs, so this PR opens as a draft blocked on
melodic-software/ci-workflows#223, which moves the reusable's issue writes
onto a self-minted App token. The workflow file and policy entry are written
for the eventual post-#223 shape (no caller issues:write, no
allowedCallerPermissions waiver); only the pinned SHA needs to flip once
#223 merges.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYvF6bWGqemS9aYFfWJRiW
@claude

claude Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Warning

Automated review did not complete — this is an infrastructure failure, not a review verdict.

Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."

Re-running the job, or pushing a new commit, will retry the review.

… SHA

melodic-software/ci-workflows#223 merged (43bc8d0), moving the reusable's
tracking-issue writes onto a self-minted App token. Flip the caller pin and
its policy.json contract key to that SHA now that the blocker is resolved;
no other change needed (the caller was already written for this shape: no
issues:write, no allowedCallerPermissions waiver).

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KYvF6bWGqemS9aYFfWJRiW
@claude

claude Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@kyle-sexton
kyle-sexton marked this pull request as ready for review July 22, 2026 21:22
@claude

claude Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@kyle-sexton
kyle-sexton merged commit 6946f4c into main Jul 22, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the feat/210-alert-caller branch July 22, 2026 21:27
kyle-sexton added a commit to melodic-software/ci-workflows that referenced this pull request Jul 24, 2026
…to a cheap page fetch and a per-candidate merge-state probe with retry (#234)

Closes #226

## Summary

- Splits the stuck-automerge scan into two phases so the hourly cron
stops dying on GitHub's opaque server-side GraphQL error: phase 1 pages
open PRs selecting only `number`/`url`/`author`/`autoMergeRequest {
enabledAt }` (no `mergeStateStatus`), phase 2 probes `mergeStateStatus`
one PR at a time via `repository.pullRequest(number:)`, and only for
armed, past-threshold bot PRs.
- Wraps every GraphQL call in `graphqlWithRetry` — exponential backoff
(`GRAPHQL_RETRY_ATTEMPTS=4`, `GRAPHQL_RETRY_BASE_MS=1000`, both
step-env-tunable), rethrowing the last error on exhaustion so a
persistent failure still fails the run loudly. On a throw the
`stuck-count` output is never set, so the close-issue branch cannot fire
a false all-clear.
- Retains the existing manual-cursor pagination and `MAX_PAGES`
soundness guard unchanged; "stuck" semantics are preserved (the
`BLOCKED` check moved from the bulk page filter to the per-candidate
probe).
- No changes to the trigger surface, App-authored issue identity,
`uses:` SHA pins, or permissions blocks.

## Test plan

- `node --test .github/scripts/*.test.cjs` (CI's exact command): 257/257
pass, including 24 in `standards-sync-stuck-automerge-alert.test.cjs` —
new coverage asserts the page query never selects `mergeStateStatus`,
exactly one phase-2 probe per candidate (no bulk fan-out),
transient-error retry on both page fetch and probe, and persistent-error
loud failure with no false all-clear.
- `actionlint` on the changed workflow: clean.
- `biome check` (CI config/scope): clean.
- Post-merge follow-through: the phase-2 query shape is mock-validated
only — confirm ≥2 consecutive green scheduled runs against the real
fleet (the issue's remaining acceptance criterion).

## Related

- Refs melodic-software/standards#251 — deployment PR for the failing
hourly caller
- Refs #224 — comment-events opt-in context named by the issue
- Refs #223 — prior fix on the same workflow (App-authored issue
identity), deliberately untouched here

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5 <[email protected]>
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