Retrieve the merge gate's test plan at a commit
Code Mode: praxis.devops.projects.retrieveTestPlan
HTTP: GET /devops/v1/projects/{project}/test-plan
Ask what the merge gate would require at one commit before running anything: the packages the base…commit diff affects, each package’s input hash at that commit’s own tree, and whether evidence already answers it. The answer also carries cases: every feature scenario of the affected packages at the gate’s sizes, each with required (whether this diff can affect it, chosen by the files the scenario was recorded running), the reason, the deps hash it is judged at and its own evidence. A merge needs evidence only for the required cases; run praxis devops test <package> --record-impact to record coverage and results. Read a package as passed when a recorded run covered every case the package has at the gate’s sizes and they passed, failed when the newest evidence at its input hash failed, and missing when no run has a row for that (package, input hash). Use it before running tests — run praxis devops test <package> for each missing or failed package on a clean, pushed commit and the run files the evidence itself — or to explain a gate verdict, because it is the same required set and the same (package, input hash) lookup the gate itself decides on. The call is read-only: it starts no run, runs no case and writes nothing. The commit must already be pushed, since the hashes are recomputed from the tree GitHub holds; a commit whose tree cannot be read answers COMMIT_NOT_FOUND instead of an empty plan. A selection of nothing means every changed path belongs to no test package, which is a pass and not a failure.
签名
praxis.devops.projects.retrieveTestPlan(args:{path:{/** e.g. "dvp_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ project:string};query:{commit:string;base?:string;/** e.g. "summary" */ view?:"full"|"summary"}}):Promise<{/** The commit the plan was computed at, echoed back so a caller can prove it asked about the commit it meant to (a branch that moved between reading HEAD and calli e.g. "6f1c0b2a9d4e7f30581c6a0e5b8d3a4729c1e0fa" */ commit:string;/** The commit id the diff was measured from, resolved from the base argument or the project's default branch, so the answer names the exact range it judged. e.g. "1b2c3d4e5f60718293a4b5c6d7e8f9012345678a" */ base:string;/** What the changed paths selected: packages when the diff reaches named packages, whole-catalog when a root path widens the change to every package with a catalog e.g. "packages" */ selection:"packages"|"whole-catalog"|"nothing"|"failed";/** The Google sizes a gate run covers (the same set the cloud pull-request run asks for). e.g. ["small","medium"] */ sizes:Array<string>;/** One entry per required package, sorted by directory. */ packages:Array<{/** Repository-relative directory of the package, as the workspace index names it (for example services/devops); this is also the unit evidence is filed under. e.g. "services/devops" */ package:string;/** The input hash of the package at the commit's tree, computed by DevOps from the tree itself (the package directory, its workspace dependencies, and the root fil e.g. "3e5789222d8f78b726a42364530172a7be50c0c5599c5f84098c0100494b34c3" */ inputHash:string;/** What evidence exists for this (package, input hash): passed when the newest recorded run covered every case of the package at the gate's sizes and they passed, e.g. "missing" */ evidence:"passed"|"failed"|"missing"|"not_applicable";/** Present only when evidence is not_applicable: why it does not apply. e.g. "no test cases in this package" */ reason?:string;/** The run the answering evidence row came from, for looking up what ran and how; absent when evidence is missing, because then no row answered. e.g. "trn_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ run?:string}>;/** Every feature scenario of the affected packages at the gate's sizes, sorted by package and title, each with whether this diff requires it and what evidence answ */ cases:Array<{/** The case id as the catalog holds it; the unit evidence is filed under. e.g. "tc_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ case:string;/** Repository-relative directory of the package the scenario lives in. e.g. "services/devops" */ package:string;/** The scenario title, to name a failed or missing case to a person. e.g. "A merge needs evidence for the cases its diff affects" */ title:string;/** Whether this diff requires evidence for the case. e.g. true */ required:boolean;/** Why the case is or is not required, chosen by coverage: no-impact when no run has recorded what the case executes and the diff touches its package, deps-changed e.g. "deps-changed" */ reason:"no-impact"|"deps-changed"|"always-affected"|"unaffected";/** The hash the case is judged at, computed by DevOps from the commit's tree over the case's dependency set (recorded files, its feature file and its package's ste e.g. "3e5789222d8f78b726a42364530172a7be50c0c5599c5f84098c0100494b34c3" */ depsHash:string;/** What the newest recorded result says at this deps hash: passed, failed, or missing when no run has recorded the case there. e.g. "missing" */ evidence:"passed"|"failed"|"missing";/** The run the answering result came from; absent when evidence is missing. e.g. "trn_01JQ8Z3M9K4V7B2N6C5X0YTRHW" */ run?:string}>;/** Present only for view summary: one row per package that has cases, counting its cases. */ caseCounts?:Array<{/** The package directory these counts are for. e.g. "services/devops" */ package:string;/** Cases this diff requires evidence for; the merge asks for nothing else. e.g. 3 */ required:number;/** Cases this diff cannot affect, which need no evidence. e.g. 240 */ unaffected:number;/** Required cases that already have a passing row at their deps hash. e.g. 2 */ evidenced:number;/** Required cases with no evidence row at their deps hash. e.g. 1 */ missing:number;/** Required cases whose newest evidence at their deps hash failed. e.g. 0 */ failed:number}>;/** The changed paths the ownership rule could not place, present only when selection is failed. e.g. ["mystery/file.txt"] */ failedPaths?:Array<string>}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| project | path | string | 是 | Identifies the project whose data you are reading, from the project list or create answer. |
| commit | query | string | 是 | The commit to plan for, by commit id. It must be readable as a tree, so an unpushed local commit is refused; the input hashes are computed from that tree by DevOps and never taken from a caller or a runner. |
| base | query | string | 否 | What the diff is measured against: a commit id or a branch name. Defaults to the project’s default branch. A base that is neither a branch of the project’s repository nor a readable commit is refused as COMMIT_NOT_FOUND, so a typo cannot silently plan against the whole repository. |
| view | query | “full” | “summary” | 否 | How much of the plan to return: full lists every feature scenario of the affected packages, summary returns per package only the counts (caseCounts) and lists only the cases this diff requires. A change that touches no tested code (a README) answers tens of kilobytes in the full view, because every case is listed as unaffected; ask for the summary first and use the full view only to explain one case. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The plan at that commit: the selection, the packages with their input hashes, and what evidence says about each one. |
| 400 | application/json | INVALID_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. |
| 401 | application/json | The API key is missing or invalid; send a valid Praxis API key in the Authorization header before retrying. |
| 403 | application/json | The 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. |
| 404 | application/json | PROJECT_NOT_FOUND means the project does not exist; COMMIT_NOT_FOUND means the commit’s tree or the base could not be read (an unpushed commit, an unknown base, or a repository this project is not bound to), so no plan can be named for it. Nothing was run or recorded either way. |
| 500 | application/json | INTERNAL 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. |