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 10 cloudflare commands that do not obey it:
- 10 commands make an external request, or possibly make one, and have no request plan.
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.
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. - 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:
- Each command calls the Cloudflare API or the public status page over HTTP.
- 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 |
|---|---|---|---|---|
cloudflare access policies |
no | yes | request plan | http: httpx2.Client @ cloudflare.client:CloudflareClient._request:312 |
cloudflare access status |
no | yes | request plan | http: httpx2.Client @ cloudflare.client:CloudflareClient._request:312 |
cloudflare access sync |
yes | yes | request plan | http: httpx2.Client @ cloudflare.client:CloudflareClient._request:312 |
cloudflare dns delete |
yes | yes | request plan | http: httpx2.Client @ cloudflare.client:CloudflareClient._request:312 |
cloudflare dns list |
no | yes | request plan | http: httpx2.Client @ cloudflare.client:CloudflareClient._request:312 |
cloudflare dns sync |
yes | yes | request plan | http: httpx2.Client @ cloudflare.client:CloudflareClient._request:312 |
cloudflare service-status |
no | yes | request plan | http: httpx2.HTTPTransport @ http.client:egress_transport:106 |
cloudflare status |
no | yes | request plan | http: httpx2.Client @ cloudflare.client:CloudflareClient._request:312 |
cloudflare tunnel routes |
no | yes | request plan | http: httpx2.Client @ cloudflare.client:CloudflareClient._request:312 |
cloudflare tunnel sync |
yes | yes | request plan | http: httpx2.Client @ cloudflare.client:CloudflareClient._request:312 |
Target Subsystem
FastMCP & IDE Integrations
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). - 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
Ten cloudflare commands make external HTTP requests without a dry-run request plan. This violates the dry-run rule (#412), which requires that a dry run makes no external request and returns the ordered requests the real run would make. Each command currently prints a generic line, fails with an unknown option, or echoes its arguments. None shows the requests.
Acceptance criteria
- Criterion 1: Each command in the table is removed from tests/fixtures/dry_run_gaps.json and the ratchet test passes.
Verification: Run the ratchet test from sub-issue 00. Confirm all 10 commands are absent from tests/fixtures/dry_run_gaps.json. - Criterion 2: For each request-plan command, devops --dry-run and devops --dry-run make no external request and print the ordered requests.
Verification: Run tests with the process runner, HTTP clients, and other clients patched to fail. Assert the output contains the planned requests and no connection is attempted. - Criterion 3: For each request-plan command with --format json or --json, the dry run returns the real result type marked as a dry run, with the planned requests.
Verification: Run the command with --dry-run --json. Assert the result type is the command's real result type, dry_run is True, and the planned requests are present. - Criterion 4: For each request-plan command, the plan holds the requests the real run makes, in the same order.
Verification: Run the real command against a fake runner or client that records each call. Compare the recorded calls with the plan, following the pattern of tests/test_roadmap_dry_runs.py. - Criterion 5: Echo-only previews of these commands are removed, with no shim.
Verification: Search the codebase for render_dry_run_result and@dry_run_commandreferences to the 10 commands. Confirm they are absent. - Criterion 6: The new tests start no process and open no socket.
Verification: Run the new tests under the conftest.py network and process guards. Confirm no edge reach is recorded. Record test time in the pull request. - Criterion 7: uv run devops ci passes.
Verification: Run uv run devops ci in the pull request branch. Confirm all checks pass.
Key questions
- What existing infrastructure supports building and rendering request plans?: PlannedRequest and render_request_plan in devops_cli.dry_run.requests, used by commands such as ci.py. [sources: src/devops_cli/commands/ci.py:54]
- What test pattern verifies that a dry run makes no request and lists the requests a run makes?: The pattern in tests/test_roadmap_dry_runs.py: patch the store, runner, process, and socket to fail on any call, then invoke the command with --dry-run and assert the output contains the planned requests. [sources: tests/test_roadmap_dry_runs.py]
- What is the dependency on 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 from sub-issue 00 must be delivered first. It provides the test that checks every command with the request-plan class has a dry run, and the class decorator that marks commands as having a request plan. (proposed)
Open questions
- What HTTP transport do nine of the ten cloudflare commands use for their external requests? (missing verified source)
- What HTTP transport does cloudflare service-status use for its external request? (missing verified source)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNew
- 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 adds new functionality to cloudflare commands for dry-run behavior.This change fixes a core rule violation and improves dry-run consistency across the project.The change makes dry-run behavior consistent and predictable for all cloudflare commands.The change requires implementing request plans for multiple cloudflare commands with some code refactoring.Both items work on dry-run implementations but target different command sets: cloudflare vs pr commands.dan-petty commentedon Oct 27, 2026
Refine cannot set this item to Ready at d594b55 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
chore(main): release 0.34.0 (#2933)