Skip to content

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

Closed
1 of 1 issue completed

Description

@dan-petty

Tracking issue

This issue tracks the two pull requests of the section "Delivery" and the poll-watermark item of the section "Scope".

The pull request of PR 2 closes this issue. It merges after #2009 closes, so this issue closes after its child issue. If the poll-watermark item has no issue by then, the pull request of PR 2 also meets its criterion.


Refreshed plan (2026-10-17, unblocking review)

This section supersedes any text below that conflicts with it.

Decisions

Scope

  • perf(roadmap): a Service poll with no event newer than the last round's sends no GraphQL request #1401's criterion moves to the poll-watermark item, perf(roadmap): a poll with nothing newer than the changes its last round judged sends no graphql request (drafted in this review, not yet filed). It moves only once a person files that item carrying all three of perf(roadmap): a Service poll with no event newer than the last round's sends no GraphQL request #1401's criteria, none weakened; until then the body's criterion stays here as written. The three criteria:
    • When nothing is newer than the last round's newest judged change, the poll skips the board read and the job-record attach, whether or not an interval-due row runs. That row reads only what its own run needs.
    • ADR 0003 says what an unchanged poll costs.
    • Test: two consecutive polls over the same events. The second sends no GraphQL request, offline, with each call phase under 1 s.
  • Everything else stays here: the new ADR, a scoped update for each event in the table, the record that stops the poll redoing one, and the Service dispatch.

Delivery

  1. PR 1 (M) closes feat(roadmap): a scoped update intakes one issue from what its webhook delivery carries and records what it handled, and an ADR makes webhooks drive scoped updates #2009: the new ADR, ADR 0003 pointing to it, and the scoped updates in src/devops_cli/roadmap/. Each reuses its job's decision code with a narrowed scope and records what it handled. Tests run on the in-memory store. It touches no Service code, so it does not wait on 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.
  2. PR 2 (M), "Fixes 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", 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: the Service hands each subscribed event's typed payload from 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's router to its scoped update, on the lane the table names, with a test for each subscribed event that its delivery runs the scoped update and queues no full round. An event it does not subscribe to, or cannot scope, keeps today's whole-round hint.

Acceptance criteria

Current references (main 3dd7fa6)

Dependencies and order


Requested by the owner, 2026-10-09: "ideally the webhook events would fire immediately and perform updates limited to the scope of the webhook event."

Problem

Checked at release/v0.2.33.

  • ADR 0003 makes polling the source of truth and a webhook only a hint: any accepted delivery queues a full round of every due job for the repository (server/routes/webhooks.py -> ServiceManager.enqueue_trigger -> RepoWorker), and no payload reaches a job (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). So an opened issue waits for, and pays for, a whole round.
  • On 2026-10-09 the Service spent 1,100-1,400 GraphQL points an hour, about 25% of the account's budget, almost all of it in rounds that found nothing new (8 repositories polled every 5 minutes, 12-16 points each). The real limit was the background model, not GitHub.
  • ADR 0003's reasons for polling still hold: GitHub sends no webhook when a board owned by a personal account changes (Status, Priority, Value, Effort), and it never retries a failed delivery.

Decision (owner, 2026-10-09)

Proposed design

Event Scoped update, at once Lane
issues opened / edited / reopened intake that one issue model
board edits, a lost delivery the 5-minute reconciling poll, as today both
  • Each scoped update reuses the job's own decision code with a narrowed scope (one issue); nothing duplicates a job's rules.
  • A scoped update records what it handled, so the reconciling poll does not redo it.
  • An event the Service does not subscribe to, or one it cannot scope, falls back to today's hint.

Acceptance criteria

  • A new ADR records the decision and supersedes ADR 0003's webhook clause; ADR 0003 points to it.
  • For each event in the table, a test on the in-memory store shows the scoped update runs from the delivery alone, touches only that item, and makes no full round.
  • A lost delivery is still handled by the next reconciling poll (test: drop the delivery, run the poll).
  • A poll with no change since the last round sends no GraphQL request (perf(roadmap): a Service poll with no event newer than the last round's sends no GraphQL request #1401's criterion).
  • AGENTS.md's roadmap-service section and k8s/README.md's webhook step describe the event-driven flow.

Proposed design

Problem statement

The Service treats every webhook delivery as a hint to run a full round of all due jobs. No payload reaches any job. This wastes GraphQL budget and delays issue processing. The fix makes each subscribed webhook event run its scoped update at once. The 5-minute poll reconciles board edits and lost deliveries.

Acceptance criteria

  • Criterion 1: A new ADR records the decision and supersedes ADR 0003's webhook clause. ADR 0003 points to the new ADR.
    Verification: A new file exists in docs/adr/. docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md contains a link to it.
  • Criterion 2: For each subscribed event, a test on the in-memory store shows the scoped update runs from the delivery alone, touches only that item, and makes no full round.
    Verification: Run uv run pytest tests/test_roadmap_run.py -k scoped and observe all tests pass.
  • Criterion 3: A lost delivery is still handled by the next reconciling poll.
    Verification: A test drops the delivery, runs the poll, and observes the change is processed.
  • Criterion 4: A poll with no change since the last round sends no GraphQL request.
    Verification: Two consecutive polls over the same events. The second sends no GraphQL request, offline, with each call phase under 1 s.
  • Criterion 5: A reconciling poll after a scoped update does not redo it and does not skip an older change the update did not handle.
    Verification: A test delivers one event and drops another, then runs the poll. Both changes are handled.
  • Criterion 6: AGENTS.md's roadmap-service section and k8s/README.md's webhook step describe the event-driven flow.
    Verification: Read AGENTS.md and k8s/README.md. Both describe the event-driven flow.
  • Criterion 7: Once the Service runs again, a real delivery of each subscribed event runs its scoped update and no full round.
    Verification: A person sends a real webhook delivery for each subscribed event and observes the scoped update runs with no full round.

Key questions

Fit

Needs splitting into 2 items:

  1. PR 1 (feat(roadmap): a scoped update intakes one issue from what its webhook delivery carries and records what it handled, and an ADR makes webhooks drive scoped updates #2009): New ADR, ADR 0003 pointer, and scoped updates in src/devops_cli/roadmap/ with in-memory store tests.
  2. PR 2: Service dispatch of typed payload to scoped update per subscribed event, with Service-level tests and docs updates in AGENTS.md and k8s/README.md.

Suspected block

The live check (real delivery of each subscribed event) waits on the GitHub machine account being reinstated (#1562 suspension).

Dependencies

#2009

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. added
    type/feature
    scope/roadmap
    on Oct 9, 2026
  2. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    Owner direction (2026-10-09): events and schedules, for every consumer

    "The service is ultimately going to need to manage both event driven triggers and scheduled tasks in order to integrate well with external services and maintain a consistent picture of state."

    So this item's new ADR states the general rule, not only the roadmap case:

  3. dan-petty commented on Oct 9, 2026

    @dan-petty
    OwnerAuthor

    The owner chose Argo Workflows as the Service's engine on 2026-10-09 (#1535). With it, each scoped update in this item's table runs as a Workflow on the lane mutex the table names, and the 5-minute reconciling poll becomes a CronWorkflow. The new ADR this item adds should record the engine alongside the event rule.

  4. dan-petty-bot commented on Oct 10, 2026

    @dan-petty-bot
    Collaborator

    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.

    • Priority: P2-Medium. Owner-requested architectural change that cuts ~25% of the account's GraphQL budget and improves responsiveness, but it is a planned feature, not a blocking defect.
    • Value: High. Eliminates 1,100–1,400 wasted GraphQL points per hour and delivers sub-minute updates for issue, PR, and release events to all roadmap users.
    • Effort: High. Requires a new ADR, scoped job execution for five event types, reconciliation bookkeeping, fallback logic, tests on an in-memory store, and updates to AGENTS.md, k8s/README.md, and RELEASE_CYCLE.md.
  5. added
    status/blocked
    on Oct 11, 2026
  6. dan-petty commented on Oct 11, 2026

    @dan-petty
    OwnerAuthor

    Blocked by #1562: the roadmap Service's machine account is suspended, and the Service is held at 0 replicas. This item develops the Service or can only be checked on it, so it waits until the account is reinstated or the jobs act as a GitHub App.


    Generated by Claude Code

  7. dan-petty commented on Oct 18, 2026

    @dan-petty
    OwnerAuthor

    Amendment (2026-10-18): folded by intake into closed #1401, recorded here on the item it splits from

    devops roadmap intake judged the candidate below a duplicate of #1401 and filed nothing. #1401 is closed, so the candidate would vanish there; it says it is a split from this item, so it is recorded here instead. That fold into a closed item is the defect #1671 describes. Candidate title: "perf(roadmap): a poll with nothing newer than the changes its last round judged sends no graphql request".

    Friction

    Evidence

    Checked at main 3dd7fa6.

    • Each poll reads changes from the oldest last success among the rows with a due rule (_oldest_cutoff, src/devops_cli/roadmap/run.py:753-761, used by _fetch_filtered_changes at :803-807).
    • Reprioritize's due rule fires only on a release change, a change to an item in the current release, or a day since its last run (_reprioritize_due, run.py:386-389). A change to any other item doesn't make it due, so its last success, and the cutoff with it, can stay up to a day old.
    • Any item change in that window makes changes_since attach job records, which reads the board over GraphQL (_with_job_records, src/devops_cli/roadmap/github_store.py:1965-1971).
    • Nothing records the newest change a round has already judged, and each round opens the store again (service_job, run.py:1017-1027). So every 5-minute poll repeats the same board read.
    • test_a_round_judging_50_foreign_label_changes_reads_the_board_once (tests/test_roadmap_run.py:1678-1702) shows a round that runs no job and still sends one board-budget and one board-items GraphQL query.
    • devops roadmap run calls the same run_due_jobs (src/devops_cli/commands/roadmap.py:577).

    Remedy

    Acceptance criteria

    • Tests first, offline, on the GitHub store over the faked gh: two consecutive polls over the same 50 foreign label changes. The second sends no GraphQL request (extends tests/test_roadmap_run.py:1678-1702).
    • A change newer than the mark is judged once, on the next poll.
    • An interval-due row still runs and reads what it needs.
    • The CLI and the Service share the behaviour: one test drives run_due_jobs as devops roadmap run calls it.
    • A changelog.d/<issue>.md fragment exists, and uv run devops ci passes.

    Related

  8. dan-petty commented on Oct 26, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Priority: P1-High. This item implements core roadmap functionality that affects how changes are processed and delivered.
    • Value: High. The change enables more efficient processing of webhook events and improves the roadmap service's responsiveness.
    • Effort: Medium. The implementation requires multiple components including ADR creation, scoped update logic, and Service dispatching.
    • Possible duplicate: feat(roadmap): a scoped update intakes one issue from what its webhook delivery carries and records what it handled, and an ADR makes webhooks drive scoped updates #2009, which may ask for the same change. The model names a scoped update intakes one issue from what its webhook delivery carries and records what it handled as the change that both ask for. The candidate and item #2009 both ask for the same change of a scoped update that handles one issue from a webhook delivery and records what it handled. A person closes one of the two if that is so.
  9. dan-petty commented on Oct 27, 2026

    @dan-petty
    OwnerAuthor

    The proposal at cc34caa needs splitting into 2 items. A person splits the item into the items below, or replies in a comment or edits the body to keep one item, and the next refine round looks at the item again.

    1. PR 1 (feat(roadmap): a scoped update intakes one issue from what its webhook delivery carries and records what it handled, and an ADR makes webhooks drive scoped updates #2009): New ADR, ADR 0003 pointer, and scoped updates in src/devops_cli/roadmap/ with in-memory store tests.
    2. PR 2: Service dispatch of typed payload to scoped update per subscribed event, with Service-level tests and docs updates in AGENTS.md and k8s/README.md.
  10. added
    priority/p1-high
    status/new
    effort/medium
    value/high
    and removed
    status/blocked
    on Oct 28, 2026
  11. added
    status/in-progress
    and removed
    status/new
    on Oct 30, 2026
  12. added 2 commits that reference this issue on Oct 30, 2026
    aef16ba
    4bed1d9
  13. removed
    status/in-progress
    on Oct 31, 2026
  14. added a commit that references this issue on Oct 31, 2026
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/p1-highscope/roadmaptype/featurevalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions