Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions openspec/changes/2260-uv-test-pipeline-serve-mcp-and/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,24 @@

## Decisions

- **Pass-through commands (uv run, pipeline) list the delegated argv, stdin, env, condition, and repeat as their plan.**: The proposed design in the issue confirms this. The plan uses the same argument builder as the real run, so it cannot drift. The CHANGELOG shows the same pattern for 15+ prior command groups.
- **Server commands (serve, mcp serve) list the bind and start requests, not client calls.**: A server makes requests only when a client calls it. The dry run lists what the server would bind and start. This matches the issue's note.
- **mcp tools gets the no-external-request class rather than a request plan.**: The issue table marks it as mark-only: it makes no external request and needs only the no-external-request class.
- **mcp export-schemas gets a local preview rather than a request plan.**: The issue table marks it as local preview: it changes local state, makes no external request, and has no --dry-run today.
- **Echo-only previews are removed with no shim.**: The issue states: Remove an echo-only preview when the command gets its new dry run, with no shim.
- **A pass-through command lists one request: the list that the real run passes to its process.** `uv run` and `pipeline` run a program that devops-cli does not control. The real run starts one process (`_run(["uv", "run", *ctx.args])`, `build_dagger_cmd(...)`). The plan holds that one request. What the program does inside is not a request of devops-cli. The plan does not guess it. `uv run` declares `--dry-run`. The resolver inserts `--dry-run` right after the command path, so the tokens after `--` reach the plan unchanged.
- **The uv commands build their argument list in one function each, and the plan applies `prepare_tool_cmd`.** The process runner adds `--preview-features malware-check,check-command` to every `uv` command. A plan without it would differ from the run.
- **`test sandbox` reuses `plan_docker_sandbox` and `declared_controls()`, as `docker sandbox` does.** Both commands use `WorkloadSandboxRunner`. The workspace check stays before the plan, so the tests of #1383 keep passing. `build_dry_run_details` has no caller after this, so it goes with the tests that call only it. The rootless user note that it printed does not appear in the plan of `docker sandbox` either.
- **`test run` keeps its git reads for `--changed`.** The targets are the input of the plan. They come from local `git diff` and `git status` calls, as the targets of `ci mutate --changed` do. No call leaves the machine. The existing tests of `--changed` already run on a real repository.
- **`test profile-memory` is `no-external-request`, with a local preview.** The built-in targets run in memory (`httpx2.ASGITransport`, `list_mcp_tools()`). A target `module:function` runs user code, which can make any request. A dry run therefore runs nothing. It prints the target, the iteration count, the limits and the path of the report that the run would write. It writes nothing.
- **`ci fail-to-pass` is `request-plan`, and its plan starts no git call.** The real run starts ten processes. The plan lists them with placeholders `<merge-base>`, `<tree>` and `<changed test files>`, and gives a condition to the steps that run only when the diff holds a changed test file. The pure argument builders live next to the code that runs them. The two git reads in `src/devops_cli/git/operations.py` get a builder each, and the behavior of those two functions does not change. The class sits on the callback, so `format fail-to-pass` and `lint fail-to-pass` leave the gap list too.
- **A server dry run lists the bind and the start.** `serve` and `mcp serve` start a server that makes no outbound request until a client calls it. A mark-only class would start a blocking server under `devops --dry-run`. The plan has two requests, bind and start, and reads its values from the same function as the real call (`uvicorn.run` options, `run_mcp_server` arguments). `mcp serve --transport sse` applies the same loopback check as the real run, through one shared function. `serve --service` does not load settings or read credentials in a dry run. The real run reports the configuration errors.
- **`mcp export-schemas` is a local preview, and `mcp tools` is mark-only.** The export writes files and makes no request. The preview counts the tools with the same listing and prints the directory. `mcp tools` only reads the registry.
- **The proxy tests use a stub app, not `serve`.** Three tests use `serve` as the example of a command with no class and no `--dry-run`. Every later child of #886 would break them the same way. A stub module in `tests/support/dry_run_stub.py` gives them a command that stays unclassified.
- **Tests sit in the file that already tests the behavior** (docs/TESTING.md, "a new test joins the file that already tests its behaviour"): `tests/commands/test_uv.py`, `tests/commands/test_load_and_pipeline.py`, `tests/commands/test_test_runner.py`, `tests/commands/test_workload_sandbox.py`, `tests/commands/test_memory_profiler.py`, `tests/ai/mcp/test_mcp.py`, `tests/server/test_server.py` and `tests/ci/test_fail_to_pass.py`.
- **The spec delta adds requirements to `command-dry-run-class`.** The base spec holds one requirement per command family (`argo-request-plans`, `docker-request-plans`). The new requirements follow that shape and repeat no existing name.

## Rejected alternatives

- **Keep echo-only previews alongside the new request plans.**: The issue states: Remove an echo-only preview when the command gets its new dry run, with no shim. The CHANGELOG shows prior deliveries removed echo-only previews in the same step.
- **Give pass-through commands a different design than a request plan.**: The proposed design in the issue answers: Yes. It lists the delegated argv, stdin, env, condition and repeat. It uses the same argument builder as the real run. Sources: CHANGELOG.md:1390, tests/test_roadmap_dry_runs.py.
- **Split the 14 commands into separate issues.**: The issue states: These groups each have fewer than 5 commands that need work, so they join here. The proposed design confirms: Fits in one pull request.
- **Keep the echo-only previews beside the new plans.** The issue says to remove them with no shim. The echo of `test load` prints invented metrics, and the echo of `pipeline` prints `SIMULATED_SUCCESS`.
- **Give `test profile-memory` a request plan.** The issue row says it sends an HTTP request. `src/devops_cli/telemetry/memory_profiler.py` shows the request goes to `httpx2.ASGITransport` in memory, and `socket` counts are 0 before and after a run. A plan would list a request that does not exist.
- **Run the git reads in the `ci fail-to-pass` dry run.** `tests/ci/test_fail_to_pass.py::test_fail_to_pass_dry_run_and_no_changed_tests` states that the dry run starts no git call. The plan with placeholders needs none.
- **Mark `serve` and `mcp serve` as `no-external-request` with no option.** `devops --dry-run serve` would then start the server and block.
- **Run a custom `profile-memory` target in the dry run.** The target is user code that can make a request.
- **Split the 14 commands into sub-issues.** The groups below each touch one or two source files and a few tests. They fit one pull request, as the refine step found.
- **Keep `serve` as the example in the proxy tests, and pick another gap command.** Each remaining gap command belongs to a sibling issue (#2258 and others), so each would break the tests again. A stub never does.
Loading
Loading