Skip to content

fix(k8s): deploy-stack lists a missing values file #7316

Done

Description

@dan-petty

Problem

devops k8s deploy-stack and teardown-stack refuse an environment tree that lacks a path of their own tables (#7290). They do not check a Helm values file that an Application names. A dry run on a tree that lacks such a file succeeds and lists the missing file.

Done when

  • A dry run and a real run stop with a ConfigurationError that names the missing values file, for each values file that resolves into the environment tree. A test fails on the base.

Alternatives check of 2026-11-26: none.
Tool: none found.
Reason: No searched tool validates the Helm values paths that Argo CD Applications name against an environment tree; Helm and Argo CD only report a missing file when they render or sync, so the deploy-stack check stays in the CLI.

Lacks:

  • No check of Application values files against the tree
  • No ConfigurationError that names the missing file
  • No dry-run check of teardown-stack values files

Proposed design

Problem statement

The deploy-stack and teardown-stack commands refuse an environment tree that lacks a path of their own tables, but they do not check a Helm values file that an Argo CD Application names. A dry run on a tree that lacks such a file succeeds and lists the missing file. Both commands must stop with a ConfigurationError that names each missing values file, in a dry run and in a real run.

Acceptance criteria

Requirement: deploy-stack dry run names a missing values file

The devops k8s deploy-stack command SHALL stop with a ConfigurationError that names each values file of an Application chart source that resolves under the environment tree and is absent.

Scenario: Dry run on a tree with one absent values file

  • WHEN a test builds a temporary environment tree whose Application chart source names an absent values file under the tree and runs devops k8s deploy-stack --dry-run on it
  • THEN the command raises ConfigurationError and its message contains the path of the absent values file

Requirement: deploy-stack real run stops before a cluster request

The deploy-stack command MUST run the values-file check before it sends any request to the cluster or runs Helm.

Scenario: Real run on a tree with one absent values file

  • WHEN a test runs devops k8s deploy-stack in real mode on the tree through the process seam that records each call
  • THEN the command raises ConfigurationError that names the file, and the seam records no kubectl or helm call

Requirement: teardown-stack dry run names a missing values file

The devops k8s teardown-stack command SHALL stop with a ConfigurationError that names each absent values file of an Application chart source that resolves under the environment tree.

Scenario: Dry run of teardown-stack on a tree with one absent values file

  • WHEN a test runs devops k8s teardown-stack --dry-run on the tree
  • THEN the command raises ConfigurationError and its message contains the path of the absent values file

Requirement: teardown-stack real run stops before a cluster request

The teardown-stack command MUST run the values-file check before it sends any request to the cluster or runs Helm.

Scenario: Real run of teardown-stack on a tree with one absent values file

  • WHEN a test runs devops k8s teardown-stack in real mode on the tree through the process seam that records each call
  • THEN the command raises ConfigurationError that names the file, and the seam records no kubectl or helm call

Requirement: Each absent values file is named

The ConfigurationError MUST name every absent values file, not only the first one.

Scenario: Two Applications with two absent values files

  • WHEN a test builds a tree whose two Applications name two different absent values files and runs devops k8s deploy-stack --dry-run
  • THEN the message of the ConfigurationError contains both paths

Requirement: A values file outside the environment tree is not checked

The check MUST skip a values file whose resolved path is not under the environment tree root.

Scenario: Application names an absent path outside the tree

  • WHEN a test builds a tree whose Application names an absent values file outside the tree and runs devops k8s deploy-stack --dry-run
  • THEN the command raises no ConfigurationError for that path

Requirement: A present values file passes the check

The check SHALL pass an environment tree when each values file that resolves under the tree exists.

Scenario: Tree with a present values file

  • WHEN a test builds a tree whose Application names a values file that exists under the tree and runs devops k8s deploy-stack --dry-run
  • THEN the command raises no ConfigurationError for the values file

Existing Tool Considered

No open, maintained tool covers the need. helm/helm and argoproj/argo-cd, the tools that read the values files that an Application names, report a missing file only when they render or sync: Helm fails in helm template or helm install, and Argo CD's repo-server fails at render or sync. Neither validates the helm.valueFiles paths against the environment tree before deploy-stack or teardown-stack touches the cluster, and the alternatives check of 2026-11-26 found no tool. The check stays in the CLI. Cost: about 40,000 tokens and about 3 hours to build the check and its tests; about 10,000 tokens a year to keep and fix it.

Key questions

  • Which exception must the check raise?: ConfigurationError, the configuration error defined at src/devops_cli/exceptions/config.py:10 and listed in the error table of docs/ERRORS.md:50. [sources: src/devops_cli/exceptions/config.py:10, docs/ERRORS.md:50]
  • Where does the check run so that both commands and both modes stop?: In one method on EnvironmentTree, require_value_files(trees), next to require and require_applications. deploy_stack and teardown_stack call it right after _stack_roots, before _collect_deploy_targets or _collect_teardown_targets and before any cluster request. One check covers both commands and both modes. (best practice) [sources: src/devops_cli/k8s/environment.py:107, src/devops_cli/k8s/environment.py:123, src/devops_cli/commands/k8s/stack_lifecycle.py:1730, src/devops_cli/commands/k8s/stack_lifecycle.py:1967]
    • Chosen: One method on the shared EnvironmentTree. One check covers both commands and both modes, next to the existing tree checks, with no second copy.
    • Rejected: In each command before its first request. Two copies drift, and the teardown path already differs from the deploy path.
  • Which values files of an Application does the check read?: The helm.valueFiles of the Application's chart source that chart_sources gives (a source with a chart and a targetRevision), in their order. Each path is resolved as deploy-stack resolves it: a $<ref>/<path> names <path> in the source whose ref is <ref>, and any other path is relative to the checkout of the environment tree. The check reads no other path of the Application. [sources: openspec/specs/k8s-helm-deploy/spec.md:145, src/devops_cli/k8s/app_sources.py:165, src/devops_cli/k8s/app_sources.py:127, k8s/README.md:22]
  • Does the check cover a values file whose path leaves the environment tree?: No. The check resolves the path and checks it only when it is under the root of the environment tree (EnvironmentTree.root); a $ref source of another repository and a path outside the tree are skipped, as the issue scopes it. (best practice) [sources: CONTEXT.md:300, src/devops_cli/k8s/environment.py:50, src/devops_cli/k8s/app_sources.py:127]
    • Chosen: Check only paths under the environment tree root. The issue scopes the check to the tree, and a shared file outside it is not part of the tree.
    • Rejected: Check each resolved path, inside or outside the tree. A file outside the tree is not part of it, and the check would stop a tree that works.
  • Does the check fetch a $ref source of another repository?: No. A $ref source whose repository is not the origin resolves outside the environment tree, so the check skips it without a fetch. Only a plain path or a $ref to the origin is resolved and checked. This keeps the check offline and avoids a fetch of an unrelated repository. (best practice) [sources: src/devops_cli/k8s/app_sources.py:99, src/devops_cli/k8s/app_sources.py:127, CONTEXT.md:300]
    • Chosen: Skip a $ref of another repository without a fetch. Its file is outside the tree, and a dry run must fetch nothing.
    • Rejected: Resolve every $ref through SourceTrees.value_file. It fetches an unrelated repository for a file that the check would skip, and a private repository can fail the command.
  • Does the check read every Application of the tree or only the selected stacks?: Every Application under EnvironmentTree.application_dirs, because the issue checks each values file that resolves into the tree, and a tree with a missing values file is invalid for any command. Limiting the check to the selected stacks would leave the gap for teardown and for a later stack. (best practice) [sources: src/devops_cli/k8s/environment.py:58, src/devops_cli/k8s/environment.py:123, src/devops_cli/k8s/app_sources.py:165]
    • Chosen: Every Application of the tree. The check validates the tree, as require_applications does, and covers teardown and every later stack.
    • Rejected: Only the Applications of the selected stacks. A missing file in another Application stays hidden, and teardown reads no release table to select from.
  • How does the change show that the new test fails on the base?: Write the test first and run it at the base commit; the pull request records the failure before the fix, as rule 4 of AGENTS.md requires. [sources: AGENTS.md:10]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/bug
    scope/k8s
    source/agent
    status/new
    on Nov 26, 2026
  2. dan-petty commented on Nov 26, 2026

    @dan-petty
    OwnerAuthor
  3. added
    value/medium
    effort/low
    priority/p2-medium
    on Nov 26, 2026
  4. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    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 (10)

    Tools considered:

    Searches run:

    • helm template fails when values file missing error message, results: 5
    • validate Argo CD Application helm valuesFiles missing file error, results: 5
    • helm lint values file missing error "no such file or directory", results: 5
    • Argo CD application values file path validation CLI tool, results: 5
    • kubeconform helm chart validation, results: 5
    • helm values file existence check tool, results: 5
    • helmfile missing values file error, results: 5
    • argocd app diff --local helm values file, results: 5
    • "values file" missing validation Argo CD Application repo-server error, results: 5
    • helm install values file not found error message, results: 5

    Sources:

  5. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

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

  7. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  8. removed
    status/in-review
    owner/agent
    on Nov 29, 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/lowpriority/p2-mediumscope/k8ssource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions