Skip to content

Request paths

What happens, step by step, for a proposal, an approval, a check and a link.

Applies to EngineCloud
View as Markdown
On this page
  1. A proposal
  2. An approval
  3. A check
  4. A link
  5. A map uploaded to Data

A proposal

  1. POST /v1/maps/{map}/proposals with the changes.
  2. The server applies them to the latest version and validates the result against the format: every changed case, and that every reference exists. What they would break answers 422 invalid_map, with errors[].
  3. It stores the proposal and its changes as rows; the approved version is untouched.
  4. The reviewers named on the proposal get an e-mail. E-mails wait in the server’s own outbox and go out through your SMTP server (CASES_SMTP_URL), retried with a growing wait; on AWS Lambda, the jobs function sends the ones that are due every minute.

An approval

  1. POST /v1/proposals/{id}/approve: the server checks the caller’s role.
  2. It locks the proposal’s row, so approvals of one proposal happen one at a time, and checks the role again inside that transaction.
  3. A proposal merges when it has the approvals the map asks for (required_approvals.count, 1 by default) from owners or approvers, and the approval of every required reviewer named on it. The author may approve their own proposal.
  4. Then one database transaction creates the new version (immutable), snapshots its cases and marks the proposal merged. A proposal made on an older version merges on its own when no case it touches changed since its base; otherwise the answer is 409 version_conflict, and it must be rebased. Two approvals racing for the same version number cannot create two versions: the number is unique per map, and the one that loses gets 409 version_conflict.
  5. A background job writes the new files to the connected repository as one commit (Cases: version 5 — Gift cards).
  6. An event map.version.created is published for other products (Agent picks up new scope, Git updates links).

A check

  1. POST /v1/maps/{map}/checks with the code side, or with caseIds alone (from commit trailers: the map is checked by itself, and an id it does not have is reported as unmapped).
  2. The server loads the approved version and compares (the same code as cases check, from @sypnia/cases/spec).
  3. It returns the findings and keeps the last result per map and version.
  1. GET /v1/maps/{map}/cases/{case}/links.
  2. The server calls Data, Telemetry, Git and Agent in parallel, as the caller, so you never see through Cases what you cannot see in the product. In Sypnia Cloud, Data is read through a service call to its control plane, with the id of the person the server verified, and the control plane checks that person’s role; Telemetry with the read token linked to the map. A server you run yourself presents the caller’s own token.
  3. Each call has a 2-second budget (CASES_LINK_BUDGET_MS); a product that does not answer in time is marked not_available and the rest is shown.

A map uploaded to Data

  1. npx @sypnia/cases map --upload --project <data ref> sends the map document to Sypnia Data’s control plane (PUT /v1/projects/{ref}/use-cases), which keeps it for the console’s «Use cases».
  2. When the Data project is linked to a Cases map, the control plane sends the same document on to POST /v1/maps/{map}/uploads, as a service call on behalf of the person who uploaded it.
  3. The Cases server turns it into a draft proposal of what the code owns (The map from code) and answers with the proposal; the control plane passes that answer back to the CLI. If Cases does not answer, the Data side is still saved.
  1. A proposal
  2. An approval
  3. A check
  4. A link
  5. A map uploaded to Data

    Search pages, sections and terms