Repository navigation
Description
Friction
- feat(rag): Index managed repos, exclude private from unscoped search #1389 asked the roadmap Service to keep a RAG index of every managed repository, in a shared worker thread inside the Service.
- The owner chose Argo Workflows as the engine on 2026-10-09 (feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535). feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535's migration table lists feat(rag): Index managed repos, exclude private from unscoped search #1389 as a later WorkflowTemplate consumer, and its last step deletes the in-process workers feat(rag): Index managed repos, exclude private from unscoped search #1389 would have extended.
- The Service is held at 0 replicas (chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562), and the only cluster identity is the suspended machine account's token, which the two private managed repositories need for a clone.
- feat(rag): Index managed repos, exclude private from unscoped search #1389 is therefore re-scoped to the ingestion pass a person runs from the CLI. This item carries the cluster half, which waits for feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535 and an identity.
Evidence
Checked at main 3dd7fa6.
- The Service's poll tick and per-lane workers are in
src/devops_cli/server/service.py:130-175and:350-360; feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535 deletes them. - The poll interval is
DEFAULT_SERVICE_POLL_INTERVAL_SECONDS(src/devops_cli/config/defaults.py:976). - Cluster pods get
GH_TOKENfrom Secretdevops/devops-cli(k8s/devops/cronjob.yaml:48-50), which holds the suspended account's token. - ADR 0003 says the poll is how the jobs see changes and webhooks only cut latency, so a schedule alone keeps the index current.
Remedy
- A WorkflowTemplate runs feat(rag): Index managed repos, exclude private from unscoped search #1389's ingestion command in the Service image, under one global
rag-ingestmutex so one repository indexes at a time. - A CronWorkflow on
service.poll_interval_secondsruns it withconcurrencyPolicy: Forbid. - A Qdrant credential Secret is mounted only in that template's pods. A NetworkPolicy selects only those pods for egress to Qdrant on 6333, with the matching ingress rule on the llm side.
- The template sets
ai.gateway_concurrency.embeddingto 1, and its metrics go through the OTel collector, since short-lived pods cannot be scraped by annotation. ARagIngestBehindalert is built on them. - Optional, after feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386 and feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535's router step: a default-branch push submits a run at once.
- Priority under the owner's blocker rule (2026-10-17): no rule-driven raise. It blocks no filed item.
Acceptance criteria
- Offline manifest tests: the template mounts the Qdrant Secret and no other, the NetworkPolicy selects only the ingest pods, and the CronWorkflow forbids overlap.
- The template is deployed by
devops k8s deploy-stack --stack all. -
uv run devops cipasses. - Pending a person, once in-cluster jobs have a GitHub identity: one scheduled run indexes each managed repository, and a search scoped to a private repository returns its chunks.
Related
- Depends on: feat(rag): Index managed repos, exclude private from unscoped search #1389 (re-scoped to the CLI pass), feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535 steps 1-2, and a cluster GitHub identity (the GitHub App item or chore(service): the roadmap service stays at 0 replicas, and its development is blocked, while its machine account is suspended #1562's revert).
- Related, latency only: feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386.
- fix(ai): the rag index keeps each project's chunks apart, deletes a removed file's points before forgetting it, and refills a project its collection lost #1388.
Alternatives check of 2026-11-01: not-applicable.
Tool: none found.
Proposed design
Problem statement
The RAG index of the managed repositories' default branches goes stale. No cluster job runs the ingestion pass on a schedule. This item adds an Argo WorkflowTemplate and a CronWorkflow that run the pass from #1389. The template holds one global mutex, and the CronWorkflow forbids overlap. The Qdrant credential reaches the ingest pods only, and a lag alert shows a stale index.
Acceptance criteria
Requirement: Qdrant Secret scoped to the ingest pods
The stack SHALL reference the Qdrant credential Secret from the ingest WorkflowTemplate only.
Scenario: Secret references of the stack
- WHEN The offline manifest test renders k8s/devops and reads the secret references of every workload.
- THEN The test asserts that only the ingest WorkflowTemplate names the Qdrant Secret.
Requirement: Network policy selects only the ingest pods
The stack MUST select only the ingest pods for traffic to Qdrant on port 6333, on egress from the ingest pods and on ingress to Qdrant.
Scenario: Pod selectors of the Qdrant rules
- WHEN The offline manifest test reads the Qdrant egress and ingress rules and the pod labels of the stack.
- THEN The test asserts that both rules select the ingest pods only and name TCP port 6333.
Requirement: One ingest run at a time
The ingest WorkflowTemplate MUST hold the global rag-ingest mutex, and the CronWorkflow MUST set concurrencyPolicy: Forbid.
Scenario: Overlap is impossible
- WHEN The offline manifest test reads the WorkflowTemplate and the CronWorkflow.
- THEN The test asserts that
spec.synchronization.mutex.nameisrag-ingestandspec.concurrencyPolicyisForbid.
Requirement: Schedule follows the poll interval
The CronWorkflow MUST use the shortest whole-minute cron period that is not shorter than service.poll_interval_seconds.
Scenario: Default poll interval
- WHEN
service.poll_interval_secondsholds its default of 151 seconds. - THEN The test asserts that the rendered schedule is
*/3 * * * *.
Requirement: One embedding request at a time
The ingest template MUST set ai.gateway_concurrency.embedding to 1.
Scenario: Embedding concurrency of the template
- WHEN The offline manifest test reads the environment of the ingest template.
- THEN The test asserts that the template sets the embedding concurrency to 1.
Requirement: Lag alert
The stack MUST ship a RagIngestBehind alert on the ingest freshness metric.
Scenario: Alert rule present
- WHEN The offline manifest test reads the alert rules of the stack.
- THEN The test asserts that one rule named
RagIngestBehindreads the freshness metric and fires after two schedule periods without a success.
Requirement: Stack command renders the resources
devops k8s deploy-stack --stack all MUST render the ingest WorkflowTemplate and the CronWorkflow.
Scenario: Rendered stack
- WHEN The offline test renders the stack with
--dry-run. - THEN The rendered output holds the WorkflowTemplate and the CronWorkflow in namespace
devops.
Requirement: Full CI passes
The change MUST pass uv run devops ci.
Scenario: Full CI
- WHEN A person runs
uv run devops cion the branch. - THEN Every check reports success.
Existing Tool Considered
The alternatives check of 2026-11-01 recorded not-applicable and named no tool. Argo Workflows covers the need. It is open under Apache-2.0, CNCF-graduated and actively maintained. A CronWorkflow with concurrencyPolicy: Forbid and a WorkflowTemplate with synchronization.mutex give the schedule, the single-run lock and the overlap ban. It lacks the ingestion command, which #1389 delivers, and the Qdrant credential scoping, which a Kubernetes Secret and a NetworkPolicy give. The project builds no scheduler of its own.
Key questions
- Which engine runs the scheduled ingestion?: Argo Workflows. The owner chose it on 2026-10-09 in feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535. A CronWorkflow schedules the run, and a WorkflowTemplate holds its steps. (best practice) [sources: docs/adr/0008-argo-workflows-run-the-roadmap-jobs-after-a-measured-go.md]
- Chosen: Argo Workflows CronWorkflow. The owner chose Argo Workflows in feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535, and ADR 0008 records the move to it.
- Rejected: Kubernetes CronJob. It holds no mutex across jobs, and feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535 moves the roadmap jobs off plain Jobs.
- Rejected: A loop inside the Service. feat(k8s): the argo workflows controller runs in its own namespace under argo cd and deploy-stack, and a --version workflow measures start-up and api-server load for the go/no-go on moving the roadmap jobs onto it #1535 deletes the Service's in-process workers, and the Service runs at 0 replicas.
- What interval does the CronWorkflow use?: The poll interval is 151 seconds, and a cron schedule cannot express it. The CronWorkflow uses
*/3 * * * *, which is 180 seconds, the shortest whole-minute period that is not shorter than the setting. (best practice) [sources: src/devops_cli/config/defaults.py:969, src/devops_cli/config/settings.py:1129]- Chosen:
*/3 * * * *, 180 seconds. It is the shortest whole-minute cron period that is not shorter than the 151-second setting. - Rejected:
*/2 * * * *, 120 seconds. It runs sooner than the poll interval and re-indexes an unchanged repository. - Rejected:
*/1 * * * *, 60 seconds. It costs three times the runs of the chosen period for no fresher data.
- Chosen:
- How do the ingest pods authenticate to GitHub for a clone of a private repository?: The template reads
GH_TOKENfrom Secretdevops/devops-cliwithenvFrom.secretRef, the same source the existing CronJob uses. The identity that the token carries is outside this item. [sources: k8s/devops/cronjob.yaml:48, k8s/devops/cronjob.yaml:49, k8s/devops/cronjob.yaml:50] - Is a schedule alone sufficient to keep the index current?: Yes. ADR 0003 makes polling the source of truth and a webhook only a latency cut, and ADR 0017 runs the update at once for each event while the poll reconciles. A missed event delays the index by at most one schedule period. [sources: docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md]
- What concurrency model prevents two ingest runs?: A global mutex named
rag-ingestin the WorkflowTemplate, plusconcurrencyPolicy: Forbidon the CronWorkflow. (proposed)- Chosen: Argo
synchronization.mutexnamedrag-ingest. It holds across the CronWorkflow, a manual submit and any other trigger. - Rejected:
concurrencyPolicy: Forbidalone. It governs the runs of the CronWorkflow only, not a manual submit. - Rejected: A Kubernetes Lease held by the pod. It needs new code in the image, and Argo already holds the lock.
- Chosen: Argo
- How do the short-lived ingest pods report metrics?: The ingestion command pushes OTel metrics through the collector, and the template sets no Prometheus scrape annotation. The
RagIngestBehindalert reads the freshness metric. (best practice) [sources: tests/ai/client/test_ai_client_telemetry.py]- Chosen: Push over OTLP to the collector. The AI client reports OTel telemetry, and a pod that ends in seconds is not scraped.
- Rejected: Prometheus scrape annotations. A run shorter than a scrape interval leaves no sample.
- How is the Qdrant credential scoped to the ingest pods?: A dedicated Qdrant Secret is mounted in the ingest template's pods only. A NetworkPolicy selects those pods for egress to Qdrant on 6333, with the matching ingress rule on the Qdrant side. (best practice) [sources: k8s/devops/networkpolicy.yaml, k8s/devops/roadmap-service/networkpolicy-egress.yaml]
- Chosen: A separate Secret plus a pod-selecting NetworkPolicy. Only the ingest pods get the Qdrant key and the route to port 6333.
- Rejected: The Service Secret and its NetworkPolicy. It gives every Service pod the Qdrant key and does not name the ingest pods.
- What limits the embedding load of one ingest run?: The template sets
ai.gateway_concurrency.embeddingto 1, so a run sends one embedding request at a time. (best practice) [sources: src/devops_cli/config/defaults.py, src/devops_cli/config/settings.py]- Chosen: Set
ai.gateway_concurrency.embeddingto 1 in the template. It keeps a scheduled run from crowding the gateway slots that the roadmap jobs use. - Rejected: Keep the default concurrency. A run would take every embedding slot of the gateway while it holds the mutex.
- Chosen: Set
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNew
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 18, 2026
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.
The candidate proposes a new feature to keep RAG indexes current using Argo Workflows.It is a scoped enhancement that blocks no filed item and has a clear owner direction.Improves the accuracy and relevance of search results for managed repositories.Involves setting up Argo Workflows, CronWorkflows, NetworkPolicies, and integrating with Qdrant.dan-petty commentedon Oct 28, 2026
Refine cannot set this item to Ready at d509dba while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 1, 2026
Alternatives check: not-applicable
Tool: none found
Checked on 2026-11-01. A person decides what this means for the item. The check changes no label and closes no issue.
[-]feat(k8s): an argo workflow keeps the rag index of every managed repository's default branch current, on the poll schedule and on each default-branch push[/-][+]feat(k8s): Add an Argo workflow to keep the RAG index current[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 143 characters, and the limit is 60. The type and the scope stay.
feat(k8s): an argo workflow keeps the rag index of every managed repository's default branch current, on the poll schedule and on each default-branch pushfeat(k8s): Add an Argo workflow to keep the RAG index currentdevops-cli-service commentedon Nov 7, 2026
Status set to Ready at 72c52c6 (see proposed design in issue body).
Moved to new items: #3949, #3950.
devops-cli-service commentedon Nov 8, 2026
Released in v0.94.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.94.0
devops-cli-service commentedon Nov 8, 2026
Live since 2026-11-08 21:00 UTC