Repository navigation
Description
Problem Description
CHART_CLAIMS in tests/test_k8s_local_path_placement.py (#1634) has one entry for each chart that an Argo CD Application installs. Each entry names the values that turn on a claim and the value path of the pod's affinity. The key is the chart name only. No check ties an entry to the chart version that the Application pins.
A chart release can move a value. Loki did this in 20.0.2 (#1632): it moved the pod field of the token from serviceAccount.automountServiceAccountToken to defaults.automountServiceAccountToken. If a release moves the claim switch or the affinity path, the test reads a value that the chart no longer uses. The test then passes, and the pod can bind its volume on the control-plane node.
The token test of #1652 has the same kind of table, _CHART_TOKENS in tests/invariants/test_k8s_manifests.py. Its key is the chart and the version, and a test fails when an Application pins another version. pinned_charts() in tests/support/k8s_tree.py reads the pinned versions.
Reproduction Steps
- Change
targetRevisionof the chart source ink8s/argocd/apps/grafana.yamlto a later grafana chart version. Change the deploy-stack release to the same version. - In that later version, suppose that the chart reads the claim switch from another value than
persistence.enabled. - Run
uv run devops ci test tests/test_k8s_local_path_placement.py.
Expected vs Actual Behavior
Expected: the test fails when an Application pins a chart version that CHART_CLAIMS was not read from. The person who bumps the chart then reads the claim values of the new version again.
Actual: the test passes at each chart version, because the key of CHART_CLAIMS is the chart name only.
Environment Diagnostics
Not applicable. The defect is in a test table of the repository. Found in the review of #1652.
Logs, Traces, or Terminal Output
None.
Pre-Submission Checklist
- I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
- I have checked existing issues and pull requests to ensure this is not a duplicate.
Proposed design
Problem statement
The CHART_CLAIMS table in tests/test_k8s_local_path_placement.py is keyed by chart name only. When a chart release moves a value path, the test reads a stale path and passes silently. A pod can then bind its volume on the control-plane node. The fix adds the pinned chart version to each key and a test that fails when an Application pins a version the table was not read from. The pattern already exists in _CHART_TOKENS in tests/invariants/test_k8s_manifests.py.
Acceptance criteria
Requirement: version-keyed table
CHART_CLAIMS SHALL use a tuple of chart name and pinned version as its key type.
Scenario: key type check
- WHEN the test module is imported and CHART_CLAIMS is inspected
- THEN every key is a tuple of two strings, and the set of keys equals the set returned by pinned_charts()
Requirement: version mismatch fails
A test SHALL fail when an Application pins a chart version that CHART_CLAIMS does not name.
Scenario: pinned version not in table
- WHEN pinned_charts() returns a (chart, version) pair that is not a key of CHART_CLAIMS
- THEN the test asserts a non-empty symmetric difference and fails
Requirement: placement checks unchanged
The existing placement checks SHALL pass with the new key structure.
Scenario: all placement tests pass
- WHEN uv run devops ci test tests/test_k8s_local_path_placement.py is run
- THEN every test in the module passes
Existing Tool Considered
No external tool covers this need. The fix is a repository-internal test change. It reuses pinned_charts() from tests/support/k8s_tree.py and copies the tuple key pattern from _CHART_TOKENS in tests/invariants/test_k8s_manifests.py. The written cost is the tokens to change the CHART_CLAIMS key type from str to tuple[str, str], update the _chart_sites lookup, add one test function, and update the existing coverage test. No new dependency is added.
Key questions
- What key structure does CHART_CLAIMS use after the fix?: tuple[str, str], the same as _CHART_TOKENS. Each key is (chart_name, pinned_version). (best practice) [sources: tests/invariants/test_k8s_manifests.py, openspec/changes/archive/2026-10-28-1652-no-unused-service-account-token/design.md]
- Chosen: tuple[str, str] matching _CHART_TOKENS. The pattern already exists in the same codebase. The token test's design document records the decision to name the version so a chart bump fails until the entry is re-read.
- Rejected: keep str key and add a separate version list. Two structures to keep in sync. The token test already proved the tuple key is simpler and the symmetric-difference check is one line.
- How does the test obtain the pinned chart versions?: pinned_charts() in tests/support/k8s_tree.py already returns frozenset[tuple[str, str]] of (chart, targetRevision) for every Application source that has a chart. [sources: tests/support/k8s_tree.py]
- How does _chart_sites look up a chart when the key is a tuple?: Match by chart name only, ignoring the version in the key, exactly as _chart_sites in test_k8s_manifests.py does: (sites for (name, _), sites in CHART_CLAIMS.items() if name == chart). (best practice) [sources: tests/invariants/test_k8s_manifests.py]
- Chosen: match by name only, like the token test. The version is checked by the separate symmetric-difference test. The lookup only needs the chart name to find the right entry.
- Rejected: match by full tuple including version. Would require chart_values() to yield the version, changing the shared helper. The token test does not do this.
- Which test asserts the version match?: A new test in test_k8s_local_path_placement.py asserts sorted(pinned_charts() ^ CHART_CLAIMS.keys(), key=str) == [], mirroring test_the_chart_table_names_each_chart_at_the_version_that_an_application_pins in test_k8s_manifests.py. (best practice) [sources: tests/invariants/test_k8s_manifests.py]
- Chosen: symmetric difference with pinned_charts(). Catches both a missing entry and a stale version. The token test uses this exact assertion.
- Rejected: subset check only (pinned_charts() - CHART_CLAIMS.keys()). Would miss a stale entry for a chart that is no longer installed. The symmetric difference is stricter and matches the existing pattern.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The change fixes a test table so it fails when a chart version moves a value path.A silent test pass could let a pod bind a volume on the control-plane node, but no live incident is reported.It closes a gap where a chart release can move a claim switch and the test still passes.The pattern already exists in _CHART_TOKENS; the fix copies that key structure and adds a version check.Both items work on the local-path placement test area of #1634, but #2147 moves volumes off the control-plane node while the candidate fixes the test table to be version-aware.devops-cli-service commentedon Oct 29, 2026
Status set to Ready at 0f7bc26 (see proposed design in issue body).
devops-cli-service commentedon Nov 1, 2026
Staged: branch
fix/2519-the-claim-table-of-the-local, draft pull request #3001. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
docs(openspec): plan #2519 key claim table by chart version (#3001)
187 remaining items
devops-cli-service commentedon Nov 5, 2026
Cleared the stop at group 1 by the rule
digest: the runner image changed since the stop, from sha256:b161a617dc04fdc13d2c96b33b2a4acbfe6bebfae21942588aa7201250eb6e29 to sha256:6e4db5c738b1a1dced0e45de878bce280ec69321cebc5bb7cdfe0a06fe074b6f, and the classtests_lostof the stop is one that a new attempt can fix. The item is Planned again, and the Service takes it in the next round. The Service clears at most 1 for each class and 3 for each item by digest. A stop of another class, a new stop on this image, and a stop over a limit wait for a commentimplement: retry.feat(roadmap): let the step guard allow a recorded test removal (#3715)
[-]fix(k8s): the claim table of the local-path placement test names the chart version that it was read from[/-][+]fix(k8s): key claim table by chart version[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 94 characters, and the limit is 60. The type and the scope stay.
fix(k8s): the claim table of the local-path placement test names the chart version that it was read fromfix(k8s): key claim table by chart versiondevops-cli-service commentedon Nov 6, 2026
Released in v0.70.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.70.1
devops-cli-service commentedon Nov 6, 2026
Live since 2026-11-06 18:04 UTC