Skip to content

app/: processing builds, with groups read from the build that holds them (sc-8900) - #73

Merged
ndbroadbent merged 4 commits into
mainfrom
laravel-process
Dec 2, 2026
Merged

ndbroadbent merged 4 commits into
mainfrom
laravel-process

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

Stacked on #71 (review fixes), on #62 (build API), on #59 (storage).

Processing a finalized build (domain::processing::process, run by the ProcessBuild job):

  • Confirm uploads, and queue renders, waiting until they're drawn.
  • Resolve each snapshot's baseline (domain::baselines): the anchor build, approvals since, merged pull requests. Every build is read through effective_snapshots.
  • Compare page by page (domain::compare). Page rows are stored only when the comparison found something, and texts are stored by hash (domain::pages).
  • Renders and diffs are cached by content.
  • Carry forward what wasn't sent (a subset build, or groups the client's check matched). A carried group whose baselines one earlier build holds exactly is recorded as read from that build, and no rows are written for it. Other carried snapshots get rows as before.
  • After comparison, every unchanged group of a CI build whose rows match their baselines is read from the holder, and the build's own rows are deleted. This runs before the build completes, so no other build can anchor on it first.
  • The visualci.yml item, the matching hint, conclude, and auto-approval baselines.
  • Charging happens before the sourcing deletes rows: one row per build charge step, with build_id, and a group check (or a whole manifest) counts as one credit. Then the out-of-credits stop: billing's CreditsRanOut listeners get a chance to reload first.

API: POST …/groups, POST …/compare (early comparison for local runs) and GET …/snapshots. Build creation first gives up on the project's abandoned builds (expire_abandoned, as today).

Job: ProcessBuild runs one at a time per build (advisory lock), in one transaction, debounced per build (3 s, at most 30 s), so a build's renders finishing together trigger one run.

Events for subdomains' listeners: BuildChanged, CreditsSpent, CreditsRanOut, BuildStoppedForCredits.

Tests (tests/processing.rs, against RustFS):

The whole suite passed ten times in a row. That's after fixing a flake: the blob store's HTTP client is now one per application from the container, because a process-wide client failed once a test's runtime ended (fixed in #59).

Not here: the read paths (build and snapshot detail, review, comments) and MCP come next.

@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #375 · 331 unchanged · no changes

This PR vs base: nothing since #248, across 8 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

ndbroadbent added a commit that referenced this pull request Dec 2, 2026
…hort transaction of its own and stops for credits outside any, so the organization's row isn't locked through a run and billing's listeners see committed data; a failed run keeps what it charged; the builds sweep every five minutes (expire abandoned builds, close idle local ones, run again builds processing with no progress for 10 minutes, fail them after 6 hours) with a heartbeat; GET /status with the data side's numbers
@ndbroadbent
ndbroadbent force-pushed the laravel-process branch 2 times, most recently from af8746d to a46b226 Compare December 2, 2026 15:35
@ndbroadbent
ndbroadbent changed the base branch from laravel-review-fixes to main December 2, 2026 17:10
…ince, merged pull requests), comparison page by page with page rows only for changes and texts by hash, renders and diffs cached by content, the visualci.yml item, the matching hint, carry-forward, groups read from the build that holds them (before writing, and after comparison for unchanged groups), conclude, charging per build with a group check as one credit, the out-of-credits stop, expire_abandoned; the ProcessBuild job (one run per build at a time, debounced); POST …/groups, …/compare and GET …/snapshots; BuildChanged, CreditsSpent, CreditsRanOut and BuildStoppedForCredits events for the other side's listeners
…hort transaction of its own and stops for credits outside any, so the organization's row isn't locked through a run and billing's listeners see committed data; a failed run keeps what it charged; the builds sweep every five minutes (expire abandoned builds, close idle local ones, run again builds processing with no progress for 10 minutes, fail them after 6 hours) with a heartbeat; GET /status with the data side's numbers
…olders joins the holder build on the project), with a test
@ndbroadbent
ndbroadbent merged commit 343611b into main Dec 2, 2026
11 checks passed
@ndbroadbent
ndbroadbent deleted the laravel-process branch December 2, 2026 20:39
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