Skip to content

redline: take forge's dispatch from the default branch - #108

Merged
askalf merged 2 commits into
mainfrom
redline/caller-dispatch
Sep 28, 2026
Merged

askalf merged 2 commits into
mainfrom
redline/caller-dispatch

Conversation

@askalf

@askalf askalf commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Same change as askalf/ci#5. redline.yml takes the workflow_dispatch trigger from askalf/ci#4, and its pin moves to c70746c; the trigger and the pin must move together.

Forge then dispatches Redline on the default branch for a head the pull_request run cannot vouch for: a PR that changes CI definitions, a verdict forge refused, or a re-read after a description edit. That run executes the default branch's workflow files, not the PR's. Forge finds it by the title Redline review askalf/<repo>#<pr> @ <head>. Nothing is dispatched until the forge side (askalf/platform#1531) is deployed with the repo listed. Fork PRs are unchanged.

actionlint is clean. pin.mjs still bumps only the two pin lines.

redline.yml gains workflow_dispatch (pr, head, reread) and pins askalf/ci
c70746c, the commit with redline-review.yml's dispatch mode. The trigger
and the pin move together: new inputs passed to an older pin are an
invalid-input error.

Forge dispatches this on the default branch for a head the pull_request run
cannot vouch for: a PR that changes CI, a verdict forge refused, a re-read
after a description edit. It finds the run by its title. A dispatch is
queued, never cancelled.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Deploying amnesia-site with  Cloudflare Pages  Cloudflare Pages

Latest commit: 62fcec6
Status: ✅  Deploy successful!
Preview URL: https://52305927.amnesia-site.pages.dev
Branch Preview URL: https://redline-caller-dispatch.amnesia-site.pages.dev

View logs

@github-actions github-actions Bot added github_actions Pull requests that update GitHub Actions code size/S 10-49 hand-written lines labels Sep 28, 2026
@askalf
askalf enabled auto-merge (squash) September 28, 2026 11:09
A concurrency group holds one pending run, and a newer run cancels it. So one
group per PR let a second dispatch cancel a first that was still waiting,
leaving forge a run with no verdict. Each dispatch is now keyed on its head
and re-read flag.

@sprayberry-redline sprayberry-redline left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approve at 62fcec6: the dispatch trigger and the pin move together, and both event paths still reach the called workflow with the inputs it expects.

On pull_request the inputs context is empty. So pr and head reach redline-review.yml at c70746c as '' and reread as false. The callee's if: inputs.pr != '' || (...) keeps the same-repo, non-draft gate it had before. The run name falls back to the PR title, which is also the default for that event. On workflow_dispatch the caller's job-level if lets the run through. The callee then refuses it before any checkout unless it is on the default branch, the PR is open, not a draft, with its head in this repo, and at the given full sha. The pinned c70746ceb1b3c4beaa76741f6eaba8516ec4799c is the current tip of askalf/ci main, and it declares the three pr/head/reread inputs, so the callee's "ref is on main" step accepts it.

The second commit keys each dispatch's concurrency group on head and mode (redline-workflow_dispatch-<pr>-<sha>-<reread>). That fixes the case the first head left open: a later dispatch for a different head, or a re-read, would have replaced a first dispatch that was still pending in the shared per-PR group. pull_request runs keep one group per PR with cancel-in-progress. Inputs only reach run-name and the group key. They are never interpolated into a shell step: the callee passes them through env.

Required checks are green at 62fcec6.

@askalf
askalf merged commit 5c06f56 into main Sep 28, 2026
14 checks passed
@askalf
askalf deleted the redline/caller-dispatch branch September 28, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code size/S 10-49 hand-written lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants