Skip to content

refactor(k8s): delete the unused write_path_renders #7907

Backlog

Description

@dan-petty

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_render and reads its __all__ and its attributes.
  • THEN __all__ is ["path_source_folder", "render_path_source"] and the module has no attribute write_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_render and reads the names _RENDERS_DIR, _SOURCES_DIR and _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.py runs.
  • 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 -q runs.
  • THEN The run reports test_a_path_out_of_the_folder_of_its_repository_is_not_built as 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_source and write_application_renders, and holds neither write_path_renders nor kube-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. Only src/devops_cli/k8s/app_render.py defines it and tests/k8s/test_app_render.py imports it. devops k8s lint calls write_application_renders of devops_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.py also guards path_source_folder?: test_a_path_out_of_the_folder_of_its_repository_is_not_built guards the refusal of feat(k8s): build deploy-stack manifests from the Applications #6681. It calls write_path_renders, so it needs a rewrite against path_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_DIR and _WORKERS, and the imports Final, ThreadPoolExecutor, application_sources, normalize_git_url, repository_origin, discover_argocd_applications and EnvironmentTree. [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_folder and to expect ApplicationSourceError. (best practice) [sources: tests/k8s/test_app_render.py, src/devops_cli/k8s/app_render.py:46, AGENTS.md]
  • 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 grep finds 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.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/refactor
    scope/k8s
    source/agent
    status/new
    effort/low
    on Nov 30, 2026
  2. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor
  3. added
    value/low
    priority/p2-medium
    on Nov 30, 2026
  4. added
    status/ready
    and removed
    status/new
    on Dec 1, 2026
  5. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

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/lowpriority/p2-mediumscope/k8ssource/agentstatus/readytype/refactorvalue/low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions