Skip to content

feat(roadmap): onboard checks the webhook of a repository #3772

Closed

Description

@dan-petty

Problem

The Service takes a repository's webhook events and runs the scoped update at once. Without the webhook, the repository gets only the poll (a delay of up to one poll interval). k8s/README.md (step 8 of the Service setup) tells a person to add the webhook by hand, and devops roadmap onboard (#1359) has no row for it. A repository can be onboarded and still have no webhook, or a webhook with the wrong URL, content type or events, and nobody sees it.

Expected

devops roadmap onboard has a row for the webhook. It reads the hooks of the repository and reports present, missing or wrong with the reason. It writes nothing: a webhook carries a secret, and a webhook is a repository setting, so only a person adds it.

Acceptance criteria

  • A row webhook reads GET repos/<owner>/<name>/hooks. It is present when one active hook has the URL of the Service router, the content type application/json, and the events in CONST_ROADMAP_WEBHOOK_EVENTS.
  • A hook with another URL, content type or event set reads wrong, and the row names the field.
  • The installation token of the App has no administration permission, so it cannot list hooks. The row then reads not readable as <login> and prints the step. It does not fail.
  • When the row is missing or wrong, the command prints the exact step for a person: the URL, the content type, the events, and devops config set service.webhook_secrets for the secret. It never prints a secret and never creates a hook.
  • The step text in k8s/README.md (step 8) and the row use the same list of events. A test fails if they differ.
  • docs/roadmap/onboard.md describes the row.

Existing tool considered

The GitHub REST API lists hooks. No other tool is needed. The cost is about 120,000 tokens and 1 hour.

Related

#1359 (the command), #3742. ADR 0017 (each subscribed webhook event runs the update scoped to it).

Proposed design

Problem statement

The Service receives a repository's webhook events and runs the scoped update at once. Without the webhook, the repository waits for the poll. Onboarding has no row for the webhook. A repository can have no webhook or a wrong webhook, and nobody sees it. The change adds a read-only webhook row to devops roadmap onboard.

Acceptance criteria

Requirement: Webhook row reads hooks

devops roadmap onboard SHALL show a webhook row that reads GET repos/<owner>/<name>/hooks.

Scenario: The row reads hooks

  • WHEN the command runs for a repository whose installation token can read hooks
  • THEN the row sends one GET request to repos/<owner>/<name>/hooks and prints a status.

Requirement: A matching hook is present

The row SHALL report present when one active hook has the Service router URL, the JSON content type, and the event set in CONST_ROADMAP_WEBHOOK_EVENTS.

Scenario: One active hook matches

  • WHEN the hooks response holds one active hook with the configured URL, config.content_type json, and events equal to CONST_ROADMAP_WEBHOOK_EVENTS
  • THEN the row prints present and names no field as wrong.

Requirement: No hooks is missing

The row SHALL report missing when the hooks list is empty.

Scenario: The repository has no hooks

  • WHEN the hooks response holds an empty list
  • THEN the row prints missing and prints the setup step.

Requirement: A non-matching hook is wrong

The row SHALL report wrong and name the field when no active hook matches and the hooks list is not empty.

Scenario: One hook has wrong fields

  • WHEN the hooks response holds one hook with a different URL, content type, and event set
  • THEN the row prints wrong and names url, content_type, and events.

Requirement: An inactive Service hook is wrong

The row SHALL report wrong and name active when the only hook with the Service router URL is inactive.

Scenario: The Service hook is inactive

  • WHEN the hooks response holds one inactive hook with the configured URL, JSON content type, and required events
  • THEN the row prints wrong and names active.

Requirement: An unreadable hooks list does not fail

The row SHALL report not readable as <login> and print the setup step when GitHub refuses the hooks read.

Scenario: The token cannot read hooks

  • WHEN the hooks request returns HTTP 403 or 404
  • THEN the row prints not readable as devops-cli-service and the setup step, and the command exits 0.

Requirement: The setup step is exact and secret-safe

The row SHALL print the URL, the JSON content type, the events, and the service.webhook_secrets config command when it is missing or wrong.

Scenario: The row prints the step

  • WHEN the row is missing or wrong and the configuration holds a webhook secret
  • THEN the output holds the URL, application/json, each event, and devops config set service.webhook_secrets, and holds no secret value.

Requirement: The row writes nothing

The webhook row MUST make no write request to GitHub and MUST create no hook.

Scenario: The row reads hooks

  • WHEN the command runs with a fake GitHub client
  • THEN the client records only GET requests and no POST, PATCH, or DELETE request.

Requirement: The README and the row share one event list

The step text in k8s/README.md step 8 and the row SHALL use the same event list from CONST_ROADMAP_WEBHOOK_EVENTS.

Scenario: The README event list differs

  • WHEN the event list in step 8 differs from CONST_ROADMAP_WEBHOOK_EVENTS
  • THEN a test fails and names both lists.

Requirement: Onboard documentation describes the webhook row

docs/roadmap/onboard.md SHALL describe the webhook row and its results.

Scenario: The documentation lists the row

  • WHEN the documentation test reads docs/roadmap/onboard.md
  • THEN the file names webhook, present, missing, wrong, and not readable.

Existing Tool Considered

No alternatives check has run. The GitHub REST API GET repos/<owner>/<name>/hooks covers the read of repository hooks. It lacks the devops roadmap onboard row, the status comparison, and the setup text. The change builds that row. The written cost is about 120,000 tokens and 1 hour.

Key questions

  • Which endpoint and permission does the webhook row use?: The row uses GET repos/<owner>/<name>/hooks with the installation token. The App has no Administration permission, so the row treats HTTP 403 or 404 as not readable. [sources: k8s/README.md]
  • Which event list is authoritative for the row and the README?: CONST_ROADMAP_WEBHOOK_EVENTS is the only list. The row renders it. A test compares the rendered list in k8s/README.md step 8 with the constant. (best practice) [sources: src/devops_cli/config/constants.py, k8s/README.md, tests/roadmap/test_roadmap_run.py]
    • Chosen: Use CONST_ROADMAP_WEBHOOK_EVENTS. One source prevents drift between the row and the README.
    • Rejected: Copy the event list into the row and the README. Two copies drift and no test can hold them together.
  • Which value does the row compare for the webhook content type?: The row accepts json in config.content_type. The setup text says application/json. The GitHub API uses json for the JSON content type. (best practice) [sources: k8s/README.md]
    • Chosen: Compare config.content_type to json. This is the API value. The UI name is application/json.
    • Rejected: Compare config.content_type to application/json. The API returns json, so a correct hook would read wrong.
  • How does the row get the Service router URL?: The row derives https://hooks.<domain>/webhooks/github from the configured k8s.domain or cloudflare.domain. (best practice) [sources: k8s/README.md]
    • Chosen: Derive the URL from the configured domain. The router path is fixed and the domain settings already exist.
    • Rejected: Add a new service.webhook_url setting. The new setting adds configuration for a fixed router path.
  • Should the row create or change a webhook?: No. The row only reads hooks. A webhook carries a secret and is a repository setting, so a person adds it. (best practice) [sources: k8s/README.md, docs/adr/0003-polling-is-how-the-roadmap-sees-changes.md]
    • Chosen: Read only. The App has no Administration permission and the row must not print a secret.
    • Rejected: Create or patch the hook. The token cannot do it, and the command would handle a secret.
  • How does the row treat multiple hooks?: The row reports present when any active hook fully matches. When no hook matches, it reports wrong for the first hook and names the first field that differs. It reports missing only when the hooks list is empty. (best practice) [sources: k8s/README.md]
    • Chosen: Any fully matching active hook is present. A repository can hold other hooks, such as a CI hook.
    • Rejected: Exactly one hook must exist. A second unrelated hook would make a correct Service hook read wrong.
  • How does the row report an unreadable hooks list?: The row reports not readable as <login> and prints the setup step. It does not fail the command. (best practice) [sources: k8s/README.md]
    • Chosen: Report a row status and continue. Onboarding shows the other rows and the person can fix the App permission.
    • Rejected: Fail the command. The missing Administration permission is expected and must not stop onboarding.
  • Which login does the row print when the hooks read is refused?: The row prints the App slug from service.github_app.slug. The default slug is devops-cli-service. (best practice) [sources: k8s/README.md]
    • Chosen: Use the configured App slug. The token belongs to the App and the slug is configured in step 2.
    • Rejected: Use the GitHub user login. An installation token has no user login.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-08: partly.
Tool: gidgethub (https://pypi.org/project/gidgethub), Apache-2.0 AND MIT, last activity 2026-09-25, maintained.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 6, 2026
  2. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

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

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It catches a misconfiguration that delays updates, but polling still works so no user is blocked.
    • Value: Medium. It prevents a silent delay and gives a person the exact fix step, but the service still functions via polling.
    • Effort: Low. The body states the cost is about 120,000 tokens and 1 hour.
    • Related: feat(roadmap): onboard checks and starts the rag ingestion #3771, which asks for a different change. Both add a row to 'devops roadmap onboard', but #3771 checks RAG ingestion while the candidate checks the repository webhook.
  3. added
    priority/p2-medium
    on Nov 6, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 7, 2026
  5. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 517c58b (see proposed design in issue body).

  6. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Reason: The searches found no tool that checks a repository's webhook configuration; they only confirmed that the hooks listing is a GitHub REST API call. gidgethub, the GitHub client the project's session already sends its requests through (ADR 0006), can make that authenticated GET repos/<owner>/<name>/hooks read, but it covers only the read, not the onboarding row, the status comparison, the permission-safe handling or the setup text.

    Tool: gidgethub (https://pypi.org/project/gidgethub)

    • License: Apache-2.0 AND MIT
    • Last activity: 2026-09-25
    • Maintained: yes

    Covers:

    • Sends an authenticated GET repos/<owner>/<name>/hooks through the project's existing GitHub session
    • Returns each hook's config url, config content_type, events and active flag for comparison

    Lacks:

    • The webhook row of devops roadmap onboard and its present/missing/wrong status
    • Comparison of url, content type and events against the Service router URL and CONST_ROADMAP_WEBHOOK_EVENTS
    • The not readable as <login> status when the installation token cannot list hooks (403/404)
    • The secret-safe setup step text and the test that keeps k8s/README.md step 8 in sync
    • A webhook-specific checker; the issue names only the GitHub REST API itself

    Tools considered:

    Searches run:

    • GitHub REST API list repository webhooks GET repos owner repo hooks, results: 5
    • tool to check GitHub repository webhook configuration present missing wrong url events, results: 5
    • "repos/{owner}/{repo}/hooks" GitHub REST API repository webhooks documentation, results: 5
    • gidgethub python library GitHub API, results: 5
    • gh extension list repository webhooks configuration check, results: 5
    • python library list repository hooks webhook validation github, results: 5

    Sources:

    Checked on 2026-11-08. A person decides what this means for the item. The check changes no label and closes no issue.

  7. added
    status/in-review
    and removed
    status/ready
    on Nov 14, 2026
  8. removed
    status/in-review
    on Nov 14, 2026
  9. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 21:08 UTC

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/lowpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions