Repository navigation
Description
Problem or Motivation
Owner direction (2026-11-13): "jobs should run async and ready for event driven triggers". After each job has its own lane (see Dependencies), a webhook event must wake only the lanes of the jobs that the event concerns. The poll stays as the reconcile path. Today a delivery coalesces into lane rounds, and each lane still finds its work through its own poll of the issue events (#3942).
Proposed Solution & Architectural Design
- Add one routing table from a GitHub event (event, action, and labels or the PR kind where needed) to the jobs that it can make due. It must be data, with a test that reads it. For example:
issues.opened-> intake;issues.labeled status/new-> refine;issues.labeled status/ready-> stage;issues.edited-> intake, refine, retitle;pull_request.*of a plan PR -> stage_ready, fix_plan (labelplan/needs-fix), pr_conflicts;pull_request.*of a delivery PR -> implement, pr_conflicts;check_suiteandcheck_runcompleted -> implement;issue_commentwithimplement: retry-> implement;release.published-> release_comments;pushto the default branch -> pr_conflicts, stage_ready.
- The webhook handler puts the trigger, with the subject (issue or PR number), on the queue of each routed lane and returns 202. A lane round that has a subject can work on that subject first.
- An event that the table does not route wakes no lane. The poll finds its effect at the next interval.
- The table is the seam that
due_jobs(feat(roadmap): one due_jobs function names the due jobs of an item #5504) replaces: an event gives a subject, anddue_jobs(subject)gives the jobs. - Metrics:
devops_cli_service_triggers_total{event, lane}, and the time from delivery to the start of the round for each lane.
Target Subsystem
Roadmap Service webhooks and lanes (src/devops_cli/server/routes/webhooks.py, src/devops_cli/server/service.py, src/devops_cli/roadmap/run.py).
Existing Tool Considered
GitHub webhooks are already delivered and verified (#1533). Valkey events (#4517) come later for units outside the pod. This issue uses the in-pod queues. Cost: about 400,000 tokens and 1 day.
Acceptance Criteria
- A test of each routing row proves that its event enqueues exactly the routed lanes, and that an unrouted event enqueues none (
devops ci fail-to-pass). - A test proves that a routed delivery starts the round of its lane before the next poll interval.
- Live proof after the release: a label
status/readyon an issue starts a stage round within one minute when the stage lane is idle, as shown by the metric of the time to the round start.
Dependencies
- feat(service): each roadmap job runs in its own lane #5553 (each roadmap job runs in its own lane)
- Related: feat(roadmap): one due_jobs function names the due jobs of an item #5504, fix(service): each lane polls the issue events again #3942, feat(roadmap): move Service work to Workflows and Valkey #4517, feat(service): each subscribed webhook event runs the roadmap update scoped to it at once, and the 5-minute poll reconciles board edits and lost deliveries #1533
Alternatives check of 2026-11-23: rejected.
Rejected by ADR 0021. A newer fact can change an ADR.
Tool: argoproj/argo-events (https://github.com/argoproj/argo-events), Apache-2.0, last activity 2026-11-17, maintained.
Reason: Searches found Argo Events, which routes webhook events by filter to triggers, but ADR 0021 rejected it as a second receiver; it brings no in-pod lane queues, subject-first round or per-lane latency metric.
Covers:
- Webhook and GitHub event sources, with CloudEvents payloads
- Data filters that route one event to chosen triggers
- Triggers that start Kubernetes objects, workflows or serverless work
- Declarative event-to-consumer mapping held as resources
Lacks:
- Second receiver beside the verified GitHub webhook router
- Subject-first pass on the in-pod lane queues
- Per-lane time from delivery to round start
- Poll kept as the reconcile path for lost deliveries
Proposed design
Problem statement
Today a non-scoped issue delivery wakes every lane, and a scoped delivery wakes all other lanes. A lane round ignores the subject that its trigger carries. This issue uses the existing batch_keys as the routing data, so a webhook wakes only the lanes that declare its event. A lane round processes its subjects first. Push and check_run routes wait in a separate issue.
Acceptance criteria
Requirement: Batch key routing
The Service SHALL route a webhook trigger to the lanes whose batch_keys declare its source, event and action.
Scenario: Ready label route
- WHEN A signed
issues.labeleddelivery with labelstatus/readyarrives for a managed repository. - THEN The handler enqueues each lane whose batch keys declare the
issueslabeledkey and enqueues no other lane.
Requirement: No unscoped lane wake
A non-scoped issue delivery MUST NOT enqueue a trigger with lane=None.
Scenario: Issue closed
- WHEN A signed
issues.closeddelivery arrives for a managed repository. - THEN Every
enqueue_triggercall names a lane from the batch-key route and no call haslane=None.
Requirement: Scoped wake filter
A scoped update SHALL wake only the lanes whose batch_keys declare its key or whose due stamp names the job.
Scenario: Labeled scoped update
- WHEN A scoped
issues.labeledupdate ends for the stage job. - THEN
lanes_to_wakereturns only the lanes whose batch keys declareissueslabeledor whose due stamp names the stage job.
Requirement: Subject first round
A lane round MUST process the subjects of its TriggerBatch before its normal poll rows.
Scenario: Subject first
- WHEN A routed delivery puts subject 42 on an idle lane and
run_due_jobsstarts its round. - THEN The round processes subject 42 before the poll rows and a fake clock records the start before the next poll interval.
Existing Tool Considered
The alternatives check of 2026-11-23 in the issue body gives rejected for argoproj/argo-events (https://github.com/argoproj/argo-events). ADR 0021 rejected it as a second receiver beside the verified GitHub webhook router. The block in the issue body gives what the tool covers and lacks. The proposal keeps the one verified receiver and the in-pod lane queues. It uses the existing batch_keys to route triggers and gives the subject-first lane round that the tool lacks. The issue records the written cost of building this code: about 400,000 tokens and 1 day.
Key questions
- Which data routes a webhook event to lanes?: Use each roadmap row's existing
batch_keys. Do not add a second table. (best practice) [sources: src/devops_cli/config/constants.py:4017-4033, src/devops_cli/server/routes/webhooks.py:482-492, openspec/specs/roadmap-scoped-updates/spec.md:106-115]- Chosen: Existing batch keys. They already declare the source, event and action of each row, and tests hold them.
- Rejected: New event-to-lane table. It duplicates the batch keys, and its
stage_readyandpr_conflictsrows no longer exist. - Rejected: Handler branches. The routes are not data, and a test cannot read each row.
- How does a non-scoped issue delivery choose lanes?: Filter to the lanes whose
batch_keysdeclare the delivery key. Never callenqueue_triggerwithlane=None. (best practice) [sources: src/devops_cli/server/routes/webhooks.py:488-492, src/devops_cli/config/constants.py:4017-4033, tests/roadmap/test_roadmap_run_webhook_keys.py]- Chosen: Filter by batch keys. It wakes only the lanes that declare the event and it uses one data source.
- Rejected: Wake all lanes. It starts rounds for no work and hides gaps in the keys.
- Rejected: Drop the delivery. The poll would delay the work until its next interval.
- Should
issues.labeled status/readywake only the stage lane?: No. It wakes every lane whosebatch_keysdeclareissueslabeled, including refine and stage when their keys declare it. (best practice) [sources: src/devops_cli/config/constants.py:4017-4033, openspec/specs/roadmap-scoped-updates/spec.md:106-115, tests/roadmap/test_roadmap_run_webhook_keys.py]- Chosen: All matching lanes. The batch keys hold the route, and refine and stage both declare the labeled key.
- Rejected: Stage only. It conflicts with the refine batch keys and the scoped-update spec.
- Rejected: No lane. It loses a trigger that the keys declare.
- How does a scoped delivery wake other lanes?:
lanes_to_wakereturns only lanes whose batch keys declare the delivery key or whose due stamp names the job. (best practice) [sources: src/devops_cli/roadmap/run.py:1463-1473]- Chosen: Filter by key or due stamp. It keeps the wake path and removes the wake of every other lane.
- Rejected: Keep all other lanes. It starts rounds for no work and makes the trigger count misleading.
- Rejected: New wake queue. It duplicates the lane queues and adds a second ordering path.
- How does a lane round process a subject first?:
run_due_jobsreadsTriggerBatch.subjectsand processes them before its poll rows. (best practice) [sources: src/devops_cli/server/service.py:98, src/devops_cli/roadmap/run.py:2315-2349]- Chosen: Consume
TriggerBatch.subjects. The batch already carries the subjects, so no new state is needed. - Rejected: New subject queue. It duplicates the batch and adds a second ordering path.
- Rejected: Work in the handler. It makes the request long and moves roadmap work out of the lane.
- Chosen: Consume
- Which row serves pull request and check suite events after feat(roadmap): one watch row for plan and delivery PRs #5024?: The
watchrow.stage_readyandpr_conflictsno longer exist. (best practice) [sources: src/devops_cli/roadmap/run.py:1222-1226, openspec/specs/roadmap-watch-row/spec.md:8-14, tests/roadmap/test_roadmap_run_due_table.py:114-129]- Chosen: Use the
watchrow. It is the row that feat(roadmap): one watch row for plan and delivery PRs #5024 left in the due table. - Rejected: Restore
stage_readyandpr_conflicts. It reverses a merged change and adds two lanes. - Rejected: Add new rows. It duplicates the
watchrow.
- Chosen: Use the
- Which metrics change?: No metric labels or histogram change. Keep
devops_cli_service_triggers_total{repo,source}. (best practice) [sources: openspec/specs/roadmap-service-counters/spec.md:23-28, src/devops_cli/server/counter_series.py:161-168, tests/telemetry/test_service_counter_series.py:193-201, k8s/devops/dashboards/roadmap-service-telemetry.json:591]- Chosen: Keep the existing counter. The spec, the series code, the test and the dashboard bind its labels to repo and source.
- Rejected: Add event and lane labels. It conflicts with the counter spec and the series test.
- Rejected: Add a latency histogram. The deferred follow-up test(service): prove webhook wake latency after release #6279 rejected it.
- Should this issue add
pushandcheck_runroutes now?: No. Defer them. The event list excludes both, the payload parses neither, and a test expectspushto return no subscriber. (best practice) [sources: src/devops_cli/config/constants.py:4049-4058, src/devops_cli/models/webhooks.py:107-122, tests/server/test_server_service.py:1961]- Chosen: Defer to a new issue. The core route change needs no new event subscription or payload field.
- Rejected: Add both routes now. It expands the scope and changes a test that expects no subscriber.
- Rejected: Drop them permanently. The issue still records the need, and a later issue can add it.
- Does the webhook handler run a scoped update in the request?: No. It queues work through
enqueue_scopedandenqueue_triggerand returns. [sources: src/devops_cli/server/routes/webhooks.py:482-492]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 13, 2026
Both target per-job lanes; #5553 creates one lane per job, while the candidate adds a routing table that maps each GitHub event to the lanes it should wake.feat(service): each roadmap job runs in its own lane (#5563)
devops-cli-service commentedon Nov 17, 2026
Alternatives check: rejected
Reason: Searches found Argo Events, an open Kubernetes event-driven framework that routes webhook events to triggers, but it lacks the in-pod lane queues, and ADR 0021 rejected it as a second receiver beside the router.
Rejected by ADR 0021. A newer fact can change an ADR.
Tool: argoproj/argo-events (https://github.com/argoproj/argo-events), Apache-2.0, last activity 2026-11-16, maintained.
Covers:
Lacks:
Searches (10)
Tools considered:
Searches run:
Sources:
A person decides what this check of 2026-11-17 means for the item.
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at 86358b6 (see proposed design in issue body).
Moved to new items: #6279.
dan-petty commentedon Nov 25, 2026
Returning
#5555tostatus/newwithout implementing because the specification cannot be built as written onorigin/main(49b8c0db8):stage_ready,pr_conflicts): The issue and its refine design (sha=86358b6c) require routingpull_requestandpushevents tostage_readyandpr_conflicts.#5024deleted both rows and replaced them withwatch(src/devops_cli/roadmap/run.py:1222-1226,openspec/specs/roadmap-watch-row/spec.md:8-14,tests/roadmap/test_roadmap_run_due_table.py:114-129). Neither lane exists.#4413,#4414,#4415,#4416,#4660,#6013):202after queueing work onto worker threads viaenqueue_scopedandenqueue_trigger(src/devops_cli/server/routes/webhooks.py:482-492) without runningrun_scoped_updatesynchronously in the request.pull_request,pull_request_review, andcheck_suiteto_SCOPED_WATCH(watchlane,#4413/#4414), trustedissue_commentevents to_SCOPED_IMPLEMENTor_SCOPED_REFINEafter bot/PR/author refusals (#4415),release.publishedto_SCOPED_RELEASE(#4416), and brain-cache updates to_remember_delivery_issue(#6013). Droppingrun_scoped_updateas written would undo ADR 0017 and those shipped routes.issues.labeled(status/ready) wakes onlystage, andissues.closedwakes no lane (Unrouted event), conflicts withCONST_ROADMAP_REFINE_BATCH_KEYSandCONST_ROADMAP_STAGE_BATCH_KEYS(src/devops_cli/config/constants.py:4017-4033,openspec/specs/roadmap-scoped-updates/spec.md:106-115,#4660, verified bytests/roadmap/test_roadmap_run_webhook_keys.py).pushandcheck_runare outsideCONST_ROADMAP_WEBHOOK_EVENTS(src/devops_cli/config/constants.py:4049-4058),GitHubWebhookPayload(src/devops_cli/models/webhooks.py:107-122) parses neitherrefnorcheck_run, andtests/server/test_server_service.py:1961assertspushreturns200 {"status": "no_subscriber"}.openspec/specs/roadmap-service-counters/spec.md:23-28,src/devops_cli/server/counter_series.py:161-168,tests/telemetry/test_service_counter_series.py:193-201, andk8s/devops/dashboards/roadmap-service-telemetry.json:591binddevops_cli_service_triggers_totalto labels{repo, source}rather than{event, lane}, and deferred follow-up#6279explicitly rejected addingdevops_cli_service_trigger_latency_seconds.What still remains unbuilt for re-scoping in refinement:
issuesdeliveries (labeled,unlabeled,closed,assigned) still callenqueue_trigger(..., lane=None)insrc/devops_cli/server/routes/webhooks.py:488-492, waking all 14 lanes instead of only lanes whosebatch_keysdeclare that(source, event, action)key.lanes_to_wake(src/devops_cli/roadmap/run.py:1463-1473) still wakes all other lanes instead of filtering to lanes matching the trigger key orrefine_duestamp.TriggerBatch.subjects(src/devops_cli/server/service.py:98) is still not consumed byservice_job/run_due_jobs(src/devops_cli/roadmap/run.py:2315-2349) for subject-first processing.1 remaining item
devops-cli-service commentedon Nov 25, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
chore(main): release 0.234.0 (#7589)
devops-cli-service commentedon Nov 28, 2026
Released in v0.234.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.234.0
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 17:56 UTC