Repository navigation
Description
Update 2026-11-26 (infra move): devops roadmap onboard is now devops repos onboard. The consumer already takes pull_request, review, check and comment events (#6889), and devops repos onboard <owner>/<name> --confirm --only 12 writes a wrong or missing hook (with a new secret). Left: check each hook, and the brain write for a pull request delivery.
Split from #6013.
The brain cache can write from a webhook only when each Service repository hook sends that event. The roadmap consumer already handles issues and pull_request, but a person with repository admin must add pull_request to each hook. The issue_comment, pull_request_review, check_suite, check_run, status and push events also need a consumer subscription and a hook change. devops repos onboard row 12 can write a hook. This part is deferred because a person must change each repository setting, and the core cache can ship with issues events and read-through. Acceptance criteria: A person adds pull_request to each Service repository hook. gh api repos/<owner>/<name>/hooks shows pull_request in the events of each hook. The Service receives a pull_request event and the brain cache entry updates. The check and comment events are added when their consumer subscription exists.
Proposed design
Problem statement
The Service takes the pull request and check events, but the project brain gets no entry from a pull_request delivery. Each Service repository hook must also send the events that the consumer takes. This change writes the pull request into the brain before the consumer wakes a lane. A person runs the onboard command to fix each hook after the merge.
Acceptance criteria
Requirement: The webhook row requires the pull request event
The webhook row of devops repos onboard SHALL report a hook as wrong when its events lack pull_request.
Scenario: A hook sends the issue events only
- WHEN A test gives the row a hook with the URL, JSON content type and events
issues,milestoneandrelease. - THEN The row is
wrongand namesevents.
Requirement: A pull request delivery writes the brain entry
The roadmap consumer MUST write the pull request of a pull_request delivery into the project brain before it wakes a lane.
Scenario: An opened pull request fills the entry
- WHEN A test sends a signed
pull_requestdelivery with actionopenedto the Service with fake brain and lane. - THEN The fake tier holds the entry under the pull request number. The fake lane records one wake after the entry exists.
Requirement: Pending a person after the merge
A person with repository admin MUST make each Service repository hook send the events that the consumer takes.
Scenario: The hook events hold the consumer events
- WHEN A person runs
uv run devops repos onboard <owner>/<name> --confirm --only 12for each repository. The person then runsuv run devops gh api repos/<owner>/<name>/hooks --jq '.[]|{id,active,events,code:.last_response.code}'. - THEN Each hook is
active. Itseventsholdissues,issue_comment,pull_request,pull_request_review,check_suiteandrelease. Itscodeis 200 or 202.
Requirement: Pending a person after the merge
The Service MUST answer a pull_request delivery with a 2xx status.
Scenario: The newest delivery of the hook is accepted
- WHEN A person opens a pull request in a Service repository and runs
uv run devops gh api repos/<owner>/<name>/hooks/<hook-id>/deliveries --jq '.[0] | [.event, .status] | @tsv'. - THEN The command prints
pull_requestandOK.
Existing Tool Considered
No alternatives check has run. The open, maintained GitHub CLI (gh), wrapped as uv run devops gh api, reads and patches repository hooks. devops repos onboard --only 12 writes a missing or wrong hook. The CLI lacks one command that checks every hook of every repository in service.repos, so a person repeats the check. The brain write is project code that no tool covers: about 20k tokens to build, keep and fix, and half a day of elapsed work.
Key questions
- Does the roadmap consumer already take the
pull_requestand check events?: Yes. The issue update says feat(roadmap): Route pull, review and check events to watch #6889 addedpull_request, review, check and comment events to the consumer. Step 8 ofdocs/CLUSTER.mdlists the six events that the consumer takes.CONST_ROADMAP_WEBHOOK_EVENTSatsrc/devops_cli/config/constants.py:4299holds the consumer events. Theroadmap_consumerinsrc/devops_cli/server/routes/webhooks.pyuses that set. [sources: docs/CLUSTER.md, src/devops_cli/config/constants.py:4299, src/devops_cli/server/routes/webhooks.py] - How does a person fix a hook that lacks an event?: Run
uv run devops repos onboard <owner>/<name> --confirm --only 12for each repository inservice.repos. The command writes a missing or wrong hook with a new secret. Then runuv run devops gh api repos/<owner>/<name>/hooks --jq '.[]|{id,active,events,code:.last_response.code}'. Check that each hook isactiveand holds the consumer events. (best practice) [sources: docs/CLUSTER.md, src/devops_cli/github/onboard/service_rows.py, src/devops_cli/config/constants.py:4299]- Chosen: Run
devops repos onboard --only 12. The issue update says it writes a wrong or missing hook with a new secret. Row 12 compares the hook with the consumer events. - Rejected: Change Settings > Webhooks. It repeats the work for each hook and keeps no record of the events. The project records it as the manual fallback.
- Rejected: Add a new
devopscommand. The command already exists. A new command adds code and tests for no new result.
- Chosen: Run
- Which payload model carries the pull request fields?: Use the one
GitHubWebhookPayloadmodel atsrc/devops_cli/models/webhooks.py:124. Add or use thepull_requestfield of the issue shape. Thedeliverfunction insrc/devops_cli/server/routes/webhooks.pyreadspayload.pull_request.numberas the subject. ADR 0009 keeps one payload model for every event. (best practice) [sources: src/devops_cli/models/webhooks.py:124, src/devops_cli/server/routes/webhooks.py, docs/adr/0009-one-webhook-router-delivers-each-event-to-the-consumers-subscribed-to-it.md]- Chosen: One payload model with a
pull_requestfield. ADR 0009 keeps one model for every event. The Service reads the same fields. - Rejected:
.getchains. ADR 0009 replaces them with a typed model. A body that does not validate must get 400. - Rejected: A payload model for each event. The fields are the same. ADR 0009 rejects a model for each event.
- Chosen: One payload model with a
- How does the consumer write the pull request into the brain?: The consumer writes the pull request into the same brain entry that it uses for an issue. It does this before it wakes a lane. It uses the existing issue write path with the pull request number and its fields from the payload.
CONTEXT.mddefines the project brain as a derived index. (best practice) [sources: src/devops_cli/server/routes/webhooks.py, src/devops_cli/models/webhooks.py:124, CONTEXT.md]- Chosen: Reuse the issue write path. The brain entry is keyed by the issue or pull request number. The fields are the same.
- Rejected: Add a second brain write path for pull requests. It repeats the write and risks two entries for one number.
- Do
check_run,statusandpushbelong to this change?: No. The issue update says the consumer already takes the check events (feat(roadmap): Route pull, review and check events to watch #6889). The remaining work is the hook check and the brain write for a pull request delivery.check_run,statusandpushstay out until an item adds their consumer subscription and brain write. (best practice) [sources: docs/CLUSTER.md, src/devops_cli/config/constants.py:4299, docs/adr/0009-one-webhook-router-delivers-each-event-to-the-consumers-subscribed-to-it.md]- Chosen: Only the pull request brain write and the hook check. The consumer already takes the events. No code reads the other events.
- Rejected: Add all seven events now. The consumer has no subscription for
check_run,statusandpush. Each delivery ends asno_subscriberand changes nothing.
- Does the change fit one pull request?: Yes. The change touches the webhook route, the payload model and their tests. The hook change is a person step after the merge. [sources: src/devops_cli/server/routes/webhooks.py, src/devops_cli/models/webhooks.py:124]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 21, 2026
Both share the brain-cache-from-webhooks goal, but #6013 is the umbrella covering the full cache design while the candidate is only the manual hook-subscription step.docs(openspec): plan #6013 Cache issue state in the brain from webhoo…
devops-cli-service commentedon Nov 22, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
feat(service): cache GitHub issue state in the brain from webhooks (#…
devops-cli-service commentedon Nov 27, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.