Repository navigation
Description
Problem
devops devcontainer init has two options that change nothing:
--published/-p(defaultTrue):initinsrc/devops_cli/commands/devcontainer.pynever reads the value. It setsis_publishedfrom--imagealone.--python:initgives the value todevcontainer.json.j2, but the template does not read it. The template always writes the published image or the image that--imagenames. fix: drop copied tool versions from generated files #6412 deletes the last branch of the template that read it (apython:<version>-trixieimage that no call reached).
The help says "Use published GHCR image (defaults to True)" and "Python version for base template", so a user thinks that the options do something.
Change
- Remove
--publishedand--pythonfromdevops devcontainer init, and stop the render call from givingpython_versionand thepublishedflag that only--imagesets, if the template can read the image alone. - Keep
--pythonofdevops devcontainer update, which uses it. - Regenerate the command reference, and change
docs/DEVCONTAINER_USAGE.md(it showsinit --published) and the tests that pass--published.
Renovate. None.
Risk. Low. A script that passes --published or --python to init gets a usage error.
Proof
uv run devops devcontainer init --helpshows no--publishedand no--python.- Scoped pytest of
tests/commands/test_devcontainer.pyandtests/core/test_template_rendering.pypasses.
Depends on: #6412
Alternatives check of 2026-11-20: none.
Tool: none found.
Reason: Searches for a tool that finds or removes unused Typer/Click CLI options returned only general Python documentation and container images, no tool. The change edits the project's own Typer command, help text, docs and tests, so no external tool or library covers it.
Lacks:
- Removal of the dead
--publishedand--pythonoptions frominit - Stop passing
python_versionin the init render context - Regenerated command reference and usage guide without the options
- Updated tests that pass the removed options
Proposed design
Problem statement
devops devcontainer init offers --published/-p and --python, but neither option changes the output. init sets the published flag from --image alone, and the template does not read python_version after #6412. The change removes both options from init, keeps --python of update, and updates the command reference, the usage guide and the tests.
Acceptance criteria
Requirement: Init help hides removed options
The init command of devops devcontainer SHALL show neither --published nor --python in its help.
Scenario: Help of init
- WHEN A test runs
devops devcontainer init --helpin the CLI runner. - THEN The output holds no
--published, no-pand no--python.
Requirement: Init rejects removed options
The init command of devops devcontainer SHALL exit with a nonzero code when a caller passes --published or --python.
Scenario: Removed option use
- WHEN A test runs
devops devcontainer init --publishedin the CLI runner. - THEN The command exits with a nonzero code and its output names
--published.
Requirement: Init render context
The init command SHALL NOT pass python_version to devcontainer.json.j2.
Scenario: Recorded render arguments
- WHEN A test replaces
render_json_templatewith a recorder and runsiniton a temporary directory. - THEN The recorded keyword arguments hold
imageandpublished, and they hold nopython_version.
Requirement: Update keeps the Python option
The update command SHALL keep --python and SHALL set the manifest image from its value.
Scenario: Update writes the image
- WHEN A test runs
devops devcontainer update --python 3.13on a directory that holds a manifest. - THEN The written
imagestarts withCONST_DEVCONTAINER_IMAGE_PREFIXand ends with3.13.
Requirement: Command reference is current
The generated command reference SHALL show devcontainer init with no --published and no --python.
Scenario: Docs row of static analysis
- WHEN
uv run devops ci --check --only docsruns on the change. - THEN The docs row reports a pass and no stale generated document.
Requirement: Usage guide shows no removed option
docs/DEVCONTAINER_USAGE.md SHALL NOT show init --published.
Scenario: Search of the usage guide
- WHEN
rg -n -- '--published' docs/DEVCONTAINER_USAGE.mdruns. - THEN The command prints no line.
Requirement: Devcontainer tests pass
The devcontainer command and template tests SHALL pass with no use of the removed options.
Scenario: Scoped pytest
- WHEN
uv run pytest tests/commands/test_devcontainer.py tests/core/test_template_rendering.py -qruns. - THEN The test run reports a pass.
Existing Tool Considered
The alternatives check in the issue body records verdict none and no tool. No open, maintained tool or library covers the need. The change edits the project's own Typer command, help text, docs and tests, so it writes no new code and has no written build cost.
Key questions
- Which value does
inituse for the published flag?:initsetsis_publishedfrom--image: true when the image starts withghcr.io/dan-petty/devops-cli/devcontainer, and true for the default published image.initnever reads the--publishedoption. [sources: src/devops_cli/commands/devcontainer.py:164, src/devops_cli/commands/devcontainer.py:167] - Which render arguments can
initdrop?: Droppython_versiononly. Keeppublished, becauseinitcomputes it from--imageand the template still reads it. (best practice) [sources: src/devops_cli/commands/devcontainer.py, src/devops_cli/templates/devcontainer.json.j2]- Chosen: Drop
python_versiononly. The template does not readpython_versionafter fix: drop copied tool versions from generated files #6412, andpublishedstill reaches the template as the value that--imagesets. - Rejected: Drop
python_versionandpublished.initcomputespublishedfrom--image; the issue does not show that the template can useimagealone. - Rejected: Keep both arguments. The template no longer reads
python_versionafter fix: drop copied tool versions from generated files #6412, so the argument is dead.
- Chosen: Drop
- Does
updateuse--python?: Yes.updatewritesdata['image']asCONST_DEVCONTAINER_IMAGE_PREFIXplus the value of--python, so the option stays. [sources: src/devops_cli/commands/devcontainer.py] - Which documents and tests show the removed options?:
docs/DEVCONTAINER_USAGE.mdshowsinit --published.docs/CLI_REFERENCE.mdis the generated command reference that thedocsrow ofStatic Analysischecks.tests/commands/test_devcontainer.pyandtests/core/test_template_rendering.pypass the removed options. [sources: docs/DEVCONTAINER_USAGE.md, docs/CLI_REFERENCE.md, tests/commands/test_devcontainer.py, tests/core/test_template_rendering.py]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 20, 2026
Both work on the devcontainer.json.j2 template area; #6412 removes the python else-branch from the template while the candidate removes the non-functional CLI options that fed it.devops-cli-service commentedon Nov 20, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
devops-cli-service commentedon Nov 20, 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 (2)
Searches run:
Sources:
devops-cli-service commentedon Nov 20, 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 25, 2026
Released in v0.219.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.219.0
devops-cli-service commentedon Nov 25, 2026
Live since 2026-11-25 17:09 UTC