Devops API
(待译)
Praxis DevOps turns a repository into a controlled delivery line: test catalogs discovered from the code, test plans that decide which cases a stage must run, runs that execute them, and releases and feature flags that carry the result to an environment. Its vocabulary follows Google’s published test and release conventions — test sizes small/medium/large, ISTQB purpose tags, AIP-158 list paging — so that experience applies. Differences: a test case is identified by a fingerprint of its own path and title, so renaming a title moves the history with it instead of creating a new case; a quarantined case still runs and still records its failure, it is only excluded from the pass/fail verdict; and list reads answer a page cursor, never a total count. Releases, promotions and flags extend the same line: a release is an immutable fingerprinted snapshot, a promotion carries one into a single environment under that environment’s gates, and a flag’s per-environment configuration sits apart from its lifecycle, so what code serves and what a person decided are never one value. Start with the project’s test catalog to learn which suites and cases exist at a commit. Workspaces and units extend the same line to where the work is done: a workspace is one row of configuration per stage (development, integration, release), and a unit is a single machine created from one. This follows GitHub Codespaces — a unit is what a codespace is, and a stage prebuild is what a codespace prebuild configuration is — so that experience applies. Differences: every unit belongs to a change, so opening a change opens its unit and merging or abandoning the change stops it, while a workspace is only the configuration a unit was created from; no git credential ever enters a unit, so work reaches the remote through devops.units.push rather than a git push run on the machine; and commands run on the machine through devops.units.exec for callers that hold no reach of their own, while file reads and writes by the id that devops.units.get reports at status.sandbox.instance still go straight to the sandbox instance interface. Test evidence is how a later stage knows a commit was tested without running the tests again — one run, reused everywhere. A run’s result for one package is filed under the package’s input hash, which DevOps computes itself from the commit’s tree (a runner never supplies it), so the pull request’s merge gate, the merge commit and a release that reach the same tree all read the same row instead of queueing a new run. A row is written only when the run covered every case the package has at the gate’s sizes (small today): a run of a few test files or one feature leaves the package incomplete and writes no evidence for it. Evidence comes from a run DevOps executes (devops.projects.testRuns.create) or from a report uploaded with purpose evidence for a clean, pushed commit (devops.projects.testReports.create), which is what the praxis CLI’s praxis devops test <package> does by itself when it finishes. Ask devops.projects.retrieveTestPlan at a commit which packages the gate requires there and whether each is passed, failed or missing.
- Abandon a change —
POST /devops/v1/changes/{id}:abandon - Get a change workspace’s read-only git credential —
POST /devops/v1/changes/{id}:gitCredential - Mark the last slice —
POST /devops/v1/changes/{id}:markLastSlice - Open a change’s pull request —
POST /devops/v1/changes/{id}:openPullRequest - Retrieve a change —
GET /devops/v1/changes/{id} - Open a new slice —
POST /devops/v1/projects/{project}/changes/{change}/slices - Finish a GitHub connection —
POST /devops/v1/connections:complete - Start a GitHub connection —
POST /devops/v1/connections - List connections —
GET /devops/v1/connections - List a connection’s repositories —
GET /devops/v1/connections/{id}/repositories - Retrieve a connection —
GET /devops/v1/connections/{id} - List environment checkpoints —
GET /devops/v1/environments/{id}/checkpoints - Roll an environment back —
POST /devops/v1/environments/{id}:rollback - Update an environment —
PATCH /devops/v1/environments/{id} - Archive a flag —
POST /devops/v1/flags/{id}:archive - Conclude a flag —
POST /devops/v1/flags/{id}:conclude - Update a flag’s environment —
PATCH /devops/v1/flags/{id}/environments/{environment} - Retrieve a flag —
GET /devops/v1/flags/{id} - Update a flag —
PATCH /devops/v1/flags/{id} - Create a progressive rollout —
POST /devops/v1/progressive-rollouts - Pause a progressive rollout —
POST /devops/v1/progressive-rollouts/{id}:pause - Resume a progressive rollout —
POST /devops/v1/progressive-rollouts/{id}:resume - Retrieve a progressive rollout —
GET /devops/v1/progressive-rollouts/{id} - Roll back a progressive rollout —
POST /devops/v1/progressive-rollouts/{id}:rollback - Create a change —
POST /devops/v1/projects/{project}/changes - List changes —
GET /devops/v1/projects/{project}/changes - List a project’s cleanup ledger —
GET /devops/v1/projects/{project}/cleanups - Create a project —
POST /devops/v1/projects - Create a project’s default branch —
POST /devops/v1/projects/{id}/default-branch:initialize - List environments —
GET /devops/v1/projects/{project}/environments - Delete a target’s OpenTofu state —
DELETE /devops/v1/projects/{project}/environments/{environment}/targets/{target}/state - Read a target’s OpenTofu state —
GET /devops/v1/projects/{project}/environments/{environment}/targets/{target}/state - Write a target’s OpenTofu state —
POST /devops/v1/projects/{project}/environments/{environment}/targets/{target}/state - Unlock a target’s OpenTofu state —
DELETE /devops/v1/projects/{project}/environments/{environment}/targets/{target}/state/lock - Lock a target’s OpenTofu state —
POST /devops/v1/projects/{project}/environments/{environment}/targets/{target}/state/lock - Create a flag —
POST /devops/v1/projects/{project}/flags - List flags —
GET /devops/v1/projects/{project}/flags - Report a project’s flag code references —
POST /devops/v1/projects/{project}/flags/code-refs - List projects —
GET /devops/v1/projects - List promotions —
GET /devops/v1/projects/{project}/promotions - List a project’s pull requests —
GET /devops/v1/projects/{project}/pull-requests - Create a release —
POST /devops/v1/projects/{project}/releases - List releases —
GET /devops/v1/projects/{project}/releases - Retrieve a project —
GET /devops/v1/projects/{id} - Read a commit’s test catalog —
GET /devops/v1/projects/{project}/test-catalog - Retrieve the merge gate’s test plan at a commit —
GET /devops/v1/projects/{project}/test-plan - Create a segment —
POST /devops/v1/projects/{project}/segments - List segments —
GET /devops/v1/projects/{project}/segments - List targets —
GET /devops/v1/projects/{project}/targets - Refresh the target catalog —
POST /devops/v1/projects/{project}/targets:refresh - List test cases —
GET /devops/v1/projects/{project}/test-cases - Create a test plan —
POST /devops/v1/projects/{project}/test-plans - List test plans —
GET /devops/v1/projects/{project}/test-plans - Upload an external test report —
POST /devops/v1/projects/{project}/test-reports - Create a test run —
POST /devops/v1/projects/{project}/test-runs - List test runs —
GET /devops/v1/projects/{project}/test-runs - List test suites —
GET /devops/v1/projects/{project}/test-suites - Open a unit for a change —
POST /devops/v1/projects/{project}/units - List a project’s units —
GET /devops/v1/projects/{project}/units - Update a project —
PATCH /devops/v1/projects/{id} - List a project’s stage workspaces —
GET /devops/v1/projects/{project}/workspaces - Retrieve a stage workspace —
GET /devops/v1/projects/{project}/workspaces/{stage} - Update a stage workspace —
PATCH /devops/v1/projects/{project}/workspaces/{stage} - Approve or reject a promotion —
POST /devops/v1/promotions/{id}:approve - Cancel a promotion —
POST /devops/v1/promotions/{id}:cancel - Get the checkout credential of a running promotion —
POST /devops/v1/promotions/{id}:checkoutCredential - Conclude an observation —
POST /devops/v1/promotions/{id}:conclude - Create a promotion —
POST /devops/v1/promotions - Retrieve a promotion —
GET /devops/v1/promotions/{id} - Retry a promotion —
POST /devops/v1/promotions/{id}:retry - List a promotion’s rollouts —
GET /devops/v1/promotions/{promotion}/rollouts - Close a pull request without merging it —
POST /devops/v1/pull-requests/{id}:close - Merge a pull request through its gate —
POST /devops/v1/pull-requests/{id}:merge - Record a review verdict on a pull request —
POST /devops/v1/pull-requests/{id}:recordVerdict - Decide a pull request’s merge gate again —
POST /devops/v1/pull-requests/{id}:rerunGate - Retrieve a pull request —
GET /devops/v1/pull-requests/{id} - Review a pull request on our own Git —
POST /devops/v1/pull-requests/{id}/reviews - Abandon a release —
POST /devops/v1/releases/{id}:abandon - Retrieve a release —
GET /devops/v1/releases/{id} - Retrieve a rollout —
GET /devops/v1/rollouts/{id} - Update a segment —
PATCH /devops/v1/segments/{id} - Retrieve a test case —
GET /devops/v1/test-cases/{id} - Delete a test plan —
DELETE /devops/v1/test-plans/{id} - Pause a test plan —
POST /devops/v1/test-plans/{id}:pause - Resume a test plan —
POST /devops/v1/test-plans/{id}:resume - Retrieve a test plan —
GET /devops/v1/test-plans/{id} - Update a test plan —
PATCH /devops/v1/test-plans/{id} - Cancel a test run —
POST /devops/v1/test-runs/{id}:cancel - List a run’s executions —
GET /devops/v1/test-runs/{run}/executions - Retrieve one case’s execution in a run —
GET /devops/v1/test-runs/{run}/executions/{case} - Retrieve a test run —
GET /devops/v1/test-runs/{id} - Retry the failed cases of a run —
POST /devops/v1/test-runs/{id}:retryFailed - Retrieve a test suite —
GET /devops/v1/test-suites/{id} - Connect to a unit’s terminal —
POST /devops/v1/units/{id}:connect - Delete a unit —
DELETE /devops/v1/units/{id} - Run a command inside a unit —
POST /devops/v1/units/{id}:exec - Fetch a unit’s branch —
POST /devops/v1/units/{id}:fetch - Push a unit’s branch —
POST /devops/v1/units/{id}:push - Retrieve a unit —
GET /devops/v1/units/{id} - Start a unit —
POST /devops/v1/units/{id}:start - Stop a unit —
POST /devops/v1/units/{id}:stop - List a unit’s transitions —
GET /devops/v1/units/{id}/transitions