Skip to content

feat(argo): argo commands list their requests in a dry run and make none #2240

Description

@dan-petty

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 22 argo commands that do not obey it:

  • 20 commands make an external request, or possibly make one, and have no request plan.
  • 2 commands make no external request and need only the no-external-request class.

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-run if 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 ordered PlannedRequest items (argv, stdin and env with <placeholders>, plus condition and repeat). Build each PlannedRequest from the same argument builder that the real run uses, so that the plan cannot drift from the run. Print it with render_request_plan. Give the command the request-plan class.
  • Mark only: give the command the no-external-request class. devops --dry-run <command> then runs it normally.
  • Remove an echo-only preview (render_dry_run_result or @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:

  • The Argo CD commands mint a token over HTTP (k8s/credentials.py:mint_argocd_token) before they call Argo CD. A plan lists that request too.
  • argo cd gitops drift and argo gitops drift compare local manifests with git. They get the no-external-request class.
  • 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
argo cd apps bootstrap-gitops yes (echo only) yes request plan kubernetes .create_namespaced_custom_object() @ argo.crd:ArgoCRDService.apply_resource:209
argo cd apps list yes (echo only) yes request plan http: httpx2.Client @ commands.argo:cd_apps_list:211
argo cd apps status no yes request plan http: httpx2.Client @ commands.argo:cd_apps_status:293
argo cd apps sync no yes request plan http: httpx2.Client @ commands.argo:cd_apps_sync:264
argo cd fleet sync yes (echo only) yes request plan http: httpx2.Client @ argo.fleet:_execute_cluster_sync:59
argo cd gitops drift no no mark only -
argo cd gitops sync yes (echo only) yes request plan http: httpx2.Client @ argo.gitops:trigger_argocd_sync:368
argo cd gitops watch yes (echo only) yes request plan http: httpx2.Client @ argo.gitops:trigger_argocd_sync:368
argo fleet sync yes (echo only) yes request plan http: httpx2.Client @ argo.fleet:_execute_cluster_sync:59
argo gitops drift no no mark only -
argo gitops sync yes (echo only) yes request plan http: httpx2.Client @ argo.gitops:trigger_argocd_sync:368
argo gitops watch yes (echo only) yes request plan http: httpx2.Client @ argo.gitops:trigger_argocd_sync:368
argo rollouts abort yes (echo only) yes request plan kubernetes .patch_namespaced_custom_object() @ argo.crd:ArgoCRDService.patch_resource:175
argo rollouts analyze yes yes request plan kubernetes .patch_namespaced_custom_object() @ argo.crd:ArgoCRDService.patch_resource:175
argo rollouts list no yes request plan kubernetes-client: kubernetes.ApiClient @ k8s.service:KubernetesService.load_config:153
argo rollouts promote yes (echo only) yes request plan kubernetes .patch_namespaced_custom_object() @ argo.crd:ArgoCRDService.patch_resource:175
argo rollouts restart yes (echo only) yes request plan kubernetes .patch_namespaced_custom_object() @ argo.crd:ArgoCRDService.patch_resource:175
argo rollouts status no yes request plan kubernetes-client: kubernetes.ApiClient @ k8s.service:KubernetesService.load_config:153
argo sync no yes request plan http: httpx2.Client @ commands.argo:cd_apps_sync:264
argo workflows list no yes request plan kubernetes-client: kubernetes.ApiClient @ k8s.service:KubernetesService.load_config:153
argo workflows logs no yes request plan kubernetes-client: kubernetes.ApiClient @ k8s.service:KubernetesService.load_config:153
argo workflows submit no yes request plan kubernetes-client: kubernetes.ApiClient @ k8s.service:KubernetesService.load_config:153

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-run and devops --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 json or --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 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 ci passes.

Source: #886

Proposed design

Problem statement

Twenty-two argo commands do not obey the dry-run rule (#412). Some make an external request and show no request plan. Some make no external request but do not run under a dry run. A dry run must make no external request and show the requests a real run makes. This item adds request plans or the no-external-request class to those commands.

Acceptance criteria

  • Criterion 1: Each command in the table is out of tests/fixtures/dry_run_gaps.json.
    Verification: Run the dry-run ratchet test and observe a pass.
  • Criterion 2: Each request-plan command prints the ordered PlannedRequest items under a dry run.
    Verification: Run devops --dry-run and devops --dry-run and observe the plan.
  • Criterion 3: Each request-plan command makes no external request under a dry run.
    Verification: Run devops --dry-run and devops --dry-run with the process runner and HTTP clients patched to fail.
  • Criterion 4: Each request-plan command with --format json or --json returns its real result type marked as a dry run.
    Verification: Run the dry run and observe the result type and the planned requests.
  • Criterion 5: Each request-plan command plans the requests that its real run makes, in order.
    Verification: Run the real command against a recording fake and compare the calls with the plan.
  • Criterion 6: Each mark-only command runs normally under devops --dry-run .
    Verification: Run the command with the process runner and HTTP clients patched to fail.
  • Criterion 7: Echo-only previews of these commands are gone, with no shim.
    Verification: Search the changed files for render_dry_run_result and @dry_run_command and observe no match.
  • Criterion 8: The new tests start no process and open no socket.
    Verification: Run the new tests and observe no process or socket guard failure.
  • Criterion 9: The pull request records the test time.
    Verification: Read the pull request description and observe the recorded time.
  • Criterion 10: uv run devops ci passes.
    Verification: Run uv run devops ci and observe exit code 0.
  • Criterion 11: The plan for Argo CD commands lists the token request before the Argo CD request.
    Verification: Run the dry run and observe the mint_argocd_token request in the plan.

Key questions

  • Does this item need the dry-run class ratchet test first?: Yes. (proposed)
  • Does this item fit in one pull request?: Yes. (proposed)
  • Does this item wait on work outside this roadmap?: No. (proposed)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    on Oct 25, 2026
  2. dan-petty commented on Oct 25, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Type: type/feature. The candidate proposes a new feature to improve argo command dry-run behavior.
    • Priority: P1-High. This change affects the core dry-run functionality and must be completed for the project's integrity.
    • Value: High. Improves dry-run accuracy and consistency across all argo commands.
    • Effort: High. Requires detailed changes to multiple argo commands with complex request planning logic.
    • Possible duplicate: feat(pr): pr commands list their requests in a dry run and make none #2234, which may ask for the same change. The model names argo commands list their requests in a dry run and make none as the change that both ask for. The candidate and item 2234 both ask for argo commands to list their requests in a dry run and make none. A person closes one of the two if that is so.
  3. dan-petty commented on Oct 25, 2026

    @dan-petty
    OwnerAuthor

    Not a duplicate of #2234. Both are parts of #886: #2234 changes the pr commands, and this item changes the argo commands. The model's reason says that #2234 asks for the argo change, which is not true. The agent that split #886 filed both.

  4. dan-petty commented on Oct 27, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at d594b55 (see proposed design in issue body).

  5. added
    priority/p1-high
    status/ready
    effort/high
    value/high
    status/in-progress
    and removed
    status/ready
    on Oct 28, 2026
  6. added a commit that references this issue on Oct 31, 2026
    90f885a
  7. added
    status/in-review
    and removed
    status/in-progress
    on Oct 31, 2026
  8. removed
    status/in-review
    on Oct 31, 2026
  9. added a commit that references this issue on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/highpriority/p1-highsource/agenttype/featurevalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions