Skip to content

feat(pr-pipeline): accept a scheduled pr-unblock dispatcher run in check-trusted-trigger - #9129

Merged
kyle-sexton merged 2 commits into
mainfrom
feat/dispatcher-schedule-trigger
Oct 22, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
feat/dispatcher-schedule-trigger

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Refs: #8447 (the dispatcher schedule trigger and the stale-doc sweep follow after azure-iac#72 deploys)

Summary

check-trusted-trigger now trusts a pr-unblock run dispatched by a pr-unblock-dispatch.yml run that a schedule started, as the owner decided on #8447 ("Decision recorded", 2026-10-22). This is the gate half; the broker half is melodic-software/azure-iac#72.

Fix

  • check-trusted-trigger.mjs: DISPATCHER_EVENTS adds schedule, and only a workflow_dispatch dispatcher needs a listed human actor. A scheduled run's actor is whoever last edited the cron, so, as for push and for the reconciler's scheduled runs, it is not checked. The other dispatcher checks are unchanged: the dispatcher-workflow path, the default branch, a head that is an ancestor of the tip, no tag named like the branch, a listed human on any re-run attempt, the ten-minute window and the dispatched-runs record.
  • check-trusted-trigger.test.mjs: a scheduled dispatcher run on the default branch proceeds (with an unlisted actor); a scheduled run on another branch, or from another workflow path, stops with untrusted-actor. The old case refusing every scheduled dispatcher is replaced.
  • README: the dispatcher event rule.

pr-unblock-dispatch.yml gains no schedule trigger here: the dispatched lanes would get no broker token until melodic-software/azure-iac#72 is deployed. No file in the broker pin list changed, so no broker pin PR is needed.

Verification

node --test .github/actions/check-trusted-trigger/check-trusted-trigger.test.mjs: before the fix 305 tests, 304 pass, 1 fail (dispatcher: a scheduled dispatcher run on the default branch proceeds, stopped untrusted-actor); after it 305 pass, 0 fail.

Related

  • melodic-software/azure-iac#72 (broker)
  • ADR 0071

🤖 Generated with Claude Code

…eck-trusted-trigger

A dispatcher run started by schedule now vouches for the pr-unblock run it
dispatched, under the checks every dispatcher run already passes: the
dispatcher workflow path, the default branch, a head that is an ancestor of
the tip, and no tag named like the branch. As for push, the actor is not
checked; a workflow_dispatch dispatcher still needs a listed human.

Refs: #8447

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

PR body contract — issue linkage

This PR body does not yet satisfy the issue-linkage contract:

  • Missing a native closing keyword (Closes/Fixes/Resolves #N). If this PR references an issue it must not close, put "Refs: #N" (or "Relates to: #N") on its own line. If it relates to no GitHub issue at all, state "No linked issue" (or "No related issue:") in the body instead.

Edit the body and this comment updates itself on the next run.

@kyle-sexton
kyle-sexton marked this pull request as ready for review October 22, 2026 17:47
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T17:48:38.385627Z 1fdbfad Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 1fdbfad117297680e7d7b52e03a7ede5ee50b17b: 0 finding(s), 0 as inline comments.

No security findings.

The PR adds schedule to the dispatcher events check-trusted-trigger accepts. I read the diff and verifyDispatcher, and found no new way for an untrusted party to start a trusted dispatcher.

  • Schedule is a trusted source. A scheduled run executes only the default branch's workflow file, and only someone with write access can change that file. A push dispatcher already relies on the same property. A schedule run can't be started by a fork, a PR branch or an issue comment.
  • Every other check still applies to a scheduled dispatcher:
    • It must be the named dispatcher workflow, pinned to the default branch ref in path.
    • Its head_branch must be the default branch.
    • Its head_sha must be an ancestor of the branch tip.
    • A re-run attempt above 1 needs a listed human as triggering_actor.
    • Its own record artifact must list this run's id.
    • This run's created_at must fall inside the 10-minute window.
  • Actor check is unchanged for the other events. The new condition is event !== "workflow_dispatch" || isListedHuman(actor). Because DISPATCHER_EVENTS gates it, pull_request and other events are still rejected, and workflow_dispatch still needs a listed human. The tests cover a schedule run on another branch and from another workflow, and pull_request is still rejected.
  • Residual risk: a schedule run's actor is whoever last edited the cron, and it is deliberately not checked. That is the same trade-off already accepted for push, and editing the cron needs write access to the default branch.

Manifest items: none, since the diff touches no plugin manifest. The instruction-exception register was not needed because the diff removes no standing instruction.

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 1fdbfad117297680e7d7b52e03a7ede5ee50b17b: 0 finding(s), 0 as inline comments.

Code review: no findings

I read the whole diff (3 files), the PR context and the surrounding code in check-trusted-trigger.mjs. I did not run the tests; the "305 pass" figure in the PR body is author-claimed and unverified by me.

The change is correct.

  • At check-trusted-trigger.mjs:453-456, schedule joins DISPATCHER_EVENTS, and only workflow_dispatch still needs a listed human actor.
  • Every other dispatcher check is untouched. Those are the dispatcher-workflow path, the default branch, the head ancestry, the re-run attempt's triggering_actor, the ten-minute window and the dispatched-runs record.
  • The same trust model for scheduled runs already exists in RECONCILER_EVENTS (line 50) and at line 621.
  • Tests cover the new proceed case with an unlisted actor. They also cover refusal on another branch and from another workflow path, and the existing pull_request refusal remains.
  • The README rule matches the code.

Closing issue. The PR uses Refs: #8447, so no issue section was supplied and there are no acceptance criteria to check. Per the lane rules that means nothing to report here.

Manifests and rules. The diff changes no plugin manifest, and no .claude/rules/ file's globs match the changed files.

Note, not counted as a finding.

  • Earlier gate-behavior changes to check-trusted-trigger have docs/conventions/pr-pipeline/CHANGELOG.md entries, for example lines 128, 395 and 436.
  • This PR adds none.
  • The change is inert until pr-unblock-dispatch.yml gains a schedule trigger. The follow-up that adds that trigger is the natural place for the entry, so I did not flag it.
  • The reworded comment above verifyDispatcher (lines 394-395) leaves one line longer than its neighbors; this is cosmetic.

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