Repository navigation
Description
Problem
devops k8s image-pins --dry-run does not print the git fetch of a source of another repository. SourceTrees records the fetch commands of a dry run (_fetch in src/devops_cli/k8s/app_sources.py), and collect_image_pins puts them in ImagePins.planned. k8s_image_pins in src/devops_cli/commands/k8s/image_pins.py never reads planned. The dry run prints each chart command, because run_subprocess prints each command that it plans. ARCHITECTURE.md, section 7.1, says that a dry run prints the requests that a real run sends.
Evidence
- A tree with one path Application whose
repoURLishttps://github.com/example/productatmain, and one chart Application:uv run devops k8s image-pins --k8s-dir <tree>/k8s --dry-runprintsWould run command: helm template ...and no line withfetch. The run was onmainat57f0116e3with the change of feat(k8s): render an OCI chart in image-pins #7368. git grep -n planned -- src/devops_cli/commands/k8s/image_pins.pygives no line.deploy-stackprints its fetches fromtrees.planned(src/devops_cli/commands/k8s/stack_lifecycle.py:1767).
Acceptance criteria
- The dry run of
devops k8s image-pinsprints each fetch command that a run starts for a source of another repository. - A dry run still makes no request and starts no program.
Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches for dry-run printing of planned subprocess and git fetch commands returned only unrelated MDN pages. The need is a small change inside the project's own command: print ImagePins.planned, so no external tool covers it.
Lacks:
- Dry run never reads
ImagePins.planned, so no fetch line prints - Each fetch of a source of another repository stays hidden
- No shared helper prints planned commands outside
run_subprocess
Proposed design
Problem statement
devops k8s image-pins --dry-run prints no git fetch line for a source of another repository. SourceTrees records the fetch commands and collect_image_pins puts them in ImagePins.planned, but the command never reads that field. ARCHITECTURE.md section 7.1 says that a dry run prints each request that a real run sends. A person cannot see which repositories a real run fetches.
Acceptance criteria
Requirement: The dry run prints each planned fetch
The dry run of devops k8s image-pins SHALL print each git fetch command that a real run starts for a source of another repository.
Scenario: One source of another repository
- WHEN The test runs
devops k8s image-pins --k8s-dir <tree>/k8s --dry-runon a tree whose one Application nameshttps://github.com/example/productatmain. - THEN The output holds one line that names
git,fetchandhttps://github.com/example/product.
Requirement: The dry run starts no fetch and no render
A dry run SHALL start no fetch, no render and no registry read, and send no request.
Scenario: No external command runs
- WHEN The test doubles
run_subprocessindevops_cli.k8s.app_sourcesanddevops_cli.k8s.image_pins, and runs the dry run on the same tree. - THEN The double records no call whose arguments hold
fetch,helmorkustomize, and the output still holds the planned fetch line.
Requirement: No fetch line without another repository
The dry run SHALL print no fetch line when each source of the tree is the origin.
Scenario: A tree with no source of another repository
- WHEN The test runs the dry run on a tree whose Applications name only the origin.
- THEN The output holds no line with
fetch.
Existing Tool Considered
The alternatives check in the issue body gives the verdict none and names no tool, so no open tool or library covers this need. The issue body holds the check, its searches and its reason; this proposal adds no tool and restates no part of the check. The change prints ImagePins.planned in the project's own command. Written cost to build it instead: about 3,000 tokens to build, about 1,000 tokens to keep and fix, and about 20 minutes elapsed, for one print loop and one message key.
Key questions
- Where does the dry run print the planned fetch commands?: In
k8s_image_pins, frompins.planned, before the dry-run info line. The library returns the commands and the command prints them, asdeploy-stackprintstrees.planned. (best practice) [sources: src/devops_cli/commands/k8s/image_pins.py, src/devops_cli/commands/k8s/stack_lifecycle.py:1767, ARCHITECTURE.md]- Chosen: Print in the command from
pins.planned. The command layer prints and the library returns data.deploy-stackprints its planned fetches the same way. - Rejected: Print inside
collect_image_pins. The library would print, andresearch/render.pycalls it too. - Rejected: Print inside
_fetchin dry-run mode.deploy-stackalready printstrees.planned, so its output would hold each fetch twice.
- Chosen: Print in the command from
- Which text does the dry run print for one fetch command?: One info line for each command, with the words of the command joined by spaces. The line uses the message that
run_subprocessprints for a planned command, so each dry run reads the same. (best practice) [sources: src/devops_cli/core/process.py, src/devops_cli/commands/k8s/image_pins.py]- Chosen: Reuse the planned-command message of
run_subprocess. One wording for each dry run, and no second prefix string to keep in step. - Rejected: Add a new message with its own wording. Two wordings for one idea, and a reader sees two formats.
- Chosen: Reuse the planned-command message of
- Does
ImagePinsalready carry the planned fetch commands?: Yes.SourceTrees.plannedcollects the commands of a dry run andcollect_image_pinsputs them inImagePins.planned. The command does not read the field. [sources: src/devops_cli/k8s/app_sources.py, src/devops_cli/k8s/image_pins.py, src/devops_cli/commands/k8s/image_pins.py] - Does a dry run of
devops k8s image-pinsstart a program today?: Yes, one local read:repository_originrunsgit config --get remote.origin.urlwithlocal_read=True. The dry run starts no fetch and no render, and sends no request. The change keeps that local read. [sources: src/devops_cli/k8s/app_sources.py] - Which tests cover the command and its dry run?:
tests/k8s/test_image_pins.pycoverscollect_image_pins.tests/commands/test_k8s_dry_run.pycovers the dry run of the k8s commands. The change adds a case to each file. [sources: tests/k8s/test_image_pins.py, tests/commands/test_k8s_dry_run.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 27, 2026
Both fix a k8s dry run that omits a planned operation, but #7371 fixes the catalog render command while this fixes the image-pins fetch command.devops-cli-service commentedon Nov 27, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (3)
Searches run:
Sources:
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Released in v0.241.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.241.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 00:41 UTC