Skip to content

feat(service): route push and check_run webhook events #7038

Backlog

Description

@devops-cli-service

Split from #5555.

Problem: The issue asks a push to the default branch to wake the watch row, and a completed check_run event to wake the implement row. The Service does not subscribe to these events. CONST_ROADMAP_WEBHOOK_EVENTS leaves out push and check_run (src/devops_cli/config/constants.py:4049-4058). GitHubWebhookPayload parses neither ref nor check_run (src/devops_cli/models/webhooks.py:107-122). A test asserts that push returns 200 with no_subscriber (tests/server/test_server_service.py:1961). The core issue cannot change these routes in one pull request. Why deferred: The core issue routes existing subscribed events through batch keys and adds subject-first rounds. The new subscriptions and payload fields need their own change. Acceptance criteria: - [ ] CONST_ROADMAP_WEBHOOK_EVENTS includes push and check_run. - [ ] GitHubWebhookPayload parses ref and check_run, with tests. - [ ] A signed push delivery to the default branch enqueues only the lanes whose batch keys declare push. - [ ] A signed completed check_run delivery enqueues only the lanes whose batch keys declare check_run. - [ ] The test at tests/server/test_server_service.py:1961 expects the new route.

Proposed design

Problem statement

The Service ignores push and check_run webhook deliveries. A push to the default branch does not wake the watch row. A completed check run does not wake the implement row. This change subscribes the Service to both events. It parses the ref, check_run and repository default branch fields. It wakes only the lane whose batch key declares the event.

Acceptance criteria

Requirement: Event set holds push and check_run

CONST_ROADMAP_WEBHOOK_EVENTS SHALL hold push and check_run.

Scenario: Set membership

  • WHEN The test imports CONST_ROADMAP_WEBHOOK_EVENTS from devops_cli.config.constants.
  • THEN The set holds push and check_run.

Requirement: Payload parses the push ref

GitHubWebhookPayload SHALL parse the optional ref of a push delivery.

Scenario: Push ref

  • WHEN The test validates a push body whose ref is refs/heads/main.
  • THEN The parsed ref holds refs/heads/main, and a body with no ref still validates.

Requirement: Payload parses the check run

GitHubWebhookPayload SHALL parse the optional check_run object with its status and its conclusion.

Scenario: Check run fields

  • WHEN The test validates a check_run body with status completed and conclusion failure.
  • THEN The parsed check_run status holds completed and its conclusion holds failure.

Requirement: Payload parses the repository default branch

GitHubWebhookPayload SHALL parse the default branch of the repository of a delivery.

Scenario: Repository default branch

  • WHEN The test validates a delivery body whose repository.default_branch is main.
  • THEN The parsed repository default branch holds main.

Requirement: Default-branch push wakes the watch lane

A signed push delivery whose ref names the default branch SHALL enqueue the watch lane.

Scenario: Push to the default branch

  • WHEN The test posts a signed push delivery with ref refs/heads/main and repository.default_branch main.
  • THEN The response is 200, and only the watch lane receives one delivery.

Requirement: Push to another branch wakes no lane

A signed push delivery whose ref names another branch SHALL enqueue no lane.

Scenario: Push to a feature branch

  • WHEN The test posts a signed push delivery with ref refs/heads/feature and repository.default_branch main.
  • THEN The response is 200, and no lane receives a delivery.

Requirement: Completed check_run wakes the implement lane

A signed check_run delivery whose status is completed SHALL enqueue the implement lane.

Scenario: Completed check run

  • WHEN The test posts a signed check_run delivery with status completed and conclusion failure.
  • THEN The response is 200, and only the implement lane receives one delivery.

Requirement: Unfinished check_run wakes no lane

A signed check_run delivery whose status is not completed SHALL enqueue no lane.

Scenario: Queued check run

  • WHEN The test posts a signed check_run delivery with status queued.
  • THEN The response is 200, and no lane receives a delivery.

Requirement: Batch keys declare the new events

The batch keys of the watch row SHALL declare push, and the batch keys of the implement row SHALL declare check_run.

Scenario: Batch key events

  • WHEN The test reads the due table rows of the Service.
  • THEN The batch keys of the watch row hold push, and the batch keys of the implement row hold check_run.

Requirement: Pending a person after the merge

The repository hook MUST subscribe to push and check_run after the merge.

Scenario: Owner applies the repository settings

  • WHEN The owner applies the repository settings of the repository after the merge.
  • THEN The repository hook lists push and check_run among its subscribed events.

Existing Tool Considered

No alternatives check has run. pydantic is the open and maintained library that parses the webhook payload into typed models, and the Service already uses it. The model lacks ref, check_run and repository.default_branch. This change adds three optional fields, one WebhookCheckRun model and one default-branch rule, about 60 lines. That extension costs about 10k tokens to build, keep and fix, and about 2 hours.

Key questions

  • Which row does each new webhook event wake?: A push to the default branch wakes the watch row, and a completed check_run wakes the implement row. Each row declares its own batch key, so one delivery wakes one lane. (best practice) [sources: src/devops_cli/roadmap/run.py, src/devops_cli/config/constants.py:4311]
    • Chosen: One batch key for each row. A delivery wakes exactly one lane, and the due table shows the event of each row.
    • Rejected: One shared batch key for both events. Both rows would read one delivery, so one event would wake two lanes.
    • Rejected: Add the events to the event set only. The route would accept the events and enqueue no lane, so no row wakes.
  • How does the route know the default branch of a push?: The route parses repository.default_branch from the same payload and compares ref with refs/heads/<default_branch>. (best practice) [sources: src/devops_cli/models/webhooks.py:124, CONTEXT.md]
    • Chosen: Parse repository.default_branch from the payload. It adds no network call and no project fact to the config.
    • Rejected: Read the default branch from the devops-cli config. The config holds operational keys only, and a project fact belongs to the project profile.
    • Rejected: Call the GitHub API on each delivery. It adds a network call and a failure mode to the webhook path.
  • Where does the route drop a push to another branch and an unfinished check_run?: In the route, before it enqueues. The route reads the typed payload, answers 200 and enqueues nothing. (best practice) [sources: src/devops_cli/server/routes/webhooks.py, src/devops_cli/roadmap/run.py]
    • Chosen: Drop in the route before the enqueue. The route computes the batch key from the event and the action, so the branch rule must run before it.
    • Rejected: Drop in the consumer after the enqueue. The consumer runs a round, so it cannot stop the delivery that it reads.
    • Rejected: Answer 400 for a dropped delivery. GitHub retries a failed delivery, and the event is valid.
  • Which check_run delivery wakes the implement row?: A check_run whose status is completed. The conclusion does not narrow it, because a failed check must wake the row too. (best practice) [sources: src/devops_cli/models/webhooks.py:124, src/devops_cli/roadmap/run.py]
    • Chosen: Filter on status completed. A failed check changes the row, so the conclusion must not narrow the event.
    • Rejected: Filter on conclusion success. A failed check would not wake the row, and its repair would wait for the next sweep.
  • Which model holds the check_run status and conclusion?: A new optional WebhookCheckRun model with status and conclusion, and an optional check_run field on GitHubWebhookPayload. It copies the pattern of WebhookRelease: extra ignore and frozen. (best practice) [sources: src/devops_cli/models/webhooks.py:124]
    • Chosen: Add a WebhookCheckRun sub-model. The payload nests the object, and the model declares only the fields that the route reads.
    • Rejected: Add flat check_run_status and check_run_conclusion fields. A flat field needs a validator to read the nested object, and the model loses its shape.
    • Rejected: Read the raw dictionary in the route. It bypasses the typed payload and the validation answer of the route.
  • Does the repository hook subscription follow the event set?: Yes. The onboarding service rows read CONST_ROADMAP_WEBHOOK_EVENTS, so the two new events become required events of the repository hook. The owner applies the repository settings after the merge. (best practice) [sources: src/devops_cli/github/onboard/service_rows.py, src/devops_cli/config/constants.py:4311]
    • Chosen: Extend the event set and let onboarding apply it. One source names the events, so the code and the hook cannot drift.
    • Rejected: Add the two events to the hook by hand. A hand change drifts from the code at the next onboarding.
  • Which test covers the new push and check_run routes?: The push case at tests/server/test_server_service.py:1961 expects the watch lane delivery, and a check_run case beside it expects the implement lane delivery. Both post a signed delivery. (best practice) [sources: tests/server/test_server_service.py:1961, tests/server/test_server_service.py]
    • Chosen: Update the existing push case and add one check_run case. One case for each event, and the file already tests the webhook route.
    • Rejected: Add two new cases and keep the old push case. Two cases would assert one route, and the old case would assert the old answer.
  • Where is CONST_ROADMAP_WEBHOOK_EVENTS defined, and which code reads it?: It is defined at src/devops_cli/config/constants.py:4311. The webhook route, the onboarding service rows and the due-table tests read it. [sources: src/devops_cli/config/constants.py:4311, src/devops_cli/server/routes/webhooks.py, src/devops_cli/github/onboard/service_rows.py]
  • Where is GitHubWebhookPayload defined?: It is defined at src/devops_cli/models/webhooks.py:124. The webhook route is its only caller. [sources: src/devops_cli/models/webhooks.py:124, src/devops_cli/server/routes/webhooks.py]
  • Which documents change with the new subscriptions?: The change writes an OpenSpec change with a spec delta for the webhook capability. AGENTS.md rule 8 fixes each document that the new events make wrong in the same pull request. (best practice) [sources: AGENTS.md, openspec/config.yaml, docs/CLUSTER.md]
    • Chosen: Spec delta, and each document that names the events. AGENTS.md rule 8 fixes a wrong document in the same pull request.
    • Rejected: No document change. A document that names the events would stay wrong after the merge.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#5555

Activity

  1. added
    type/feature
    source/agent
    status/new
    value/medium
    effort/medium
    scope/service
    on Nov 25, 2026
  2. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor
  3. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  4. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  5. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the alternatives check records a verdict. See the section Proposed design of the body.

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/p2-mediumscope/servicesource/agentstatus/newtype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions