Repository navigation
Description
Split from #4369.
The live ConfigMap devops/devops-cli-config is not in git. Issue #4369 asks that the pull request comment lists each difference between that ConfigMap and k8s/devops/configmap.example.yaml that the issue does not change. Only a process with cluster access can read the live ConfigMap. The implement job runs in a runner pod that holds no Kubernetes token (k8s/README.md, Runner Jobs), so it cannot read the ConfigMap or write the list. The rest of #4369 is workable without this part, so refine defers it here. Acceptance criteria: 1. One comment on the pull request lists each key whose value differs between the live ConfigMap and the template, with the live value and the template value. 2. The comment states that the ai.tasks keys analysis and stage now agree. 3. The comment names no value of Secret devops/devops-cli.
Proposed design
Problem statement
The live ConfigMap devops/devops-cli-config is not in git, so a change to k8s/devops/configmap.example.yaml can revert a live value and nothing shows the revert. The implement job's runner pod mounts that ConfigMap as the config volume, so the job can read the live YAML at /config/devops-cli.yaml with no Kubernetes token. The pull request comment must list each leaf key whose live value differs from the template, leave out the keys that the change itself sets and the service section that deploy-stack renders from the active config, state that the ai.tasks keys analysis and stage agree, and name no value of Secret devops/devops-cli.
Acceptance criteria
Requirement: The live values come from the mounted ConfigMap
The job MUST read the live ConfigMap text from /config/devops-cli.yaml, the file that its config volume mounts from ConfigMap devops-cli-config, and MUST send no request to the Kubernetes API.
Scenario: The job renders the difference section
- WHEN the job renders the difference section in its runner pod
- THEN it reads
/config/devops-cli.yamland makes no Kubernetes API request
Requirement: The rendered service section is left out
The change SHALL leave out of the list each key under service, because deploy-stack replaces that section with the repositories and the GitHub App of the active config.
Scenario: The live service section differs from the template
- WHEN the live ConfigMap names
real/repoinservice.reposand the template namesowner/repo - THEN the comment holds no row for
service.repos
Requirement: Each differing key is listed
The change SHALL list each leaf key whose value differs between the live ConfigMap and the template, with the live value and the template value.
Scenario: A live value differs from the template
- WHEN the live ConfigMap sets
ai.max_retriesto2and the template sets1 - THEN the comment holds a row that names
ai.max_retries, the live value2and the template value1
Requirement: The keys that the change sets are left out
The change SHALL leave out of the list each leaf key whose value the change sets in the template.
Scenario: The change sets a key that differs
- WHEN the change sets
ai.tasks.analysis.modeland the live ConfigMap names another model - THEN the comment holds no row for
ai.tasks.analysis.modelin the list of differences
Requirement: The analysis and stage entries agree
The comment SHALL state that the ai.tasks keys analysis and stage agree when both name the same effective model and the same effective context window, where a field that stage does not set takes the value of analysis.
Scenario: Both entries name the same model and window
- WHEN the live ConfigMap and the template name
deepseek-v4.1-flash-1017withcontext_window256000foranalysisand forstage - THEN the comment holds the line
The ai.tasks keys analysis and stage agree.
Requirement: No Secret value is named
The comment MUST hold no value of Secret devops/devops-cli.
Scenario: The job renders the section
- WHEN the job renders the difference section and the live text holds a credential-shaped value
- THEN each value passes through
mask_dict_secretsand the rendered comment holds no text that Secretdevops/devops-cliholds
Requirement: The section is only for a change to the template
The job SHALL write the section only on the pull request of a change that touches k8s/devops/configmap.example.yaml.
Scenario: A change touches no template
- WHEN the change touches no file under
k8s/devops/ - THEN the pull request comment holds no ConfigMap difference section
Requirement: The section joins the one run comment
The job MUST write the section into the one pull request comment that its run posts or updates, and MUST post no second comment.
Scenario: The job writes its run comment
- WHEN the job renders the section and the run has posted no comment yet
- THEN it posts one comment that holds the step table and the difference section
Existing Tool Considered
PyYAML (pyproject.toml:22) reads both YAML texts, and round_trip.leaves and round_trip.changes (src/devops_cli/config/round_trip.py:69, :85) already give each leaf key path whose value differs, with the value of each side, so the change needs no new library. They lack the Markdown section and the ai.tasks line, which the change adds in about 40 lines. deepdiff would cover a generic deep difference but is not a dependency (pyproject.toml:11-83) and would duplicate the per-leaf-key walk the repository already keeps and tests. A hand-written walk instead of round_trip.changes costs about 90 lines, about 6,000 tokens to write, about 2,000 tokens a year to keep and fix, and about 3 hours.
Key questions
- Which process reads the live ConfigMap and writes the difference list?: The implement job's runner reads
/config/devops-cli.yaml, the file that itsconfigvolume mounts from ConfigMapdevops-cli-config, and writes the section into the one comment that its run posts or updates on the pull request. The pod holds no Kubernetes token and sends no API request. (best practice) [sources: k8s/devops/cronjob-runner.yaml:33, k8s/devops/cronjob-runner.yaml:57, k8s/devops/cronjob-runner.yaml:89, k8s/devops/cronjob-runner.yaml:114, k8s/README.md:659, src/devops_cli/roadmap/implement/implement_run.py:1432]- Chosen: The runner reads the mounted
configvolume. The pod template mounts ConfigMapdevops-cli-configas theconfigvolume at/configand setsDEVOPS_CLI_CONFIG=/config/devops-cli.yaml, so the job reads the live text with no token and no API call. - Rejected: The roadmap Service reads the ConfigMap through the API. It needs a new rule in Role
roadmap-service-jobsand a new comment path on a pull request that it does not open. - Rejected: A person runs a command and posts the comment. A person must remember the step, and no test checks the comment.
- Chosen: The runner reads the mounted
- Which values of the template are compared with the live ConfigMap?: The template's own sections. The
servicesection is left out, becausedeploy-stackreplaces it with the repositories and the GitHub App of the active config, so its template values are placeholders that never reach the live ConfigMap. (best practice) [sources: src/devops_cli/k8s/configmap.py:59, src/devops_cli/k8s/configmap.py:81, k8s/README.md:805, k8s/devops/configmap.example.yaml:113]- Chosen: Leave out the
servicesection._service_blockreplaces the whole section at render time, soowner/repoand app ID1can never be reverted by the template; listing them adds noise on every pull request and hides real drift. - Rejected: Compare every key of the template. It lists
service.reposandservice.github_app.app_idon every pull request, which are the template's placeholders and not live drift. - Rejected: Render the template with the active settings.
render_devops_configmap_contentvalidates the rendered config withSettings, so a change that adds a setting fails to render against the image that runs the job (k8s/README.md:703records that an older image cannot start with a newer key).
- Chosen: Leave out the
- How does the job tell the keys that the change itself sets?: The job compares the template at the merge base with the template at the branch, and leaves out each leaf key that differs. (best practice) [sources: src/devops_cli/git/operations.py:579, src/devops_cli/git/operations.py:593, src/devops_cli/config/round_trip.py:85]
- Chosen: Compare the template at the merge base and at the branch.
resolve_merge_baseandlist_changed_filesgive the two revisions from the job's checkout, and the two templates give the leaf keys that the change sets with no other input. - Rejected: List every difference. The comment then names the keys that the change sets, which the acceptance criterion leaves out.
- Rejected: Read the change folder. The folder holds no list of the keys that the change sets.
- Chosen: Compare the template at the merge base and at the branch.
- When do the
ai.taskskeysanalysisandstageagree?: They agree when both name the same effectivemodeland the same effectivecontext_window, where a field thatstagedoes not set takes the value ofanalysis. (best practice) [sources: k8s/devops/configmap.example.yaml:65, k8s/devops/configmap.example.yaml:71, docs/ROADMAP_WORKFLOW.md:342]- Chosen: Same model and same effective context window. A field of
ai.tasks.stagethat is not set takes the value ofai.tasks.analysis, so a window that onlyanalysissets still changes the plan run. - Rejected: Same model only. A smaller window ends the tools of a plan run too soon, as the note of fix(roadmap): the stage job fails when the window starves the planner #3880 in
k8s/devops/configmap.example.yaml:56-60records.
- Chosen: Same model and same effective context window. A field of
- Which library computes the per-key difference?: None new. PyYAML reads the two mappings, and
round_trip.leavesandround_trip.changesgive each leaf key path whose value differs with the value of each side; the change adds only the Markdown renderer and theai.tasksline. (best practice) [sources: pyproject.toml:22, src/devops_cli/config/round_trip.py:69, src/devops_cli/config/round_trip.py:85]- Chosen:
round_trip.changeswithround_trip.leaves. It is in the repository and tested, and it returns tuple key paths, so a key that holds a dot such as a model name does not break the walk (src/devops_cli/config/round_trip.py:72). - Rejected:
deepdiff. It adds a runtime dependency for a per-leaf-key difference the repository already computes; it is not inpyproject.toml:11-83. - Rejected: A hand-written walk. It duplicates
round_trip.changes: about 90 lines, about 6,000 tokens to write, about 2,000 tokens a year to keep and fix, and about 3 hours.
- Chosen:
- Does the live ConfigMap hold a credential?: No. The template states that it holds no credential, and the Job reads the credentials from Secret
devops/devops-clithroughenvFrom. The section still passes each value throughmask_dict_secrets, so a credential that a live ConfigMap held would not appear. [sources: k8s/devops/configmap.example.yaml:1, k8s/devops/cronjob-runner.yaml:52, src/devops_cli/security/sanitizer.py:462] - Where does the difference section go?: It joins the one comment that the run posts or updates on the pull request, after the scoped checks. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py:1432, src/devops_cli/roadmap/implement/implement_run.py:1448]
- Chosen: The run's existing comment.
_commentalready keeps one comment per run, marks it with the run id and updates it, so the pull request keeps one comment. - Rejected: A second comment. The issue asks for one comment, and the run already keeps one comment per run.
- Chosen: The run's existing comment.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 10, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
choreprefix of the title gives the type.(k8s)scope of the title gives the scope.The item is a deferred split that reports configuration drift and does not block the fix in #4369.The comment shows configuration drift to reviewers and keeps Secret values out of the pull request.The implement job has no cluster access, so the work needs a new path to read the live ConfigMap and to write the comment.Both items concern the live ConfigMap and the template, but #4369 corrects the analysis and stage values and the candidate reports the differences in a comment.[-]chore(k8s): list the differences between the live ConfigMap and the template[/-][+]chore(k8s): List the live ConfigMap differences in the PR comment[/+]devops-cli-service commentedon Nov 10, 2026
The job shortened the title of this item. The summary had 64 characters, and the limit is 60. The type and the scope stay.
chore(k8s): list the differences between the live ConfigMap and the templatechore(k8s): List the live ConfigMap differences in the PR commentdevops-cli-service commentedon Nov 11, 2026
Refine cannot set this item to Ready at 6a09588. A bot opened the item, so a review of the issue and of the proposal must approve it first. The review found the defects below. A person edits the body to answer them. The next refine round looks at the item again only after a body edit.
false_premiseat key_questions, first question: The plan says the runner pod reads the live ConfigMap from a mounted volume. The issue says the pod cannot read the ConfigMap. Evidence: "The implement job runs in a runner pod that holds no Kubernetes token (k8s/README.md, Runner Jobs), so it cannot read the ConfigMap or write the list."