Skip to content

ci(k8s): the Argo CD build gate runs in devops ci on every change to k8s #1860

Closed

Description

@dan-petty

Friction

The Argo CD build gate has no caller. check_argocd_gate (k8s/argocd_gate.py, 316 lines) builds every Application that targets this repository with Kustomize from an exported archive and rejects template-domain placeholders outside the host fields of the homelab applications. Its only caller was release/cut.py:1068, at the release tip, and #1952 deleted the cut. So a broken application was found at release time and not in the pull request that broke it (#1343, #1688, #1689), and now nothing finds it. The cut also ran a live Argo CD diff report (k8s/argocd_live_report.py, 312 lines) whose tokens expired during the close of v0.2.37 and forced a hand-made cut. #1952 deleted the report with the cut.

Evidence

git grep check_argocd_gate -- src showed release/cut.py:74 and :1068 as the only users; report_argocd_live_diff was likewise reachable only from cut.py:75. On main after #1952, the search finds no user. render_at_revision in argocd_overrides.py is a separate function that commands/k8s/stack_lifecycle.py:906 uses for deploy-stack and stays. Kustomize is a pinned binary in src/devops_cli/tools_lock/tools.lock ([binary.kustomize]), and ci.yml:421 already installs a pinned tool in CI with devops install-tools --tool semgrep --only-missing. The gate passed at each release tip while the cut ran it. Nothing runs it since #1952. How long it takes was not measured. The ArgoCdApplicationOutOfSync alert added in v0.2.38 covers the drift the live report looked for.

Proposed remedy

Register the gate as a named check of devops ci in commands/ci.py, next to actionlint, calling check_argocd_gate(root, ref="HEAD"), with k8s/** as its trigger files so it is skipped when no k8s file changed (the existing cached-check mechanism). In ci.yml, run it in the static-analysis path when the changes job reports a k8s change, after devops install-tools --tool kustomize --only-missing. #1952 deleted argocd_live_report.py and its test, and no replacement is built.

Moving the placeholder-domain rule to Rego and conftest was run in scratch (conftest 0.71.1, a 20-line rule enforced it) and is deliberately not part of this item: argocd_overrides._host_fields is shared with deploy-stack, so a Rego copy would duplicate the list of allowed fields. If the owner wants it, it is a follow-up that generates the Rego data from _host_fields.

What it deletes

Nothing. #1952 deleted the cut's call to the gate with the cut.

Tests

tests/test_k8s_argocd_gate.py keeps its cases. A test asserts the check is registered with k8s/** trigger files and calls the gate with HEAD. A CI-level test asserts the workflow installs kustomize before the check. A rehearsal pull request that breaks a kustomization and one that puts example.com in a ConfigMap both fail the check naming the application.

Depends on

#1858 ("ci(image): a read-only reusable workflow verifies the service image, and the pull request build holds no write scope"), which adds the changes job this item extends. This item adds a k8s output to that job. It is step 8 of ADR 0012.

Acceptance criteria

  • uv run devops ci runs the gate when a k8s file changed and reports it skipped otherwise.
  • A broken kustomization and a placeholder in a ConfigMap each fail the check on a pull request and name the application.
  • The check's uncached run time is measured and recorded in the task file, and stays under one minute on the CI runner.
  • kustomize is installed from tools.lock and no new tool or unpinned download is added.

Activity

  1. added
    source/agent
    type/infra
    on Oct 22, 2026
  2. dan-petty commented on Oct 22, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.

    • Type: type/infra. The change involves CI configuration and tooling, which falls under infrastructure.
    • Priority: P2-Medium. This improves CI feedback but does not fix an urgent issue or security vulnerability.
    • Value: Medium. Improves developer experience by catching k8s issues earlier in the pull request process.
    • Effort: Medium. Requires modifying CI workflows, registering a new check, and updating tests.
  3. dan-petty commented on Oct 23, 2026

    @dan-petty
    OwnerAuthor

    Already covered: tests/test_k8s_argocd_apps.py::test_this_repository_passes_the_argocd_gate calls check_argocd_gate on every pull request in Tests & Coverage (about 1 s), and it has been on main since #1720. The trigger-file mechanism that this item assumed does not exist. Found while building #1651.

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

    source/agenttype/infra

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions