Skip to content

Replace the settings

PATCH
/v1/settings
curl --request PATCH \
--url https://beta-api.plune.ai/v1/settings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "statusMapping": { "junit": { "error": "broken", "skipped": "skipped" } }, "trustedDiscoverySources": [ "junit" ], "bugs": { "enabled": true, "close": { "rule": "after_n", "n": 3 } } }'

Replace, not merge: a key left out is one the owner removed. Every target of a status mapping must be one of the five statuses. subStatuses is the exception: it is the owner’s, written by PUT /v1/settings/sub-statuses/{status}, and kept as stored whatever is sent here. The read, the replace and the audit entry are one step under the project’s lock, so two saves queue. If-Match (the ETag of GET /v1/settings or of the last save) is optional: sent, and the document has changed since, nothing is written and the answer is 409 - read again and repeat the change; left out (or *), the last save wins, as before.

Media type application/json

Everything a project owner can configure. Three keys today; the shape makes room for the next without another table.

object
statusMapping

Per source, what each raw status means here. The source key is any string — a team on a runner nobody wrote defaults for can still say what its statuses mean.

object
key
additional properties
object
key
additional properties
string
Allowed values: passed failed broken blocked skipped
trustedDiscoverySources

Sources whose discovered tests become cases WITHOUT passing through the review queue. The permission is granted to the source, not to each test: a discovered test already exists in your repository, so approving it one page at a time is a formality that costs ceil(N/200) decisions. Listing a source here answers all of them at once, and every case it creates carries trusted-source as the reason in the audit log.

Array<string>
executionToggles

The six switches of how a manual run is walked (#1253), each decided by the server when a result is written or a case opened. Absent is all off, and redirectAfterResult the next case. failOnStepFail: a failed or blocked step fails the case (ADR 0056).

object
fastPass

A passed or skipped mark asks for no details: the answer to the mark says skipDetails.

boolean
autoPass

Every step of THIS case marked passed makes the case passed.

boolean
failOnStepFail

A failed or blocked step makes the case failed.

boolean
autoAssignee

The first to open (or mark) a case nobody holds in the run becomes its executor; a held case is never rewritten.

boolean
assigneeResultLock

Only the assignee may mark or change the mark of a case that has one; anybody else gets 409 assignee_locked.

boolean
redirectAfterResult

Where the answer to a mark sends the person.

string
Allowed values: next same none
bugs

The Bugs section (#1066, ADR 0057), written by the project owner alone (403 for a member). Off until enabled is true. Turning it off while the project has live bugs is a 409 with code: "bugs_exist" and their number in bugs (a bug in the Bin does not count); a document that leaves the key out is the section off.

object
enabled

Default false.

boolean
close

How a bug is closed, read by the lifecycle step (#1067): by hand, or after n green runs in a row.

object
rule

Default manual.

string
Allowed values: manual after_n
n

Default 3.

integer
>= 1 <= 5
environment

Only the runs on this environment count.

string
>= 1 characters <= 64 characters
reviewPolicy

The six switches of the proposal queue’s review policy (#1276), each decided by the server and written by the project owner alone (403 for a member). Absent keys are the defaults, which leave the queue as it was. autoMerge needs approvalsRequired of at least 1, and mandatory needs enabled; both are 400 otherwise.

object
enabled

Default true. Off, the other five are not looked at.

boolean
mandatory

Default false. Every case reaches the project through the queue: a trusted source is ignored, and trusting one is refused with 409 review is mandatory….

boolean
allowSelfMerge

Default true. Off, the person who put an item in the queue cannot approve it (409).

boolean
autoMerge

Default false. An item with all its approvals is approved by itself.

boolean
approvalsRequired

Default 0. Approvals of the item’s current revision an approval needs; fewer is a 409 naming the count.

integer
<= 10
defaultReviewerId

Asked to review every new item. Must be a member who can write (400 otherwise); one who has since lost the right is skipped and named on the item (defaultReviewerSkipped).

string
nullable
subStatuses

The project’s own sub-statuses per status (#1231), the built-ins not among them. Read here; written by PUT /v1/settings/sub-statuses/{status} alone — PATCH /v1/settings keeps what is stored whatever it is sent.

object
passed
Array<string>
<= 10 items
failed
Array<string>
<= 10 items
broken
Array<string>
<= 10 items
blocked
Array<string>
<= 10 items
skipped
Array<string>
<= 10 items
Example
{
"statusMapping": {
"junit": {
"error": "broken",
"skipped": "skipped"
}
},
"trustedDiscoverySources": [
"junit"
],
"bugs": {
"enabled": true,
"close": {
"rule": "after_n",
"n": 3
}
}
}

The settings as stored

Media type application/json

Everything a project owner can configure. Three keys today; the shape makes room for the next without another table.

object
statusMapping

Per source, what each raw status means here. The source key is any string — a team on a runner nobody wrote defaults for can still say what its statuses mean.

object
key
additional properties
object
key
additional properties
string
Allowed values: passed failed broken blocked skipped
trustedDiscoverySources

Sources whose discovered tests become cases WITHOUT passing through the review queue. The permission is granted to the source, not to each test: a discovered test already exists in your repository, so approving it one page at a time is a formality that costs ceil(N/200) decisions. Listing a source here answers all of them at once, and every case it creates carries trusted-source as the reason in the audit log.

Array<string>
executionToggles

The six switches of how a manual run is walked (#1253), each decided by the server when a result is written or a case opened. Absent is all off, and redirectAfterResult the next case. failOnStepFail: a failed or blocked step fails the case (ADR 0056).

object
fastPass

A passed or skipped mark asks for no details: the answer to the mark says skipDetails.

boolean
autoPass

Every step of THIS case marked passed makes the case passed.

boolean
failOnStepFail

A failed or blocked step makes the case failed.

boolean
autoAssignee

The first to open (or mark) a case nobody holds in the run becomes its executor; a held case is never rewritten.

boolean
assigneeResultLock

Only the assignee may mark or change the mark of a case that has one; anybody else gets 409 assignee_locked.

boolean
redirectAfterResult

Where the answer to a mark sends the person.

string
Allowed values: next same none
bugs

The Bugs section (#1066, ADR 0057), written by the project owner alone (403 for a member). Off until enabled is true. Turning it off while the project has live bugs is a 409 with code: "bugs_exist" and their number in bugs (a bug in the Bin does not count); a document that leaves the key out is the section off.

object
enabled

Default false.

boolean
close

How a bug is closed, read by the lifecycle step (#1067): by hand, or after n green runs in a row.

object
rule

Default manual.

string
Allowed values: manual after_n
n

Default 3.

integer
>= 1 <= 5
environment

Only the runs on this environment count.

string
>= 1 characters <= 64 characters
reviewPolicy

The six switches of the proposal queue’s review policy (#1276), each decided by the server and written by the project owner alone (403 for a member). Absent keys are the defaults, which leave the queue as it was. autoMerge needs approvalsRequired of at least 1, and mandatory needs enabled; both are 400 otherwise.

object
enabled

Default true. Off, the other five are not looked at.

boolean
mandatory

Default false. Every case reaches the project through the queue: a trusted source is ignored, and trusting one is refused with 409 review is mandatory….

boolean
allowSelfMerge

Default true. Off, the person who put an item in the queue cannot approve it (409).

boolean
autoMerge

Default false. An item with all its approvals is approved by itself.

boolean
approvalsRequired

Default 0. Approvals of the item’s current revision an approval needs; fewer is a 409 naming the count.

integer
<= 10
defaultReviewerId

Asked to review every new item. Must be a member who can write (400 otherwise); one who has since lost the right is skipped and named on the item (defaultReviewerSkipped).

string
nullable
subStatuses

The project’s own sub-statuses per status (#1231), the built-ins not among them. Read here; written by PUT /v1/settings/sub-statuses/{status} alone — PATCH /v1/settings keeps what is stored whatever it is sent.

object
passed
Array<string>
<= 10 items
failed
Array<string>
<= 10 items
broken
Array<string>
<= 10 items
blocked
Array<string>
<= 10 items
skipped
Array<string>
<= 10 items
Example
{
"statusMapping": {
"junit": {
"error": "broken",
"skipped": "skipped"
}
},
"trustedDiscoverySources": [
"junit"
],
"bugs": {
"enabled": true,
"close": {
"rule": "after_n",
"n": 3
}
}
}
ETag
string

The version just stored, to send as If-Match with the next save

A target status that does not exist; the message names the five

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

A member (or a reader) changed the review policy or the Bugs section, which are the owner’s

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

If-Match was sent and the settings have changed since; or review is mandatory and a source was trusted; or (#1066) the Bugs section was turned off while the project has live bugs - then the body also carries code: "bugs_exist" and bugs, how many. Nothing was written

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over