Repository navigation
Description
Problem Description
The daily infra-drift Workflow (#5129) checks no repository. devops k8s deploy-stack renders ConfigMap devops-cli-config from the template and copies only the section service from config.yaml (render_devops_configmap_content in src/devops_cli/k8s/configmap.py). The section infra never reaches the cluster. With no entry in infra.repos, run_drift_all (src/devops_cli/infra/drift.py) returns exit 0 and the message drift_all_no_repos. So the Workflow ends Succeeded and checks nothing.
Evidence, 2026-11-27
- After fix(infra): add the push-secrets row of the infra-drift SSH key #7434 the owner pushed Secret
devops/infra-ssh-key, and Workflowinfra-drift-manual-nsc84ran fromcronwf/infra-drift. It endedSucceededin 10 seconds (19:25:59 to 19:26:09 UTC). Loki holds no output line ofdevops infra drift --allfor it. - The live ConfigMap has no key
infra. The workstationconfig.yamlhas one entry ininfra.reposwithagent_access: full.
Expected Behavior
deploy-stackcopiesinfra.reposfromconfig.yamlinto the ConfigMap, as it does forservice.repos. The repository names stay out of the committed template.- A scheduled run that has no eligible repository does not end green.
devops infra drift --allexits non-zero when no entry ofinfra.reposhas the access levelplanor higher, and its message names the setting.
Acceptance Criteria
- A test: the rendered ConfigMap holds the
infra.reposentries of the settings, and a template with noinfrasection still renders. - A test:
devops infra drift --allwith no eligible entry exits non-zero and namesinfra.repos. - Pending a person or an agent after the release and
deploy-stack: a Workflow fromcronwf/infra-driftreads the environment repository and writes its drift report.
Related
- feat(infra): run drift in the cluster and plan infra PRs #5129 (the Workflow), fix(k8s): Fix infra-drift CronWorkflow schedules and executor #7364 (the controller takes the CronWorkflow), fix(infra): push-secrets has no row for the infra-drift SSH key #7428 (the SSH key Secret).
Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches turned up only generic manifest and ConfigMap tooling such as Kustomize and ConfigMap generators; none copies the project's own infra.repos settings into the deployed ConfigMap or makes devops infra drift --all fail on an empty repo list, so the fix stays in this repository's renderer and drift command.
Lacks:
- Copies a named section of this project's config.yaml into the ConfigMap
- Renders a ConfigMap when the template has no infra section
- Non-zero exit when no infra.repos entry is eligible
Proposed design
Problem statement
The daily infra-drift Workflow checks no repository. devops k8s deploy-stack renders ConfigMap devops-cli-config and copies only the service section from config.yaml, so the section infra never reaches the cluster. devops infra drift --all then finds no eligible entry and exits 0 with the message drift_all_no_repos, so the Workflow ends Succeeded and checks nothing.
Acceptance criteria
Requirement: Active settings reach the renderer
render_active_devops_configmap SHALL pass the infra.repos entries of the active settings to render_devops_configmap_content.
Scenario: Deploy-stack render holds the infra repos
- WHEN The settings hold one infra repo at
agent_access: full, andrender_active_devops_configmaprenders the product templatek8s/devops/configmap.example.yaml. - THEN The rendered
devops-cli.yamlholds aninfra.reposlist with that repo name and its access level.
Requirement: The renderer writes the infra section
The renderer SHALL replace the infra.repos list of the template with the entries that the caller passes.
Scenario: The template's own repo name leaves the render
- WHEN The template's config holds
infra.reposwith the repoexample/one, and the caller passes the repoexample/twoatagent_access: plan. - THEN The rendered config holds
example/twoatplan, holds noexample/one, andSettings.model_validateaccepts the rendered config.
Requirement: A template with no infra section
The renderer MUST render a template whose config holds no infra section when the settings hold no infra repo.
Scenario: A cluster with no infra repo renders
- WHEN The settings hold no
infra.reposentry, and the template's config holds noinfrasection. - THEN The render returns a manifest whose
devops-cli.yamlholds noinfrakey, andSettings.model_validateaccepts it.
Requirement: Drift exit code with no eligible repo
run_drift_all SHALL return exit code 1 when no entry of infra.repos has agent_access of plan or higher.
Scenario: No eligible infra repo
- WHEN
devops infra drift --allruns with everyinfra.reposentry atagent_access: none. - THEN The command exits 1 and prints
No repo in infra.repos has agent access level plan or higher.
Requirement: Pending a person after the merge
The cluster MUST run the drift check of the environment repository from CronWorkflow cronwf/infra-drift after the release and deploy-stack.
Scenario: The scheduled drift reads the environment repo
- WHEN A person triggers Workflow
infra-drift-manualfrom CronWorkflowcronwf/infra-driftin namespacedevopsafter the release anddeploy-stack. - THEN The Workflow ends
Succeeded, and its pod log holds the report line ofdevops infra drift --allfor the environment repository.
Existing Tool Considered
The alternatives check of 2026-11-27 in the issue body gives the verdict none, and it names no tool. The check found no open tool that reads the infra.repos settings of this project or that fails the drift command on an empty list. The proposal keeps the fix in render_devops_configmap_content and run_drift_all. The written cost is about 3,000 tokens to build the two edits and the four tests. The keep and fix of that code costs about 1,500 tokens a year, and the elapsed time is about half a day.
Key questions
- Which code writes the
infra.reposentries into the ConfigMap?:render_devops_configmap_contentwrites the section, as it writesservice.render_active_devops_configmappasses the entries of the active settings. The renderer writes each entry as the model dump of the settings entry, so the validation of the rendered config accepts it. (best practice) [sources: src/devops_cli/k8s/configmap.py:81, src/devops_cli/config/settings.py:2759, tests/k8s/test_k8s_configmap.py]- Chosen: Set the section in the renderer from the settings. The renderer already replaces
servicefrom the settings, and its validation of the rendered config catches a bad entry. - Rejected: Keep the section in the committed template. The repository names would enter git, which the issue forbids.
- Rejected: Mount
config.yamlin the cluster as a whole. It puts credentials and workstation-only settings into the cluster.
- Chosen: Set the section in the renderer from the settings. The renderer already replaces
- Which exit code does
devops infra drift --allreturn when noinfra.reposentry is eligible?: Exit code 1.run_drift_allreturns 0 today, and the spec gives 1 for a failure. The messageNo repo in infra.repos has agent access level plan or higher.already names the setting, so only the return value changes. (best practice) [sources: openspec/specs/infra-drift/spec.md, src/devops_cli/infra/drift.py:268, src/devops_cli/lang/en/messages.py:1553]- Chosen: Exit 1, the failure code. The spec gives 1 for a failure, and a missing configuration is a failure.
- Rejected: Exit 0, as today. A no-op that ends green hides the misconfiguration.
- Rejected: Exit 2, the drift code. No host has drift, so 2 would report a drift that does not exist.
- Which fields does each
infra.reposentry hold in the ConfigMap?: Each entry holdsrepo,pathandagent_access, as the settings model dumps it with noNonevalue. The drift gate readsagent_access, and the target resolution readspath. A field that the settings leave unset keeps its model default. (best practice) [sources: src/devops_cli/infra/drift.py, src/devops_cli/config/settings.py:2759, CONTEXT.md]- Chosen: The model dump of each settings entry. The drift command reads the same fields, and the model dump keeps the settings validation.
- Rejected: The repository names alone. The drift gate would read no access level, so each entry would fall to
none.
- How does the live proof show that the cluster reads the environment repository?: A person triggers Workflow
infra-drift-manualfrom CronWorkflowcronwf/infra-driftafter the release anddeploy-stack. The pod log must hold the report line ofdevops infra drift --all. The spec already asks for a live drift check on the environment repository. (best practice) [sources: openspec/specs/infra-drift/spec.md, src/devops_cli/infra/drift.py]- Chosen: One manual Workflow run and its pod log. It reads the deployed ConfigMap, the Secret and the egress of the drift pod in one run.
- Rejected: Wait for the next daily schedule. It delays the proof by up to one day and gives no faster signal.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 27, 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 (10)
Searches run:
Sources:
devops-cli-service commentedon Nov 28, 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 28, 2026
Released in v0.240.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.240.1
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 23:51 UTC