Repository navigation
Description
Split from #3949.
The issue asks for a k8s test that reads the ingest schedule from a cluster CronJob. No manifest in k8s/devops defines a CronJob that runs ai rag ingest: devops-cli and devops-cli-runner are suspended templates that never run on a schedule (k8s/devops/cronjob.yaml:1, k8s/devops/cronjob-runner.yaml:2). The test cannot be written until the change that adds the scheduled ingest lands.
Acceptance criteria:
- The test SHALL read the
spec.schedulefield of the RAG ingest CronJob from the renderedk8s/devopskustomization and assert that it is a non-empty cron expression. - The test SHALL assert that the CronJob's container args run
ai rag ingest. - The test MUST fail when no such CronJob exists.
Proposed design
Problem statement
The body says that no manifest in k8s/devops schedules ai rag ingest. That is out of date. The scheduled ingest exists as the Argo CronWorkflow rag-ingest (k8s/devops/cronworkflow-rag-ingest.yaml). It is listed in the kustomization and runs */3 * * * *. It holds no container. It points at the WorkflowTemplate rag-ingest through workflowTemplateRef, and that template runs devops ai rag ingest. tests/commands/k8s/test_k8s_rag_ingest_manifests.py already checks that the schedule equals */3 * * * * and that concurrencyPolicy is Forbid. It does not check these three things: the rendered schedule is a valid non-empty cron expression, the CronWorkflow's referenced template runs ai rag ingest, and the test fails when no scheduled ingest is rendered. This issue adds those checks to the existing test module.
Acceptance criteria
Requirement: Schedule is read from the rendered kustomization
The test SHALL read spec.schedule of the scheduled RAG ingest resource (CronWorkflow or CronJob) from the rendered k8s/devops kustomization and SHALL assert that it is a non-empty five-field cron expression.
Scenario: Valid schedule
- WHEN The rendered kustomization holds the CronWorkflow
rag-ingestwithspec.scheduleset to*/3 * * * * - THEN The test passes and the asserted schedule is
*/3 * * * *
Requirement: Ingest command is checked through the template reference
The test SHALL resolve the workflowTemplateRef name of the CronWorkflow to the rendered WorkflowTemplate and SHALL assert that its container runs ai rag ingest as the args after the devops command.
Scenario: Command runs ai rag ingest
- WHEN The WorkflowTemplate
rag-ingesthas container command[devops]and args[ai, rag, ingest] - THEN The assertion passes
Requirement: Wrong command fails
The test MUST fail when the container args of the template that the scheduled resource runs are not ai rag ingest.
Scenario: Other command
- WHEN The helper that checks the args is called with a document whose args are
[ai, rag, query] - THEN The helper raises an AssertionError whose message names the args
Requirement: Missing resource fails
The test MUST fail, and MUST NOT skip, when the rendered kustomization holds no CronWorkflow or CronJob that runs ai rag ingest.
Scenario: No scheduled ingest
- WHEN The helper that selects the scheduled ingest is called with rendered documents that hold no CronWorkflow or CronJob
- THEN The helper raises an AssertionError that says no scheduled RAG ingest resource exists
Requirement: Empty schedule fails
The test MUST fail when spec.schedule is missing, empty or not a five-field cron expression.
Scenario: Empty schedule
- WHEN The helper that checks the schedule is called with a document whose
spec.scheduleis an empty string - THEN The helper raises an AssertionError whose message names
spec.schedule
Existing Tool Considered
No alternatives check has run. kubectl kustomize renders the kustomization, and the test module already uses it (tests/commands/k8s/test_k8s_rag_ingest_manifests.py:31-40). PyYAML parses the output (tests/commands/k8s/test_k8s_rag_ingest_manifests.py:10). kubeconform checks schemas only. No existing tool asserts a cron schedule or the container args of a scheduled resource, so the change adds a few assertions and small helpers to the existing test module and needs no new dependency. The cost is about 40 lines. It needs about 8,000 tokens to build and fix, and under one hour.
Key questions
- Does
k8s/devops/cronworkflow-rag-ingest.yamldefine the scheduled ingest that runsai rag ingest, so that this test can be written now?: Yes. The CronWorkflowrag-ingesthasspec.schedule: "*/3 * * * *"andconcurrencyPolicy: Forbid. It referencesworkflowTemplateRefrag-ingest. That WorkflowTemplate runs containercommand: [devops]withargs: ["ai", "rag", "ingest"]. The kustomization lists both files. The body is out of date, and the blocker it names is gone. The test needs no dependency on another issue. [sources: k8s/devops/cronworkflow-rag-ingest.yaml:10, k8s/devops/cronworkflow-rag-ingest.yaml:13, k8s/devops/workflowtemplate-rag-ingest.yaml:40, k8s/devops/workflowtemplate-rag-ingest.yaml:41, k8s/devops/kustomization.yaml:9, k8s/devops/kustomization.yaml:10] - Does an existing test already cover part of this?: Partly.
test_cronworkflow_schedule_follows_poll_intervalpins the schedule to*/3 * * * *by reading the YAML file directly.test_workflow_template_mutex_and_cronworkflow_concurrency_policychecksconcurrencyPolicy. No test checks the ingest args, the link from the CronWorkflow to the template, the shape of the cron expression in the rendered output, or that the test fails when no scheduled ingest exists. The new tests cover those gaps in the same module. [sources: tests/commands/k8s/test_k8s_rag_ingest_manifests.py:109, tests/commands/k8s/test_k8s_rag_ingest_manifests.py:123] - Which resource kinds does the test accept as the scheduled ingest?: Accept a CronWorkflow or a CronJob that is not suspended. For a CronWorkflow, follow
spec.workflowSpec.workflowTemplateRef.nameto the rendered WorkflowTemplate and read the container args there. For a CronJob, readspec.jobTemplate.spec.template.spec.containers[*]. Both kinds usespec.schedule. The project has shipped the ingest as a CronWorkflow since feat(k8s): Add an Argo workflow to keep the RAG index current #1653. (best practice) [sources: k8s/devops/cronworkflow-rag-ingest.yaml:2, openspec/changes/archive/2026-11-08-1653-argo-workflow-rag-index/proposal.md:10]- Chosen: Accept CronWorkflow and CronJob, and follow the template reference. The test checks the behavior, a scheduled ingest, and matches the body's wording (CronJob) and the repository (CronWorkflow).
- Rejected: Accept only CronJob. No CronJob runs the ingest, so the test would always fail.
- Rejected: Accept only CronWorkflow. It ties the test to one kind. The CronJob path costs only a few lines.
- How does the test get the rendered manifests?: Reuse the existing helper
_rendered_devops_manifests(), which runskubectl kustomize k8s/devopsand parses the output withyaml.safe_load_all. The kustomization lists directories (crawl4ai,searxng,roadmap-service) as well as files, and the helper resolves them. The module's other tests already depend on it, so the new test adds no new requirement on the runner. (best practice) [sources: tests/commands/k8s/test_k8s_rag_ingest_manifests.py:31, k8s/devops/kustomization.yaml:11]- Chosen: Reuse
_rendered_devops_manifests()(kubectl kustomize). It follows the project's precedent in the same module. It renders the real kustomization, including directory resources and any patches. - Rejected: Load the files in the
resourceslist with a YAML loader. It duplicates the kustomization logic, must skip directory entries, and ignores patches or transformers.
- Chosen: Reuse
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 8, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.(k8s)scope of the title gives the scope.The test cannot start until the change that adds the scheduled ingest lands.The test guards a schedule and gives no direct change to users.One test reads the rendered kustomization and asserts two fields.Both items test the scheduled RAG ingest, but #3949 verifies per-repository indexing and the candidate verifies the CronJob schedule and container args.devops-cli-service commentedon Nov 9, 2026
Refine cannot set this item to Ready at 6121d09. 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_premiseat problem_statement: The plan says the scheduled ingest already exists and the blocker is gone. The issue says the test cannot be written until the change lands. Evidence: "The test cannot be written until the change that adds the scheduled ingest lands."spec_delta_wrongat acceptance_criteria: The plan changes the issue's CronJob requirement to a CronWorkflow-or-CronJob requirement. The issue names a CronJob. Evidence: "The test SHALL read thespec.schedulefield of the RAG ingest CronJob from the renderedk8s/devopskustomization and assert that it is a non-empty cron expression."missing_pathat problem_statement: The issue says the scheduled ingest does not exist yet. The plan names a manifest for it that no group creates. Evidence: "The scheduled ingest exists as the Argo CronWorkflowrag-ingest(k8s/devops/cronworkflow-rag-ingest.yaml)."