Skip to content
中文

Update a test plan

Code Mode: praxis.devops.testPlans.update

HTTP: PATCH /devops/v1/test-plans/{id}

Change a plan’s title, trigger, selector, gate, repeat count, timeout or enabled flag. Only the fields present in the body are changed, so a body naming one field leaves the rest exactly as they were. Changing a selector does not create a version — the plan is not a published artefact, and runs already started keep the selection they were created with. Read the plan first to know what you are leaving unchanged.

Signature

praxis.devops.testPlans.update(args:{path:{/** e.g. "tpl_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string};body:{/** The fields to change. */ plan:{/** New display title, shown wherever the plan is listed. e.g. "Presubmit — affected tests, retried" */ title?:string;trigger?:{/** Which event starts the plan, which decides the other fields present and when the plan runs without anyone asking. e.g. "pull_request" */ kind:"manual"|"pull_request"|"merge_group"|"promotion"|"schedule";/** The environment whose promotion starts the plan; present only for the promotion kind. e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ environment?:string;/** Five-field cron expression for the schedule kind, evaluated in the declared time zone. e.g. "0 2 * * *" */ cron?:string;/** IANA time zone the cron expression is read in, for example Asia/Shanghai; present only for the schedule kind. e.g. "Asia/Shanghai" */ timeZone?:string};selector?:{/** Keep only cases of these declared sizes; omit to allow every size. e.g. ["small","medium"] */ sizes?:Array<"small"|"medium"|"large">;/** Keep only cases carrying at least one of these purpose tags; omit to allow every purpose. e.g. ["regression"] */ purposes?:Array<"smoke"|"regression"|"acceptance"|"contract"|"performance">;/** Keep only cases from these test frameworks; omit to allow every framework. e.g. ["bun"] */ frameworks?:Array<"gherkin"|"bun"|"vitest"|"jest"|"pytest"|"go"|"playwright">;/** Keep only cases carrying every one of these tags; use it to narrow to an area without naming each case. e.g. ["devops"] */ allTags?:Array<string>;/** Keep only cases carrying at least one of these tags; use it to widen across neighbouring areas. e.g. ["api","cli"] */ anyTags?:Array<string>;/** Keep only cases in these repository packages; the package is the directory the file lives in. e.g. ["services/devops"] */ packages?:Array<string>;/** Run exactly these cases, named by id; use it to re-run a known failure without widening to its whole area. e.g. [] */ cases?:Array<string>;/** True keeps only cases declared safe to run against a production environment; use it for a plan whose environment is production. e.g. false */ prodSafeOnly?:boolean;/** Present to select only the cases a commit range can affect, the way a presubmit wants it. */ affected?:{/** The commit the change is measured against; the affected set is what changed between this commit and the run's own commit. e.g. "4f2a9c1d8e7b6a5c4d3e2f1a0b9c8d7e6f5a4b3c" */ base?:string}};/** New gate; a merge or promotion gate needs the plan's environment to be set, or the update is refused. e.g. "observation" */ gate?:"merge"|"promotion"|"observation"|"none";/** New number of times each selected case runs in one run. e.g. 2 */ repeat?:number;/** New number of minutes a run of this plan may take before it is timed out. e.g. 45 */ timeoutMinutes?:number;/** False stops the plan from being selected by its trigger without pausing it; true makes it eligible again. e.g. false */ enabled?:boolean};/** Comma-separated names of the plan fields this patch intends to change, for example title,enabled. e.g. "title,enabled" */ updateMask?:string}}):Promise<{/** Plan identifier used for later reads, updates and runs that name this plan. e.g. "tpl_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** The resource type of this answer, always test_plan; use it to tell answers apart when several kinds are handled together. */ object:"test_plan";/** RFC 3339 UTC time the plan was created. e.g. "2026-10-20T04:00:00Z" */ createTime:string;/** RFC 3339 UTC time the plan or its pause state last changed. e.g. "2026-11-02T11:30:00Z" */ updateTime:string;/** Canonical Console link for this plan, for putting a human-readable reference in a card or a message. e.g. "https://console.deepraxis.com/devops/tests/plans/tpl_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ viewerUrl:string;/** The project this plan belongs to, from the project list or create answer. e.g. "dvp_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ project:string;/** Short human-chosen name unique inside the project, used to refer to the plan in conversation and in a run's record. e.g. "presubmit" */ key:string;/** Display title of the plan, shown wherever the plan is listed. e.g. "Presubmit — affected tests" */ title:string;/** Which stage of delivery this plan belongs to, which decides when it is expected to run and how long it may take. e.g. "presubmit" */ stage:"dev"|"presubmit"|"postsubmit"|"nightly"|"production";trigger:{/** Which event starts the plan, which decides the other fields present and when the plan runs without anyone asking. e.g. "pull_request" */ kind:"manual"|"pull_request"|"merge_group"|"promotion"|"schedule";/** The environment whose promotion starts the plan; present only for the promotion kind. e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ environment?:string;/** Five-field cron expression for the schedule kind, evaluated in the declared time zone. e.g. "0 2 * * *" */ cron?:string;/** IANA time zone the cron expression is read in, for example Asia/Shanghai; present only for the schedule kind. e.g. "Asia/Shanghai" */ timeZone?:string};selector:{/** Keep only cases of these declared sizes; omit to allow every size. e.g. ["small","medium"] */ sizes?:Array<"small"|"medium"|"large">;/** Keep only cases carrying at least one of these purpose tags; omit to allow every purpose. e.g. ["regression"] */ purposes?:Array<"smoke"|"regression"|"acceptance"|"contract"|"performance">;/** Keep only cases from these test frameworks; omit to allow every framework. e.g. ["bun"] */ frameworks?:Array<"gherkin"|"bun"|"vitest"|"jest"|"pytest"|"go"|"playwright">;/** Keep only cases carrying every one of these tags; use it to narrow to an area without naming each case. e.g. ["devops"] */ allTags?:Array<string>;/** Keep only cases carrying at least one of these tags; use it to widen across neighbouring areas. e.g. ["api","cli"] */ anyTags?:Array<string>;/** Keep only cases in these repository packages; the package is the directory the file lives in. e.g. ["services/devops"] */ packages?:Array<string>;/** Run exactly these cases, named by id; use it to re-run a known failure without widening to its whole area. e.g. [] */ cases?:Array<string>;/** True keeps only cases declared safe to run against a production environment; use it for a plan whose environment is production. e.g. false */ prodSafeOnly?:boolean;/** Present to select only the cases a commit range can affect, the way a presubmit wants it. */ affected?:{/** The commit the change is measured against; the affected set is what changed between this commit and the run's own commit. e.g. "4f2a9c1d8e7b6a5c4d3e2f1a0b9c8d7e6f5a4b3c" */ base?:string}};/** The environment this plan runs against, required by a merge or promotion gate and absent for plans that need none. e.g. "dve_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ environment:string;/** Whether the plan's result blocks a stage. e.g. "merge" */ gate:"merge"|"promotion"|"observation"|"none";/** How many times each selected case runs in one run; more than one is how a flake is told apart from a real failure. e.g. 1 */ repeat:number;/** How many minutes a run of this plan may take before it is timed out and its result recorded as timed out. e.g. 30 */ timeoutMinutes:number;/** False stops this plan from being selected by its trigger; it is a quieter form of pause that carries no reason. e.g. true */ enabled:boolean;/** Present while the plan is paused, carrying who paused it, why and until when; absent when the plan is running normally. */ paused?:{/** Why the plan was paused, as given by whoever paused it. e.g. "nightly flake investigation" */ reason?:string;by?:{/** What sort of actor this is, which decides how the id should be read. e.g. "user" */ kind:"user"|"agent"|"system";/** Identifier of the actor within its kind, such as a user id for a person. e.g. "usr_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ id:string;/** Display name for the actor at the time, so a record reads the way it did when it was written; absent when none was known. e.g. "Sean" */ label?:string};/** RFC 3339 UTC time the plan resumes by itself; absent when it stays paused until resumed by hand. e.g. "2026-11-04T00:00:00Z" */ until?:string};/** RFC 3339 UTC time the plan's trigger next fires it; absent for plans without a schedule. e.g. "2026-11-04T02:00:00Z" */ nextRunTime?:string}>;

Parameters

NameInTypeRequiredDescription
idpathstringyesThe plan identifier returned by a plan list or create answer.

Request body

RequiredContent typesDescription
yesapplication/jsonA patch whose plan object holds only the fields to change, plus an optional update mask naming them.

Responses

StatusContent typesDescription
200application/jsonThe plan after the patch, with its update time advanced.
400application/jsonINVALID_PARAMS or INVALID_ARGUMENT means a field, query value or identifier violates the documented format or range — an unknown enum value, a pageSize outside 1..100, an unsupported filter or orderBy field, or an id with the wrong prefix. Correct the named input; nothing was read or written.
401application/jsonThe API key is missing or invalid; send a valid Praxis API key in the Authorization header before retrying.
403application/jsonThe credential carries no organization, or that organization cannot reach this project; use a key belonging to the project’s organization. No cross-organization read is possible.
404application/jsonPLAN_NOT_FOUND means no plan with that id exists in this organization; list the project’s plans and use an id from that answer.
500application/jsonINTERNAL means the service could not complete the request; retry once, and if it repeats report the request id. A read is safe to repeat; a write that failed this way should be re-read before it is sent again.