Repository navigation
Description
Part of #886. Depends on sub-issue 00 (the dry-run class ratchet test).
Problem or Motivation
The owner's dry-run rule (#412) says that a dry run makes no external request and returns the requests that the real run would make. The #886 inventory (2026-10-25, commit 1bb164b) found 11 devcontainer and install-tools commands that do not obey it:
- 6 commands make an external request, or possibly make one, and have no request plan.
- 2 commands change local state, make no external request and have no
--dry-run. - 3 commands make no external request and need only the
no-external-requestclass.
A command without a request plan either prints the generic Would run delegated command line under devops --dry-run, or fails with No such option: --dry-run, or prints an echo of its arguments. None of these shows the requests.
A command that makes no external request prints the generic Would run delegated command line under devops --dry-run and does not run, although running it is safe. Some of these commands have an echo-only --dry-run that prints only their arguments.
Proposed Solution & Architectural Design
For each command in the table:
- Request plan: add
--dry-runif it is missing. The dry run makes no external request, reads included. It returns the command's real result type, marked as a dry run, with the orderedPlannedRequestitems (argv, stdin and env with<placeholders>, plusconditionandrepeat). Build eachPlannedRequestfrom the same argument builder that the real run uses, so that the plan cannot drift from the run. Print it withrender_request_plan. Give the command therequest-planclass. - Local preview: add
--dry-run. The preview prints the change and writes nothing. Give the command theno-external-requestclass. - Mark only: give the command the
no-external-requestclass.devops --dry-run <command>then runs it normally. - Remove an echo-only preview (
render_dry_run_resultor@dry_run_command) when the command gets its new dry run, with no shim. - Remove the command's paths from
tests/fixtures/dry_run_gaps.json.
Notes from the inventory:
install-toolsanddevcontainer post-createdownload tools.devcontainer bootstrap-k8sstarts minikube.devcontainer initanddevcontainer updatewrite local files. They get a--dry-runpreview.- The table comes from a static walk of each callback and the functions that it calls. Check each row against the code before you change it. If a row is wrong, change the class to match the code, and record the evidence in the pull request.
| Command | --dry-run today |
External request | Work | Evidence |
|---|---|---|---|---|
devcontainer bootstrap-k8s |
yes (echo only) | yes | request plan | manual: minikube and devops k8s deploy |
devcontainer init |
no | no | local preview | - |
devcontainer list |
yes (echo only) | no | mark only | - |
devcontainer post-create |
yes (echo only) | yes | request plan | manual: installs tools (uv standalone installer download) |
devcontainer post-start |
yes (echo only) | yes | request plan | kubectl config @ commands.devcontainer:_apply_configured_k8s_context:629 |
devcontainer run-lifecycle |
yes (echo only) | yes | request plan | kubectl config @ commands.devcontainer:_apply_configured_k8s_context:629 |
devcontainer unlock-keyring |
no | yes | request plan | gh auth @ commands.devcontainer:_move_plaintext_gh_tokens:1403 |
devcontainer update |
no | no | local preview | - |
devcontainer validate |
yes (echo only) | no | mark only | - |
install-tools |
no | yes | request plan | http: httpx2.HTTPTransport @ http.client:egress_transport:106 |
install-tools status |
no | no | mark only | - |
Target Subsystem
Kubernetes & Minikube Automation
Existing Tool Considered
The work uses what the repository has: devops_cli.dry_run.requests.PlannedRequest and render_request_plan (#741), the dry-run class decorator and ratchet test from sub-issue 00, and the test guards in tests/conftest.py and tests/test_roadmap_dry_runs.py. No new dependency is necessary.
Acceptance Criteria
- Each command in the table is out of
tests/fixtures/dry_run_gaps.json, and the ratchet test passes. - For each request-plan command,
devops <command> --dry-runanddevops --dry-run <command>make no external request and print the ordered requests. Verified by tests with the process runner, the HTTP clients and the other clients patched to fail. - For each request-plan command with
--format jsonor--json, the dry run returns the real result type marked as a dry run, with the planned requests. Verified by tests. - For each request-plan command, the plan holds the requests that the real run makes, in the same order. Verified by a test that runs the real command against a fake runner or client that records each call, and compares the calls with the plan (the pattern of
tests/test_roadmap_dry_runs.py). - For each local-preview command,
--dry-runprints the change and writes nothing. Verified by tests with the writer patched to fail. - For each mark-only command,
devops --dry-run <command>runs the command normally. Verified by tests with the process runner and the HTTP clients patched to fail. - Echo-only previews of these commands are gone, with no shim.
- The new tests start no process and open no socket. The pull request records their time.
-
uv run devops cipasses.
Source: #886
Proposed design
Problem statement
The 11 devcontainer and install-tools commands do not obey the dry-run rule (#412). Six make external requests without listing them. Two change local state without a preview. Three run normally under --dry-run when they should be marked safe. Each command needs its correct dry-run behavior: a request plan, a local preview, or a no-external-request mark. The work adds the correct behavior to each command and removes the echo-only previews.
Acceptance criteria
- Criterion 1: Each command in the table is removed from
tests/fixtures/dry_run_gaps.json.
Verification: Run the ratchet test. It passes when no command in the table is listed. - Criterion 2: For each request-plan command,
devops --dry-runanddevops --dry-runmake no external request and print the ordered requests.
Verification: Run tests with the process runner, HTTP clients, and other clients patched to fail. The tests pass. - Criterion 3: For each request-plan command with
--format jsonor--json, the dry run returns the real result type marked as a dry run, with the planned requests.
Verification: Run tests that check the return type and thedry_runflag. The tests pass. - Criterion 4: For each request-plan command, the plan holds the requests that the real run makes, in the same order.
Verification: Run a test that runs the real command against a fake runner or client that records each call, and compares the calls with the plan. The test passes. - Criterion 5: For each local-preview command,
--dry-runprints the change and writes nothing.
Verification: Run tests with the writer patched to fail. The tests pass. - Criterion 6: For each mark-only command,
devops --dry-runruns the command normally.
Verification: Run tests with the process runner and HTTP clients patched to fail. The tests pass. - Criterion 7: Echo-only previews of these commands are removed, with no shim.
Verification: Search the affected command files forrender_dry_run_resultand@dry_run_command. No matches remain. - Criterion 8: The new tests start no process and open no socket.
Verification: The session-level guards intests/conftest.pyfail any test that starts a process or opens a socket without a fake. The tests pass. - Criterion 9:
uv run devops cipasses.
Verification: Runuv run devops ci. The exit code is 0.
Key questions
- What must be delivered before this issue?: Sub-issue 00 of feat(cli): commands with no dry-run preview: read-only ones run, mutators gain one #886, the dry-run class ratchet test, must be delivered first. It provides the class decorator and the ratchet test that this work uses. (proposed)
- What test pattern do the new tests follow?: The tests follow the pattern in
tests/test_roadmap_dry_runs.py: patch the process runner, HTTP clients, and other clients to fail, then verify the dry run makes no request and prints the plan withrender_request_plan. [sources: tests/test_roadmap_dry_runs.py] - What module provides
PlannedRequestandrender_request_plan?: The moduledevops_cli.dry_run.requestsprovides both. It is already imported bysrc/devops_cli/commands/ci.pyand bytests/test_roadmap_dry_runs.py. [sources: src/devops_cli/commands/ci.py:54, tests/test_roadmap_dry_runs.py] - What classes mark a command's dry-run behavior?: The
request-planclass marks a command that returns a request plan. Theno-external-requestclass marks a command that makes no external request and runs normally under--dry-run. Both come from sub-issue 00. [sources: src/devops_cli/commands/ci.py:54]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 25, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The candidate proposes new functionality for devcontainer and install-tools commands.This change affects core command behavior and follows a defined rule for dry runs.Improves usability and predictability of devcontainer and install-tools commands during dry runs.Requires adding request plans to multiple commands and updating related tests.Both items add dry-run support to commands, but the candidate focuses on devcontainer and install-tools while #2251 covers docker and sandbox commands.dan-petty commentedon Oct 27, 2026
Status set to Ready at 69636b6 (see proposed design in issue body).