Skip to content

pr-plan and pr-apply: progress lines, blocked and already-applied settles, and reports a viewer can read mid-run (#4007) - #4083

Merged
lex00 merged 1 commit into
mainfrom
feat/4007-pr-progress
Oct 18, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/4007-pr-progress

Conversation

@lex00

@lex00 lex00 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Closes #4007

A viewer can follow a pull request's apply while it runs: the job log shows each wave and component, the reports and the event stream are copied where a reader outside CI can fetch them (mid-run for the events), and the generated pipelines can turn this on. Components that did not run now settle as blocked or already-applied.

  • Log lines: pr-apply prints on stderr, with or without --events-json, one line as each wave starts (wave 1/2: net) and one as each component settles (net: applied, app: blocked by net, not run, net: already applied in an earlier attempt, failed, stopped at its own gate, waiting on a decision).
  • The stream is --events-json (run-event v1, from run events: emitters in the local runtime, run --components, fountain, and pr-plan/pr-apply #4041); --progress-json is not added, and the docs say so.
  • --report-url <file:// or s3://> on pr-plan and pr-apply copies pr-<stage>.json, change-set.json and pr-<stage>.events.jsonl to <url>/<pr>/<commit>/[<member>/] (<pr> is unknown when no pull request is found). The events file is named per stage, because a fast-forward merge runs plan and apply on one commit. With --events-json, the events file is uploaded again after every wave, component and run settle (one upload at a time; settles that arrive meanwhile go up together), so a viewer reading the URL sees each wave as it applies. A failed mid-run upload is one warning and the apply carries on; a final upload runs at the end. file:// writes a temp file and renames it; s3:// runs aws s3 cp - (the AWS CLI, as the aws lexicon's s3-sync does). chant passes and prints no credentials. The aws s3 call is in the egress catalogue.
  • Generator option: the PR loop options gain events: true and reportUrl, which add --events-json, --report-url and CHANT_RUN_EVENTS_DIR=.chant/pr/run-events to both jobs on GitHub, GitLab and Forgejo (the events directory sits inside the report artifact). chant build --pr-loop --events-json --report-url <url> sets them. The default output is unchanged.
  • New component-settle statuses, additive within run-event contract 1 from chant 0.124.29, for pr-apply and components fan-out:
    {"type":"component-settle","wave":2,"component":"app","status":"blocked","blockedBy":"net"}
    {"type":"component-settle","wave":1,"component":"net","status":"already-applied"}
    Neither has a component-start. A blocked settle follows the wave whose failure held it back; already-applied settles come after run-start, before the first wave, with the wave from the original plan. A reader that knows only ok/failed/gated/waiting still parses every line. blockedBy is optional.
  • Docs: "Pull request reports" in the read contract, "Follow an apply while it runs" in guide/pull-request-ci.mdx (covering CHANT_RUN_EVENTS_DIR for CI), and the components and build CLI pages.

Level-0 output changes

On the exceptions page and #2525: pr-apply prints the new stderr lines; with --events-json, pr-apply and fan-out emit blocked and already-applied settles; chant run events text adds by <dependency> to a blocked line; --report-url is new.

Acceptance

Checks

  • npx tsx scripts/typecheck.ts: no regressions (26 baselined)
  • npx tsx scripts/check-lexicons.ts: no untracked tier-1 failures
  • pr, fan-out, build, report URL, run-event, wave-loop golden, the three PR pipeline generators, read-contract, no-listener, no-egress, level-0 goldens: 246 passed with GITHUB_SHA, GITHUB_RUN_ID and CI set, after rebasing on main
  • Full unit project: only 5 s budget overruns in untouched git-heavy tests under load, passing with the budget off
  • lint-docs-sentences (no regressions), lint-prompts, check-docs-diataxis, ./scripts/build-docs.sh: pass
  • No real bucket was written; the real repository's chant/lifecycle was unchanged.

…ied settles, and --report-url (#4007)

pr-apply prints a line on stderr as each wave starts and as each component
settles. With --events-json, pr-apply and components fan-out settle a
component a failed or gated dependency held back as blocked, naming it in
blockedBy, and one an earlier attempt applied as already-applied; the
run-event schema gains both statuses and blockedBy within contract 1
(chant 0.124.29). --progress-json is unchanged.

pr-plan and pr-apply take --report-url <s3 or file URL>, which copies
pr-<stage>.json, change-set.json and pr-<stage>.events.jsonl to
<url>/<pr>/<commit>/[<member>/], the events again after each wave,
component and run settle, one upload in flight at a time. s3 goes through
the AWS CLI. The pull-request pipeline generators take events and
reportUrl (chant build --pr-loop --events-json --report-url), which add
the flags and CHANT_RUN_EVENTS_DIR to both jobs. (#4007)
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.

pr-plan and pr-apply: progress events per wave and component, and the report where a viewer can read it

1 participant