Skip to content

chore(k8s): List the live ConfigMap differences in the PR comment #4375

Open

Description

@devops-cli-service

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.yaml and 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/repo in service.repos and the template names owner/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_retries to 2 and the template sets 1
  • THEN the comment holds a row that names ai.max_retries, the live value 2 and the template value 1

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.model and the live ConfigMap names another model
  • THEN the comment holds no row for ai.tasks.analysis.model in 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-1017 with context_window 256000 for analysis and for stage
  • 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_secrets and the rendered comment holds no text that Secret devops/devops-cli holds

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 its config volume mounts from ConfigMap devops-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 config volume. The pod template mounts ConfigMap devops-cli-config as the config volume at /config and sets DEVOPS_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-jobs and 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.
  • Which values of the template are compared with the live ConfigMap?: The template's own sections. The service section is left out, because deploy-stack replaces 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 service section. _service_block replaces the whole section at render time, so owner/repo and app ID 1 can 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.repos and service.github_app.app_id on every pull request, which are the template's placeholders and not live drift.
    • Rejected: Render the template with the active settings. render_devops_configmap_content validates the rendered config with Settings, so a change that adds a setting fails to render against the image that runs the job (k8s/README.md:703 records that an older image cannot start with a newer key).
  • 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_base and list_changed_files give 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.
  • When do the ai.tasks keys analysis and stage agree?: They 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. (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.stage that is not set takes the value of ai.tasks.analysis, so a window that only analysis sets 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-60 records.
  • Which library computes the per-key difference?: None new. PyYAML reads the two mappings, and round_trip.leaves and round_trip.changes give each leaf key path whose value differs with the value of each side; the change adds only the Markdown renderer and the ai.tasks line. (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.changes with round_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 in pyproject.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.
  • 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-cli through envFrom. The section still passes each value through mask_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. _comment already 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.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/chore
    scope/k8s
    status/new
    value/medium
    effort/medium
    on Nov 10, 2026
  2. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    ContributorAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/chore. The chore prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P3-Low. The item is a deferred split that reports configuration drift and does not block the fix in #4369.
    • Value: Medium. The comment shows configuration drift to reviewers and keeps Secret values out of the pull request.
    • Effort: Medium. The implement job has no cluster access, so the work needs a new path to read the live ConfigMap and to write the comment.
    • Related: fix(k8s): the ConfigMap template names DeepSeek for analysis #4369, which asks for a different change. 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.
  3. added
    priority/p3-low
    on Nov 10, 2026
  4. changed the title [-]chore(k8s): list the differences between the live ConfigMap and the template[/-] [+]chore(k8s): List the live ConfigMap differences in the PR comment[/+] on Nov 10, 2026
  5. devops-cli-service commented on Nov 10, 2026

    @devops-cli-service
    ContributorAuthor

    The job shortened the title of this item. The summary had 64 characters, and the limit is 60. The type and the scope stay.

    • Before: chore(k8s): list the differences between the live ConfigMap and the template
    • After: chore(k8s): List the live ConfigMap differences in the PR comment
    • Source of the summary: the background model
  6. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    ContributorAuthor

    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_premise at 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."
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/mediumpriority/p3-lowscope/k8ssource/agentstatus/newtype/chorevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions