Repository navigation
Description
Problem
No command calls write_path_renders of src/devops_cli/k8s/app_render.py. Pull request 7777 moved devops k8s lint to write_application_renders of src/devops_cli/k8s/image_pins.py. The module docstring still describes the old function as the build that kube-linter reads, and says that a chart source is not built.
Reproduction
At commit 720344b, git grep -n write_path_renders -- src tests names only src/devops_cli/k8s/app_render.py and tests/k8s/test_app_render.py.
Expected behavior
The function, its constants and its tests are deleted, and the module docstring describes only path_source_folder and render_path_source.
Existing Tool Considered
None is needed. The work deletes code.
Source
Source: #7901
Alternatives check of 2026-11-30: not-applicable.
Class: refactor, no model call.
Tool: none found.
Proposed design
Problem statement
Pull request 7777 moved devops k8s lint to write_application_renders of devops_cli.k8s.image_pins. No command calls write_path_renders of src/devops_cli/k8s/app_render.py now. The module docstring still names the old function as the build that kube-linter reads, and says that a chart source is not built. The change deletes the function, its constants and its tests, and leaves a docstring that describes the two remaining functions.
Acceptance criteria
Requirement: Delete the unused render writer
The module devops_cli.k8s.app_render SHALL export only path_source_folder and render_path_source.
Scenario: The deleted writer is gone
- WHEN A test imports
devops_cli.k8s.app_renderand reads its__all__and its attributes. - THEN
__all__is["path_source_folder", "render_path_source"]and the module has no attributewrite_path_renders.
Requirement: Delete the constants of the writer
The module devops_cli.k8s.app_render SHALL hold no constant of the deleted writer.
Scenario: The constants are gone
- WHEN A test imports
devops_cli.k8s.app_renderand reads the names_RENDERS_DIR,_SOURCES_DIRand_WORKERS. - THEN The module has none of the three names.
Requirement: Drop the imports of the writer
The module devops_cli.k8s.app_render MUST import only the names that path_source_folder and render_path_source use.
Scenario: No unused import stays
- WHEN
uv run ruff check --select F401 src/devops_cli/k8s/app_render.pyruns. - THEN The command exits 0 and reports no unused import.
Requirement: Keep the guard of the path out of the repository
The test of a path that leaves the folder of its repository SHALL stay and SHALL call path_source_folder directly.
Scenario: The path out of the repository is still refused
- WHEN
uv run pytest tests/k8s/test_app_render.py -qruns. - THEN The run reports
test_a_path_out_of_the_folder_of_its_repository_is_not_builtas passed and reports no failed test.
Requirement: Describe the two remaining functions
The module docstring SHALL describe path_source_folder and render_path_source and SHALL name devops_cli.k8s.image_pins.write_application_renders as the build that devops k8s lint reads.
Scenario: The docstring names no deleted function
- WHEN A test reads
devops_cli.k8s.app_render.__doc__. - THEN The text holds
path_source_folder,render_path_sourceandwrite_application_renders, and holds neitherwrite_path_rendersnorkube-linter.
Existing Tool Considered
The alternatives check of 2026-11-30 in the issue body gives the verdict not-applicable, for the class refactor with no model call, and names no tool. No tool covers a deletion. The change builds no code, so its cost is zero tokens and zero time.
Key questions
- Which code calls
write_path_renders?: No command calls it. Onlysrc/devops_cli/k8s/app_render.pydefines it andtests/k8s/test_app_render.pyimports it.devops k8s lintcallswrite_application_rendersofdevops_cli.k8s.image_pins. [sources: src/devops_cli/k8s/app_render.py:73, tests/k8s/test_app_render.py:11, src/devops_cli/k8s/image_pins.py:476, src/devops_cli/commands/k8s/security_audit.py:157] - Which test of
tests/k8s/test_app_render.pyalso guardspath_source_folder?:test_a_path_out_of_the_folder_of_its_repository_is_not_builtguards the refusal of feat(k8s): build deploy-stack manifests from the Applications #6681. It callswrite_path_renders, so it needs a rewrite againstpath_source_folder. [sources: tests/k8s/test_app_render.py, src/devops_cli/k8s/app_render.py:46] - Which imports and constants become unused?: The constants
_RENDERS_DIR,_SOURCES_DIRand_WORKERS, and the importsFinal,ThreadPoolExecutor,application_sources,normalize_git_url,repository_origin,discover_argocd_applicationsandEnvironmentTree. [sources: src/devops_cli/k8s/app_render.py:39, src/devops_cli/k8s/app_render.py:73] - Does the test of the path out of the repository stay, or does it go with the deleted function?: The test stays. Rewrite it to call
path_source_folderand to expectApplicationSourceError. (best practice) [sources: tests/k8s/test_app_render.py, src/devops_cli/k8s/app_render.py:46, AGENTS.md]- Chosen: Rewrite the test against
path_source_folder. It keeps the guard of feat(k8s): build deploy-stack manifests from the Applications #6681, which AGENTS.md rule 11 asks for. - Rejected: Delete the whole test module. It loses the guard of feat(k8s): build deploy-stack manifests from the Applications #6681, so the defect can return.
- Rejected: Keep the test with
write_path_renders. The function is deleted, so the test cannot run.
- Chosen: Rewrite the test against
- Does the deletion keep a deprecated alias for
write_path_renders?: Delete the function and keep no alias. No caller exists outside the module and its test. (best practice) [sources: src/devops_cli/k8s/app_render.py:73, src/devops_cli/k8s/image_pins.py:476]- Chosen: Delete the function with no alias.
git grepfinds no caller, so an alias keeps nothing working. - Rejected: Keep a deprecated alias. It adds code and a second name for a build that no command reads.
- Chosen: Delete the function with no alias.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 30, 2026
Both touch k8s lint path source rendering, but 7904 fixes a namespace bug while the candidate deletes dead code.devops-cli-service commentedon Dec 1, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.