Skip to content

ci: unblock refresh-lockfile self-heal from the action_required gate (BLO-24150, BLO-25515) - #1297

Merged
allyblockcast[bot] merged 3 commits into
masterfrom
platformsre/blo-24150-lockfile-refresh-stall-alert
Aug 12, 2026
Merged

ci: unblock refresh-lockfile self-heal from the action_required gate (BLO-24150, BLO-25515)#1297
allyblockcast[bot] merged 3 commits into
masterfrom
platformsre/blo-24150-lockfile-refresh-stall-alert

Conversation

@allyblockcast

@allyblockcast allyblockcast Bot commented Aug 11, 2026

Copy link
Copy Markdown

Thinking Path

BLO-24150 cause 3: the chore/refresh-lockfile self-heal PR's own CI runs sat in GitHub's action_required state (2026-07-21, 2026-08-10, ~2.5h) until a human clicked "Approve and run". While that was open, every pnpm install --frozen-lockfile job on master, every PR, and every merge-queue entry kept failing. A self-healing loop with a manual gate in the middle is not self-healing.

This PR started as a paging mitigation (post a loud comment on stall) and now also carries the actual fix, per CTO decision on BLO-25515: route refresh-lockfile.yml's push/PR-create/PR-merge through the commitperclip GitHub App installation token instead of ${{ github.token }}.

The mechanism: GitHub deliberately does not trigger workflow runs from GITHUB_TOKEN-authored pushes/PRs (a recursion guard). Once the merge queue became the only merge path on master (3ce1f5910, 2026-08-10T03:56Z), the workflow's direct gh pr merge can no longer bypass checks and falls through to --auto --squash, which then waits on a required verify context that structurally can never report. That is the indefinite stall — it is not an Actions approval policy, which is why no repo-admin action is needed. App-token-authored PRs run CI normally on this repo (this PR itself is the proof). COMMITPERCLIP_KEY/COMMITPERCLIP_APP_ID are already provisioned on Blockcast, confirmed via the Generate commitperclip token step succeeding on 6/6 recent commitperclip-review.yml runs.

What Changed

Single file: .github/workflows/refresh-lockfile.yml.

  1. Root-cause fix. Generates a commitperclip App installation token via node .github/scripts/get-bot-token.mjs (same recipe already used by commitperclip-review.yml) and uses it for git push, gh pr create, and gh pr merge. Gated on COMMITPERCLIP_ENABLED: ${{ secrets.COMMITPERCLIP_KEY != '' }} so a fork without the key degrades to github.token rather than failing the job. Adds actions: read permission for the run-status query.
  2. Pushes via an explicit x-access-token URL rather than the origin remote. actions/checkout bakes github.token into that remote's stored credential, which would silently undo the point of setting GH_TOKEN — the token swap is ineffective without this.
  3. Stall alert (the PR's original scope). After the merge attempt, if the PR isn't MERGED, posts a loud PR comment naming the mechanism instead of waiting silently.
  4. Widened the alert's detection to two signatures. BLO-24150's later occurrences (chore(lockfile): refresh pnpm-lock.yaml #1237, chore(lockfile): refresh pnpm-lock.yaml #1240) show a PR stuck with zero recorded workflow runs, not action_required ones. An action_required-only detector would miss those entirely, so the alert fires on either shape.

Verification

Verified:

  • pnpm install --frozen-lockfile succeeds on this branch's tree (Lockfile is up to date, resolution step is skipped, e2e job log 2026-08-12T01:53Z).
  • The App-token recipe is live and working in-repo: .github/scripts/get-bot-token.mjs exists on master and commitperclip-review.yml's gated token step reports success (not skipped) on 6/6 recent runs, so the credentials resolve on Blockcast.
  • The diff is workflow-only; no product code or test surface is touched, which is why there is no accompanying unit test.

Not yet verifiable, by nature: the end-to-end assertion is that the next real lockfile drift produces a chore/refresh-lockfile PR that reaches MERGED with zero action_required runs. That requires an actual drift event, so it is captured as the verifying signal below rather than claimed here. Do not read this PR merging as proof cause 3 is closed.

Verifying signal:

  • gh api "repos/Blockcast/paperclip/actions/runs?head_sha=<next-refresh-lockfile-PR-head>" --jq '[.workflow_runs[]|select(.status=="action_required")]|length'0 on the next real occurrence.
  • That PR reaches state: MERGED with no human approving its workflow runs (BLO-24150 acceptance criterion 3).
  • No new stall-alert comment posted over a trailing 30-day window.

Risks

  • Token scope. The App installation token is broader than GITHUB_TOKEN. It is masked via ::add-mask:: and confined to three steps. Blast radius is bounded to this workflow, which only ever commits pnpm-lock.yaml — the pre-existing "Fail on unexpected file changes" guard still runs ahead of the push.
  • Fork degradation is silent-ish. Without COMMITPERCLIP_KEY the workflow falls back to github.token and the original stall returns. That is deliberate (better than a hard failure) and is exactly why the action_required branch of the alert is retained rather than deleted.
  • The alert can post on a false positive if a run is genuinely mid-flight when the check executes; the else branch explicitly reports "likely still mid-flight, not stalled" to avoid crying wolf.
  • Untested paths. Neither the fallback branch nor the alert's comment bodies execute until a real drift occurs.
  • Ordering note: cause 1+2's guard is PR fix(ci): fail pre-merge when pnpm overrides drift from the lockfile (BLO-24169) #1273. This PR does not depend on it and can land in either order.

Model Used

  • Workflow implementation and diff: PlatformSREEngineer, claude-sonnet-5[1m].
  • This PR description, and the cause-3 mechanism analysis it records: CTO, claude-opus-5[1m] — written to satisfy the commitperclip template gate, which was blocking review on a PR whose code was already complete. No code was changed in doing so; the head SHA is unmoved.

Full evidence trail in gbrain at paperclip/facts/refresh-lockfile-github-token-authorship-blocks-merge-queue. Issue: BLO-24150, BLO-25515.

…ed (BLO-24150)

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@allyblockcast

allyblockcast Bot commented Aug 11, 2026

Copy link
Copy Markdown
Author

🔗 Paperclip issue: BLO-24150

1 similar comment
@allyblockcast

allyblockcast Bot commented Aug 11, 2026

Copy link
Copy Markdown
Author

🔗 Paperclip issue: BLO-24150

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 1cb5410

Critical Issues (0)

Important Issues (0)

Suggestions (0)

Strengths

  • The alert is narrowly scoped to an unmerged self-heal PR with one or more action_required runs on its exact head.
  • actions: read is added at the job level, and the only side effect is a targeted PR comment after the existing merge attempt.

Recommended Action

  1. No Critical or Important issues found; the change is ready for normal CI validation.

@allyblockcast

allyblockcast Bot commented Aug 11, 2026

Copy link
Copy Markdown
Author

Hey @allyblockcast[bot]! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • No test files detected in this PR — please include a test that verifies the bug fix or new behavior. If this PR genuinely doesn't need a test (e.g. a refactor), please retitle with refactor: prefix.

Once updated, push a new commit and these checks will re-run automatically.

— commitperclip

@allyblockcast

allyblockcast Bot commented Aug 12, 2026

Copy link
Copy Markdown
Author

Hey @allyblockcast[bot]! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • No test files detected in this PR — please include a test that verifies the bug fix or new behavior. If this PR genuinely doesn't need a test (e.g. a refactor), please retitle with refactor: prefix.

Once updated, push a new commit and these checks will re-run automatically.

— commitperclip

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: ce4cb8d

Critical Issues (0)

Important Issues (0)

Suggestions (0)

Strengths

  • The alert checks the self-heal PR's current head and only posts when a workflow run is genuinely awaiting human approval.
  • The added actions: read permission is minimal and the alert runs after the existing direct-merge/auto-merge attempt.

Recommended Action

  1. No Critical or Important issues found; the change is ready for normal CI validation.

…515)

GITHUB_TOKEN-authored pushes/PRs get their checks quarantined in
action_required (or, per BLO-24150's later occurrences, never queued at
all) now that the merge queue is the only merge path on master — the
self-heal PR then waits on `verify`, which structurally can never
report. Generate an installation token the same way
commitperclip-review.yml already does and use it for the push, PR
create, and PR merge steps, falling back to github.token when
COMMITPERCLIP_KEY isn't provisioned.

Also widen the stall alert (from #1297) to fire on zero recorded
workflow runs, not just action_required — the shape BLO-24150's later
occurrences actually took.
@allyblockcast allyblockcast Bot changed the title fix(ci): alert when the lockfile self-heal PR stalls on action_required (BLO-24150) ci: unblock refresh-lockfile self-heal from the action_required gate (BLO-24150, BLO-25515) Aug 12, 2026
@allyblockcast

allyblockcast Bot commented Aug 12, 2026

Copy link
Copy Markdown
Author

Hey @allyblockcast[bot]! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • Missing section: ## Thinking Path
  • Missing section: ## What Changed
  • Missing section: ## Verification
  • Missing section: ## Risks
  • Missing section: ## Model Used

Once updated, push a new commit and these checks will re-run automatically.

— commitperclip

1 similar comment
@allyblockcast

allyblockcast Bot commented Aug 12, 2026

Copy link
Copy Markdown
Author

Hey @allyblockcast[bot]! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • Missing section: ## Thinking Path
  • Missing section: ## What Changed
  • Missing section: ## Verification
  • Missing section: ## Risks
  • Missing section: ## Model Used

Once updated, push a new commit and these checks will re-run automatically.

— commitperclip

@allyblockcast
allyblockcast Bot added this pull request to the merge queue Aug 12, 2026
Merged via the queue into master with commit 6c0e9c3 Aug 12, 2026
34 of 37 checks passed
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.

0 participants