Skip to content

app/: the CI API's builds, against today's answers (sc-8900) - #62

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

ndbroadbent merged 2 commits into
mainfrom
laravel-api

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

Stacked on #59 (storage), which is on #54 (domain tables).

Endpoints, with today's request bodies, answers and error JSON ({"error": …, "description": …}, and a 422 invalid body for an unreadable or unknown field):

  • POST /api/v1/builds: numbering under a project lock, nonces for shards, environments, visualci.yml validation, warnings for a ci_mode the file can't loosen and for a build from another repository.
  • GET /api/v1/builds/{id}.
  • POST /api/v1/builds/{id}/snapshots:
    • validation;
    • the 409 for a name sent again with other content;
    • render reuse;
    • presigned upload URLs;
    • each snapshot's group_key from the build's grouping.
  • POST /api/v1/builds/{id}/finalize: shards, allow_empty and empty_reason.

ApiProject resolves the request's project from a project token, or from a personal token plus X-VisualCI-Project (members and admins).

Domain, ported:

  • per-build settings (visualci.yml over the project);
  • the lenient numbers;
  • environments;
  • blob records (register, confirm uploads, put, image info);
  • the credit ledger: add_credits and add_purchased_credits, for subdomains' billing.

The contract. tests/golden holds the 129 answers today's Loco request tests record (VISUALCI_JSON_SNAPSHOTS). tests/golden/mod.rs checks a response against one with the same placeholders. The API tests here match today's post-builds, post-snapshots and post-snapshots-invalid-kind.

Not yet:

  • processing on finalize, compare, groups, the snapshot list, downloads;
  • blocked, the credits notice, which lands with charging in the processing slice (it's null meanwhile).

Tests: all of cargo test passes, and clippy is clean.

@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

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

This PR vs base: nothing since #217, across 4 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
…keys whose deletes would scan (baselines.review_id and approved_by, builds.created_by_user_id, comments.user_id, comment_threads.resolved_by); credit_transactions.build_id and a gallery day key; snapshot registration as one conditional upsert (a race between two files is a 409 for one of them), resetting a carried row; limits on commits, parent commits, branch, name, nonce, content type and meta; every snapshot validated before any is written; today's 401 messages; the personal organization takes the next slug on a race; credits::usage, plans, allowance and spend
@ndbroadbent
ndbroadbent changed the base branch from laravel-ingest to main December 2, 2026 14:48
…nonces, environments, visualci.yml, warnings), GET /api/v1/builds/{id}, POST …/snapshots (validation, the 409 for other content, render reuse, presigned uploads, group keys), POST …/finalize (shards, allow_empty, empty_reason); today's error JSON; per-build settings, blob records and the credit ledger ported; tests against today's answers (tests/golden, recorded from the Loco server's request tests)
@ndbroadbent
ndbroadbent merged commit a3b357e into main Dec 2, 2026
11 checks passed
@ndbroadbent
ndbroadbent deleted the laravel-api branch December 2, 2026 15:16
ndbroadbent added a commit that referenced this pull request Dec 2, 2026
…keys whose deletes would scan (baselines.review_id and approved_by, builds.created_by_user_id, comments.user_id, comment_threads.resolved_by); credit_transactions.build_id and a gallery day key; snapshot registration as one conditional upsert (a race between two files is a 409 for one of them), resetting a carried row; limits on commits, parent commits, branch, name, nonce, content type and meta; every snapshot validated before any is written; today's 401 messages; the personal organization takes the next slug on a race; credits::usage, plans, allowance and spend
ndbroadbent added a commit that referenced this pull request Dec 2, 2026
…keys whose deletes would scan (baselines.review_id and approved_by, builds.created_by_user_id, comments.user_id, comment_threads.resolved_by); credit_transactions.build_id and a gallery day key; snapshot registration as one conditional upsert (a race between two files is a 409 for one of them), resetting a carried row; limits on commits, parent commits, branch, name, nonce, content type and meta; every snapshot validated before any is written; today's 401 messages; the personal organization takes the next slug on a race; credits::usage, plans, allowance and spend
ndbroadbent added a commit that referenced this pull request Dec 2, 2026
…keys whose deletes would scan (baselines.review_id and approved_by, builds.created_by_user_id, comments.user_id, comment_threads.resolved_by); credit_transactions.build_id and a gallery day key; snapshot registration as one conditional upsert (a race between two files is a 409 for one of them), resetting a carried row; limits on commits, parent commits, branch, name, nonce, content type and meta; every snapshot validated before any is written; today's 401 messages; the personal organization takes the next slug on a race; credits::usage, plans, allowance and spend
ndbroadbent added a commit that referenced this pull request Dec 2, 2026
…keys whose deletes would scan (baselines.review_id and approved_by, builds.created_by_user_id, comments.user_id, comment_threads.resolved_by); credit_transactions.build_id and a gallery day key; snapshot registration as one conditional upsert (a race between two files is a 409 for one of them), resetting a carried row; limits on commits, parent commits, branch, name, nonce, content type and meta; every snapshot validated before any is written; today's 401 messages; the personal organization takes the next slug on a race; credits::usage, plans, allowance and spend
ndbroadbent added a commit that referenced this pull request Dec 2, 2026
…71)

* app/: review fixes for #54 and #62 (sc-8900): indexes on the foreign keys whose deletes would scan (baselines.review_id and approved_by, builds.created_by_user_id, comments.user_id, comment_threads.resolved_by); credit_transactions.build_id and a gallery day key; snapshot registration as one conditional upsert (a race between two files is a 409 for one of them), resetting a carried row; limits on commits, parent commits, branch, name, nonce, content type and meta; every snapshot validated before any is written; today's 401 messages; the personal organization takes the next slug on a race; credits::usage, plans, allowance and spend

* app/: the renderer version comes from RENDERER_VERSION, as production's server image sets it; build output under app/target/ is no longer tracked
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