Repository navigation
Description
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_fieldruns 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_workflowtemplateruns the check on a fixture WorkflowTemplate with an unknown field. - THEN The test passes and the check shows an
argo linterror 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_cronworkflowruns the check on a fixture CronWorkflow with an unknown field. - THEN The test passes and the check shows an
argo linterror 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_coverageruns the check on a fixture tree with an unlisted deployed YAML manifest directly underk8s/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 k8sruns on the repository. - THEN The command exits 0 and reports no removed Argo field, no
argo linterror 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 --offlineon 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,mutexand singularsemaphore?: Add a focused YAML key scan intests/gate/k8s_checks/argo_workflows.pyfor Argo kindsWorkflow,WorkflowTemplateandCronWorkflow. 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 lintdoes 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 ink8s/devops/kustomization.yaml?: Compare theresourceslist ofk8s/devops/kustomization.yamlwith the direct.yamland.ymlfiles underk8s/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 buildignores 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.
- Chosen: Compare resources to direct YAML files.
- Which direct YAML files under
k8s/devops/count as deployed manifests?: Count each direct.yamlor.ymlfile exceptkustomization.yamland*.example.yaml. The fileconfigmap.example.yamlis 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.yamlto 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.
- Chosen: Exclude
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 28, 2026
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.devops-cli-service commentedon Nov 28, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.