Skip to content

refactor(gate): drop gate checks that hold a manifest value #7231

Backlog

Description

@dan-petty

Update 2026-11-26 (infra move): Step 17 (#7290) removes much of this list.

It deletes gateway_database, object_store, otel_endpoints, ollama_service, monitoring, environment_freeze and k8s/overlays/homelab/devops. argocd_overrides and host_overrides are already gone. Count the modules again after that merge. llm_gateway now checks a product dashboard.


Problem or Motivation

The gate row of devops ci that reads the manifests holds 166 check_* functions in 25 modules of tests/gate/k8s_checks/. Many of them assert a plain value of a committed manifest, as the removed tests of #6060 and #7229 did. Example: tests/gate/k8s_checks/stage_job.py (check_the_stage_cronjob_is_a_suspended_template_of_the_runner_image) compares the namespace, the restart policy, the container name and resource numbers of the stage CronJob with literals. A change of such a value fails the gate with no change of code.

Owner direction of 2026-11-25: "remove any project tests that force a specific version or configuration that prevents the project from being updated cleanly". #7229 removed the pytest tests of this class. The gate checks are rows of devops ci, not pytest tests, so #7229 left them.

The census of 2026-11-25 read 3 of the 25 modules in full. It names these as holders of plain values: stage_job.py, runner.py (lines 63 to 93), gateway_database.py (probe and retention numbers), object_store.py (CPU and memory numbers), telemetry_resource.py, otel_endpoints.py, ollama_service.py, monitoring.py, argocd_overrides.py, host_overrides.py, deploy_stack.py, llm_gateway.py, slo_rules.py. The other modules are not read.

Proposed Solution

Disposition: remove gate checks. No source code changes.

  • Read each module and class each check: a plain value of a manifest (remove), a generic rule over each member of a set with no literal (keep), a safety property such as an admission policy or a network policy (the owner decides).
  • Most environment manifests moved to the homelab repository (tests/gate/k8s_checks/environment_freeze.py, step 12 of docs/HOMELAB_REPO_SWITCH.md). Step 17 deletes the environment files, so the checks of those files go with them. Do the checks of the product folder k8s/devops first.

Proof: uv run devops ci --check --only k8s passes, and git diff --stat origin/main -- src shows no change.

Existing Tool Considered

kube-linter, the kustomize build of the k8s row, Trivy config and the admission policies of the cluster check the form of manifests. No new code.

Alternatives check of 2026-12-01: not-applicable.
Class: refactor, no model call.
Tool: none found.

Proposed design

Problem statement

The k8s row of devops ci asserts literal values of committed manifests. A manifest change then fails the gate with no code change. Step 17 (#7290) deleted the environment modules, so 14 check modules remain in tests/gate/k8s_checks/. This change removes the plain-value checks. It keeps the generic rules and the safety-property checks. It changes no source code.

Acceptance criteria

Requirement: Stage CronJob literal check removed

The gate SHALL remove the check that compares the stage CronJob with literal values.

Scenario: The stage literal check is absent

  • WHEN git grep -n 'def check_the_stage_cronjob_is_a_suspended_template_of_the_runner_image' -- tests/gate/k8s_checks runs
  • THEN it prints nothing

Requirement: No literal resource number in the stage gate

The gate module tests/gate/k8s_checks/stage_job.py SHALL assert no literal CPU or memory number.

Scenario: The stage module has no resource literal

  • WHEN git grep -nE '"250m"|"1Gi"|"2Gi"' -- tests/gate/k8s_checks/stage_job.py runs
  • THEN it prints nothing

Requirement: The k8s row passes

The k8s row of devops ci SHALL pass after the checks are removed.

Scenario: The k8s row passes

  • WHEN uv run devops ci --check --only k8s runs
  • THEN it exits 0 and prints the pass result of the k8s row

Requirement: No source change

The change SHALL NOT change a file under src.

Scenario: The source tree is unchanged

  • WHEN git diff --stat origin/main -- src runs
  • THEN it prints nothing

Requirement: Safety-property checks stay

The gate SHALL keep each check that asserts a safety property, such as the admission policy and the network policy.

Scenario: The safety modules keep their checks

  • WHEN git grep -n 'def check_' -- tests/gate/k8s_checks/job_admission_policy.py tests/gate/k8s_checks/network_policies.py runs
  • THEN it prints at least one definition line for each file

Existing Tool Considered

No open tool covers the need. The alternatives check of 2026-11-25 in the issue body gives not-applicable for class refactor with no search, and it names no tool. The change builds no code, so it has no build cost. The issue names kube-linter, the kustomize build of the k8s row, Trivy config and the cluster admission policies. They check the form of the manifests and stay.

Key questions

  • Which gate checks does the change remove, and which does it keep?: Remove a check that asserts a literal value of a manifest, such as check_the_stage_cronjob_is_a_suspended_template_of_the_runner_image. Keep a check that asserts a generic rule over each member of a set with no literal. Keep a check that asserts a safety property. (best practice) [sources: tests/gate/k8s_checks/stage_job.py:49, tests/gate/k8s_checks/stage_job.py:151]
    • Chosen: Remove only the plain-value checks. It follows the owner direction of 2026-11-25 and keeps the generic and safety rules.
    • Rejected: Remove each gate check. It drops the generic and safety rules that the issue keeps.
    • Rejected: Keep each gate check. It keeps the failure that the issue fixes: a manifest change fails the gate with no code change.
  • Do the safety-property checks stay?: Yes. The admission policy and the network policy checks stay. AGENTS.md rule 5 forbids a lower security threshold without the owner. (best practice) [sources: AGENTS.md, tests/gate/k8s_checks/job_admission_policy.py, tests/gate/k8s_checks/network_policies.py]
    • Chosen: Keep the safety-property checks. AGENTS.md rule 5 forbids a lower security threshold without the owner.
    • Rejected: Remove the safety-property checks. It lowers a security threshold, which only the owner can allow.
  • Which modules remain in tests/gate/k8s_checks/ after step 17?: 14 check modules remain: argo_workflows, dashboards, deploy_stack, devops_runtime, job_admission_policy, llm_gateway, network_policies, product_tree, rag_ingest, roadmap_service, runner, searxng_render, slo_rules and stage_job. The modules that step 17 deletes are absent. [sources: docs/HOMELAB_REPO_SWITCH.md:302]
  • Does this change wait on step 17 (refactor(k8s): delete the environment files from devops-cli #7290)?: No. Step 17 is done in the repository at this commit. The modules that it deletes, such as environment_freeze and monitoring, are absent from tests/gate/k8s_checks/. [sources: docs/HOMELAB_REPO_SWITCH.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/refactor
    source/agent
    status/new
    value/medium
    effort/high
    scope/gate
    priority/p2-medium
    on Nov 25, 2026
  2. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  3. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

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/highpriority/p2-mediumscope/gatesource/agentstatus/readytype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions