Skip to content

test(k8s): add Argo Workflows manifest gate checks #7585

Backlog

Description

@devops-cli-service

Split from #4566.

Problem: The k8s row of devops ci does not refuse the fields that Argo Workflows v4.0 removed, does not run argo lint on each template, and does not prove that each manifest under k8s/devops/ is in a kustomization. This part was deferred from #4566 because the stage plan could not fit its paths into one task group of at most 5 paths. The rest of #4566 adds the fieldSpec, the no-op template, the Measurement section entry and the RAG alert. Acceptance criteria: The k8s row MUST refuse schedule, mutex and singular semaphore in each Argo Workflows manifest of kind Workflow, WorkflowTemplate or CronWorkflow under k8s/. Proof: uv run devops ci --check --only k8s fails on a fixture with a removed field and passes on k8s/. The k8s row MUST run argo lint --offline on each WorkflowTemplate and CronWorkflow under k8s/. Proof: uv run devops ci --check --only k8s fails on a fixture template with an unknown field and passes on each template under k8s/. Each YAML manifest directly under k8s/devops/, except kustomization.yaml, MUST be a resource of k8s/devops/kustomization.yaml. Proof: uv run devops ci --check --only k8s passes on k8s/devops/ and fails on a fixture tree with an unlisted YAML manifest directly under k8s/devops/.

Proposed design

Problem statement

The k8s row of devops ci does not guard Argo Workflows v4.0 manifests. It accepts schedule, mutex and singular semaphore. It does not run argo lint --offline on templates. It does not prove that each deployed YAML manifest under k8s/devops/ is in the kustomization. This change adds those checks and keeps example YAML files out of the coverage check.

Acceptance criteria

Requirement: Removed Argo fields are refused

The k8s row SHALL fail when an Argo Workflows manifest of kind Workflow, WorkflowTemplate or CronWorkflow under k8s/ uses schedule, mutex or singular semaphore.

Scenario: Removed field fixture

  • WHEN uv run pytest tests/gate/k8s_checks/argo_workflows.py -k removed_field runs the check on a fixture manifest with a removed Argo field.
  • THEN The test passes and the check reports the fixture file and the removed field.

Requirement: WorkflowTemplate is linted

The k8s row SHALL run argo lint --offline on each WorkflowTemplate under k8s/.

Scenario: Unknown field in WorkflowTemplate

  • WHEN uv run pytest tests/gate/k8s_checks/argo_workflows.py -k argo_lint_workflowtemplate runs the check on a fixture WorkflowTemplate with an unknown field.
  • THEN The test passes and the check shows an argo lint error for the fixture file.

Requirement: CronWorkflow is linted

The k8s row SHALL run argo lint --offline on each CronWorkflow under k8s/.

Scenario: Unknown field in CronWorkflow

  • WHEN uv run pytest tests/gate/k8s_checks/argo_workflows.py -k argo_lint_cronworkflow runs the check on a fixture CronWorkflow with an unknown field.
  • THEN The test passes and the check shows an argo lint error for the fixture file.

Requirement: Deployed devops manifests are listed

Each deployed YAML manifest directly under k8s/devops/ MUST be a resource of k8s/devops/kustomization.yaml.

Scenario: Unlisted manifest

  • WHEN uv run pytest tests/gate/k8s_checks/argo_workflows.py -k kustomization_coverage runs the check on a fixture tree with an unlisted deployed YAML manifest directly under k8s/devops/.
  • THEN The test passes and the check reports the unlisted manifest.

Requirement: Current tree passes

The k8s row SHALL pass on the current k8s/ tree after the three checks are added.

Scenario: Current tree passes

  • WHEN uv run devops ci --check --only k8s runs on the repository.
  • THEN The command exits 0 and reports no removed Argo field, no argo lint error and no unlisted manifest.

Existing Tool Considered

No alternatives check has run. The open, maintained Argo Workflows CLI command argo lint --offline covers template syntax for WorkflowTemplate and CronWorkflow. kustomize build resolves the listed resources but does not prove that every deployed YAML manifest is listed. The proposal adds a focused Python gate check for the removed-field ban and the kustomization coverage. Cost for the two custom checks: about 3,000 tokens to build, 500 tokens per year to keep and fix, and 1 hour.

Key questions

  • Which tool lints Argo Workflows manifests offline?: Use the open, maintained Argo Workflows CLI command argo lint --offline on each WorkflowTemplate and CronWorkflow file. (best practice) [sources: src/devops_cli/commands/argo.py, docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md, k8s/devops/workflowtemplate-infra-drift.yaml, k8s/devops/cronworkflow-infra-drift.yaml, CHANGELOG.md]
    • Chosen: argo lint --offline. It is the Argo project's own offline validator and the repository already pins the argo CLI.
    • Rejected: kubeconform with CRD schemas. It needs external schemas and does not run Argo's own template checks.
    • Rejected: Custom YAML parser. It duplicates Argo validation and grows with each Argo field.
  • How does the k8s row detect the removed fields schedule, mutex and singular semaphore?: Add a focused YAML key scan in tests/gate/k8s_checks/argo_workflows.py for Argo kinds Workflow, WorkflowTemplate and CronWorkflow. Reject each exact key anywhere in the manifest. (best practice) [sources: tests/gate/k8s_checks/argo_workflows.py, k8s/devops/cronworkflow-infra-drift.yaml, k8s/devops/workflowtemplate-infra-drift.yaml]
    • Chosen: Focused YAML key scan. It names the exact removed fields and gives a clear failure without a schema fetch.
    • Rejected: argo lint --offline only. The issue asks for the removed-field ban as a separate guard, and argo lint does not promise that exact check.
    • Rejected: kubeconform -strict. It needs CRD schemas and is broader than the three fields.
  • How does the k8s row prove that each direct YAML manifest under k8s/devops/ is in k8s/devops/kustomization.yaml?: Compare the resources list of k8s/devops/kustomization.yaml with the direct .yaml and .yml files under k8s/devops/. Fail on a deployed file that the list does not name. (best practice) [sources: k8s/devops/kustomization.yaml, k8s/devops/configmap.example.yaml]
    • Chosen: Compare resources to direct YAML files. kustomize build ignores unlisted files, so a comparison is the only proof of coverage.
    • Rejected: kustomize build only. It succeeds when a YAML file is missing from the resource list.
    • Rejected: kustomize edit add resource. It edits the file and does not check the existing list.
  • Which direct YAML files under k8s/devops/ count as deployed manifests?: Count each direct .yaml or .yml file except kustomization.yaml and *.example.yaml. The file configmap.example.yaml is documentation and is not a kustomization resource. (best practice) [sources: k8s/devops/kustomization.yaml, k8s/devops/configmap.example.yaml]
    • Chosen: Exclude *.example.yaml. The example file is not listed in the kustomization and would deploy placeholder values if added.
    • Rejected: Add configmap.example.yaml to the kustomization. It would deploy an example ConfigMap to the cluster.
    • Rejected: Count every YAML file. It would fail on the existing example file and change the issue's pass condition.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

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

    @devops-cli-service
    ContributorAuthor
    • Related: feat(k8s): add the CI gate WorkflowTemplate #4691, which asks for a different change. Both concern CI gates for Argo Workflows, but #4691 creates the CI gate WorkflowTemplate while the candidate adds field, lint, and kustomization checks to the devops ci command.
  3. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. 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/mediumpriority/p2-mediumscope/k8ssource/agentstatus/newtype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions