Repository navigation
Description
Update 2026-11-26 (infra move): step 17 (#7290) removes the test-fixture fallback.
When #7290 merges, load_cluster_secrets_table reads only the environment tree, and a missing cluster-secrets.toml is a configuration error. Check both acceptance criteria then. The devops/renovate row is still in CLUSTER_SECRETS. The homelab Renovate reads that Secret, and homelab cluster-secrets.toml has no row for it: add it there before the product row goes. Plan PR #7270 overlaps #7290: rebase or reduce it.
Problem
load_cluster_secrets_table (src/devops_cli/k8s/cluster_secrets.py) reads the environment Secret rows from cluster-secrets.toml of the environment tree. When the file is missing, it reads tests/fixtures/cluster-secrets.toml:
- Product code reads a test fixture. fix(k8s): Resolve cluster secrets fixture in installed package #6949 and fix(k8s): hermetically resolve cluster secrets fixture #6959 added path variants of this fallback.
- refactor(k8s): read the environment Secret rows from homelab #6928 removed 13 rows from the product before the homelab file existed (dan-petty/homelab#96).
- An installed release has no fixture, so the table holds only the product rows, and
devops k8s push-secretsskips the environment Secrets with no error.
Proposed remedy
After dan-petty/homelab#96 merges: delete the fallback and _resolve_fixture_secrets_file. When the environment tree has no cluster-secrets.toml, push-secrets and deploy-stack fail with a configuration error that names the file. Tests pass the fixture folder as the tree.
Check also row devops/renovate: Renovate left the product (#6938), and the row is still in CLUSTER_SECRETS.
Acceptance criteria
-
git grep -n "tests/fixtures" -- srcfinds no read of the Secret table. - With an environment tree that has no
cluster-secrets.toml,devops k8s push-secrets --planexits with an error that names the file.
Dependencies
dan-petty/homelab#96 merges first.
Alternatives check of 2026-11-25: none.
Tool: none found.
Reason: Three searches for configuration-error and layering tooling returned only unrelated results; no open tool or library removes a product-code fixture fallback or fails on a missing environment file, because the fix is internal to devops-cli.
Lacks:
- Raises a configuration error naming the missing cluster-secrets.toml
- Deletes the test-fixture fallback from product code
- Drops the stale devops/renovate row from CLUSTER_SECRETS
- Resolves the devops-cli k8s tree before step 17
Proposed design
Problem statement
load_cluster_secrets_table reads environment Secret rows from cluster-secrets.toml. When that file is missing, it reads tests/fixtures/cluster-secrets.toml. An installed release has no fixture, so devops k8s push-secrets silently skips environment Secrets. The fix removes the fallback and fails with a configuration error that names the file. The work waits for step 17 of the repository switch (#5134) and dan-petty/homelab#222. It also removes the stale devops/renovate row from CLUSTER_SECRETS.
Acceptance criteria
Requirement: No test-fixture fallback
Product code SHALL NOT read the environment Secret table from tests/fixtures.
Scenario: Source scan finds no fixture read
- WHEN a test runs
git grep -n "tests/fixtures" -- src - THEN the command finds no line that reads the Secret table.
Requirement: Missing environment file raises
load_cluster_secrets_table MUST raise ConfigurationError that names cluster-secrets.toml when the environment tree has no file.
Scenario: Empty environment tree
- WHEN a test calls
load_cluster_secrets_table(k8s_dir=tmp_path)on an empty directory - THEN the call raises
ConfigurationErrorand the message contains the path ofcluster-secrets.toml.
Requirement: Push-secrets fails on a missing file
devops k8s push-secrets SHALL exit non-zero with a configuration error that names the missing cluster-secrets.toml.
Scenario: Push-secrets with an empty tree
- WHEN a test runs
devops k8s push-secrets --plan --k8s-dir <empty-tree> - THEN the command exits non-zero and its output names
cluster-secrets.toml.
Requirement: Remove stale Renovate row
CLUSTER_SECRETS SHALL NOT hold the devops/renovate row.
Scenario: Product rows exclude Renovate
- WHEN a test reads the tuple
CLUSTER_SECRETS - THEN the tuple contains no
devops/renovate.
Existing Tool Considered
The alternatives check in the issue body returned verdict none and named no tool. No open tool or library covers this internal devops-cli change. The change removes existing code and adds a configuration error; it builds no new tool.
Key questions
- Which code reads the test fixture for the environment Secret table?:
load_cluster_secrets_tablecalls_resolve_fixture_secrets_filewhen no environment file resolves. The resolver checks_FIXTURE_SECRETS_FILEand_FALLBACK_FIXTURE_SECRETS_FILE. [sources: src/devops_cli/k8s/cluster_secrets.py:459, src/devops_cli/k8s/cluster_secrets.py:498, tests/k8s/test_cluster_secrets_file.py:199] - Should the plan add an interim
--k8s-dirworkaround before step 17?: No. The plan waits for step 17 (feat(argocd): read the environment from the homelab repo #5134) anddan-petty/homelab#222.AGENTS.mdrule 2 says to write no compensating code when a leaf item cannot be built as written. (best practice) [sources: AGENTS.md]- Chosen: Wait for step 17 and homelab#222. The reply says 89 tests fail before step 17 because the devops-cli k8s tree has no cluster-secrets.toml.
- Rejected: Add an interim
--k8s-dirworkaround.AGENTS.mdrule 2 forbids compensating code for a leaf item that cannot be built as written.
- Does the product
CLUSTER_SECRETSstill hold thedevops/renovaterow?: Yes. The row is inCLUSTER_SECRETSandOPTIONAL_FEATURE_SECRETS. [sources: src/devops_cli/k8s/cluster_secrets.py]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 25, 2026
Silent skip of environment Secrets in an installed release is a correctness failure in a production path.Both work on cluster secrets from homelab; #6685 moved reading to homelab, this removes the old fallback and adds a missing-file error.dan-petty commentedon Nov 25, 2026
Returned: this cannot be built as written before step 17 of the repository switch (#5134).
What was tried, at
origin/mainafter #7213: delete both fixture fallbacks (_resolve_fixture_secrets_fileand the one inEnvironmentTree.cluster_secrets), and makepush-secretsanddeploy-stackrequirecluster-secrets.toml. A push of product rows only (--only) needed no file.Result: 89 tests fail, most of them
deploy-stackruns against thek8s/tree of devops-cli. They show a real flow, not only old tests:k8s/tree (.devops/project.toml). That tree has nocluster-secrets.toml, so the test fixture is its only source of environment rows.deploy-stackof that tree, such as the local one on minikube, needs them.Build it with or after step 17, when devops-cli has no environment tree and these commands read the tree of homelab. dan-petty/homelab#222 added the file there.
Until then, give
push-secretsthe option--k8s-dir <homelab checkout>/k8sfrom a current homelab checkout, so the rows come from homelab and not from the fixture.Also open: row
devops/renovateis still inCLUSTER_SECRETS, while Renovate runs from homelab.devops-cli-service commentedon Nov 25, 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 (4)
Searches run:
devops-cli-service commentedon Nov 25, 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 26, 2026
Plan state: branch
fix/7214-push-secrets-falls-back-to-a, draft pull request #7270. The pull request plans the item and closes no issue. The stage job and the step fix-plan edit this comment, and a comment of each run tells what the run did.The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:
A model review of the plan found these points. They stop no draft, and a person judges them:
otherat tasks (5): Group 5 gives the fixture folder only to the direct table read in tests/commands/k8s/test_k8s_qdrant_security.py. Its deploy-stack tests, and the deploy-stack dry-run tests in tests/commands/k8s/test_k8s.py that group 7 verifies, read the table through push_for_stacks with the profile tree k8s/, which holds no cluster-secrets.toml, so after group 2 the loader raises and the group's verify fails. Evidence: "src/devops_cli/commands/k8s/stack_lifecycle.py:984:table = load_cluster_secrets_table(env=env)"false_premiseat design (decisions): Decision 3 names the helpers secrets_by_ref, keyring_only_keys, generator_option_names and generator_for_option with no line number and no quoted statement of their module, so the plan cites members it does not show. Evidence: "src/devops_cli/k8s/cluster_secrets.py:def secrets_by_ref"false_premiseat tasks (7): Group 7's test field says CLUSTER_SECRETS holds the row at line 764, but line 764 is an entry of OPTIONAL_FEATURE_SECRETS, which starts at line 762; the CLUSTER_SECRETS row is built from its namespace and name elsewhere. Evidence: "src/devops_cli/k8s/cluster_secrets.py:762:OPTIONAL_FEATURE_SECRETS: Final[tuple[str, ...]] = ("false_premiseat proposal (feasibility): The feasibility says the search for load_cluster_secrets_table( showed three callers and that the plan decides each one, but the search also shows src/devops_cli/commands/k8s/cluster_secret_push.py:52, :60 and :197 and the no-argument calls in src/devops_cli/k8s/cluster_secrets.py. Evidence: "src/devops_cli/commands/k8s/cluster_secret_push.py:52: t = table if table is not None else load_cluster_secrets_table()"spec_delta_wrongat spec renovate-service (The Secret row holds the two IDs and the key under their variables): The kept scenario 'The push' ends with a live-cluster condition on the Argo CD Applications that no test can assert, though a test can assert its dry-run parts. Evidence: "no Application of projecthomelabhas the conditionOrphanedResourceWarningfor Secretrenovate"otherat tasks (8): Group 8 gives its repository fixture to two of the module's five--generatetests.test_a_typed_credential_has_no_generator,test_a_token_is_already_storedandtest_dry_run_of_a_generatealso invokedevops config set ... --generate, reach_store_generatedand read the table with no tree, so after group 2 the loader raises and the group's verify fails. Evidence: "Give it totest_generate_the_crawl4ai_tokenandtest_rotate_the_token"spec_delta_wrongat spec renovate-service (The Secret row holds the two IDs and the key under their variables): The rewritten scenarioThe pushkeeps a THEN part that no test of the plan asserts: theOrphanedResourceWarningcondition of the live Argo CD Applications. A test can assert only the dry-run part, so the live-cluster part of the THEN stays unproven. Evidence: "thekubectloutput holds noOrphanedResourceWarningfor Secretrenovate"false_premiseat design (decisions): The decision leaves the settings docstring unchanged because the row still lives in the environment tree, but nothing in the input shows that dan-petty/homelab holdsdevops/renovate, and the plan's own feasibility says that premise was not checked. Evidence: "Secretdevops/renovatestill exists in the environment tree"otherat proposal (what_changes): The plan leaves thedevops k8s bootstrapcommand tests out.bootstraprunsstack_life.deploy_stack(k8s_dir=env.root, stack=stack)with the Secret push on, sotests/commands/k8s/test_k8s_bootstrap.pyandtests/commands/k8s/test_k8s_context.pyload the table of the profile treek8s/, which holds nocluster-secrets.tomlafter group 2; their bootstrap runs then fail with the new configuration error, and no group gives those modules a tree. Evidence: "every deploy-stack run of the command tests reads a tree that holds the environment Secret rows."false_premiseat proposal (dependencies): The dependency says the tests read the homelab tree's cluster secrets file, but the plan gives every test the repository fixture as its tree, so the tests do not read that file. Evidence: "dan-petty/homelab#96: the homelab environment tree must hold its cluster secrets file first, because the push and the tests read the environment rows from that file."false_premiseat design (decisions): The reason claims a test asserts theThe pushscenario, but that scenario is a person's livepush-secretsandkubectlrun, and group 11 replaces the only test that asserted the row with a product-absence test. Evidence: "the keys stay in the text in one clause and in full in the scenario that a test asserts."otherat tasks (8): Unlike groups 6 and 7, group 8 does not say to place the copy in a folder namedk8s; the tree's Applications name their source paths relative to the repository, whichtree_attakes as the copy's parent, so the paths miss the copy. Evidence: "Give--dirwith a copy fromcopy_with_cluster_secretsto the two bootstrap runs oftests/commands/k8s/test_k8s_bootstrap.pythat reach the deploy"17 remaining items
dan-petty commentedon Nov 26, 2026
Done by #7317 (step 17, #7290). Checked on
mainon 2026-11-26:git grepfinds no read of atests/fixturesSecret table insrc/.devops k8s push-secrets --plan --k8s-dir <empty folder>exits 1 and names the missingcluster-secrets.toml.The extra requirement of the refined design, "Remove stale Renovate row", has a false premise and is not done: the Renovate CronJob in namespace
devopsreads Secretrenovatetoday, so the product keeps the row. The draft plan #7270 would remove it, so it is closed with this item.