Repository navigation
Description
Problem Description
22 of the 60 newest deliveries of the repository hook (2026-11-12 07:56-08:09Z) got HTTP 403 with the response header Server: cloudflare (read on 2026-11-12). GitHub does not send a failed delivery again, and the redelivery item #4560 is not built. The alert RoadmapServiceWebhooksRejected counts only the refusals of the route behind Traefik (k8s/README.md, Webhook route), so it cannot see a refusal at the Cloudflare edge. Each event step of this plan (pull_request due marks, #4413, #4416, #4415) needs the deliveries. A search found no open issue for it.
Reproduction Steps
- Run
uv run devops gh api repos/dan-petty/devops-cli/hooksand note the id of the repository hook. - Run
uv run devops gh api repos/dan-petty/devops-cli/hooks/<hook-id>/deliveries --jq '[.[]|select(.status_code==403)]|length'. - Read one failed delivery with
uv run devops gh api repos/dan-petty/devops-cli/hooks/<hook-id>/deliveries/<delivery-id>and look at the response headers.
Expected vs Actual Behavior
Expected: each signed delivery reaches the webhook route of the Service. The route answers 2xx, or 401 for a bad signature, or 429 above its rate limit.
Actual: 22 of the 60 newest deliveries (2026-11-12 07:56-08:09Z) got HTTP 403 with the response header Server: cloudflare. The alert RoadmapServiceWebhooksRejected does not fire, because it counts only the refusals behind Traefik.
Proposed Fix
- Check the premise first. Read the failed deliveries (time, event, status code, response headers) with
uv run devops gh api repos/<owner>/<name>/hooks/<id>/deliveries. Read the Access applications and policies of hooks. withdevops cloudflare access status --jsonanddevops cloudflare access policies <app-id>. Find the rule that answers 403: an Access application with no bypass for the path, a WAF rule or a rate rule. - When the cause is in the repository (a manifest, an OpenTofu file or a setting), fix it at the source. When the fix is a change of an Access or WAF rule at the edge, stop and give the evidence to the owner (decision O3).
- Add a check that fails when the problem comes back: the metrics row reads the newest deliveries of each hook of service.repos and sets the gauge devops_cli_service_webhook_delivery_failures{code}, and a Prometheus rule alerts when more than 5 deliveries fail in 15 minutes.
- Change k8s/README.md (Webhook route, setup step 6) to name the edge check.
Open tool: the GitHub hook deliveries API; no new tool.
Cost: about 0.5M tokens and 0.5 agent-day.
Acceptance Criteria
- After the fix,
uv run devops gh api repos/dan-petty/devops-cli/hooks/<hook-id>/deliveries --jq '[.[]|select(.status_code==403)]|length'gives 0 for the deliveries after the fix time. - A unit test reads a fake deliveries page with two 403 answers and sets the gauge to 2.
-
promtool test rulespasses for the new alert.
Dependencies
- None. An agent can start this item now.
- Part of feat(roadmap): track the Service step jobs #5014 (track the Service step jobs).
- A change of an Access or WAF rule at the edge waits for owner decision O3 on the tracker.
Pre-Submission Checklist
- This report holds no credential, private key, internal token, hostname or private address.
- I searched the open issues (webhook, 403, deliveries). feat(service): redeliver webhook deliveries that failed #4560 redelivers failed deliveries but does not find the cause.
Source: #5014
Proposed design
Problem statement
22 of the 60 newest deliveries of the repository hook got HTTP 403 with Server: cloudflare on 2026-11-12 07:56-08:09Z. GitHub does not send a failed delivery again, so each event step of the roadmap loses deliveries. The alert RoadmapServiceWebhooksRejected counts only the refusals of the route behind Traefik, so it cannot see a refusal at the edge. This change reads the deliveries of each hook, sets a gauge by status code, adds an alert, and names the edge check in the documentation. The search for the edge rule that answers 403 goes to a new issue, because only the owner changes the Cloudflare configuration.
Acceptance criteria
Requirement: The Service reads the deliveries of each hook
The Service SHALL read the newest deliveries of each repository hook of service.repos in its metrics round.
Scenario: A repository with two hooks
- WHEN The metrics row runs for a repository whose two hooks both answer a deliveries page.
- THEN The row sends one
GET /repos/<owner>/<name>/hooks/<id>/deliveriesrequest for each hook, anddevops_cli_github_requests_totalcounts each underrow="metrics".
Requirement: The installation token names the webhooks read permission
The installation token that the Service mints SHALL name the webhooks read permission.
Scenario: The permissions of a minted token
- WHEN The Service mints an installation token for a repository.
- THEN The mint request names
webhooks: readwith the permissions that the Service already names.
Requirement: The gauge counts the failed deliveries by code
The metrics row SHALL set devops_cli_service_webhook_delivery_failures{repo,code} to the number of deliveries of the newest page of each hook whose status code is 400 or above.
Scenario: A page with two 403 answers and one 202 answer
- WHEN The row reads a fake deliveries page that holds two 403 answers and one 202 answer.
- THEN The gauge holds the value 2 for
code="403"and no series for a code below 400.
Requirement: A burst of failed deliveries alerts
A rule of the group roadmap-service-webhooks SHALL fire when a repository has more than 5 failed deliveries.
Scenario: Six 403 deliveries in the newest page
- WHEN
promtool test rulesevaluates the group withdevops_cli_service_webhook_delivery_failures{code="403",repo="dan-petty/devops-cli"}at 6. - THEN The rule fires with
severity="warning"and names the repository, and it stays quiet on the same series at 5.
Requirement: The documentation names the edge check
k8s/README.md SHALL name the deliveries check in the Webhook route section and in the Alerts table.
Scenario: The Webhook route section and the Alerts table
- WHEN A test reads
k8s/README.md. - THEN The Webhook route section holds the deliveries command and the
Server: cloudflareheader, and the Alerts table holds the row of the new rule.
Existing Tool Considered
No alternatives check has run. The GitHub REST API for repository webhook deliveries covers the need, and the repository reaches it with uv run devops gh api repos/<owner>/<name>/hooks/<id>/deliveries (Reproduction steps). It lacks a view of the Cloudflare edge: it gives the status code and the response header Server: cloudflare, and not the Access, WAF or rate rule that answered. The change writes no client for the API. It adds the metric, the rule, the tests and the documentation, at about 0.5M tokens and 0.5 agent-day (Cost).
Key questions
- Which row of the Service reads the deliveries of each hook?: The
metricsrow of the status lane reads each hook ofservice.reposonce in its round. It already reads GitHub in the round and needs no clone. (best practice) [sources: k8s/README.md]- Chosen: The
metricsrow of the status lane. It reads GitHub in each round and needs no clone. - Rejected: A new row of the status lane. It adds a row, an interval and a lane slot for one request for each hook.
- Rejected: The
pr_conflictsrow. That row judges pull requests and reads no hook.
- Chosen: The
- Is the delivery count a gauge of the newest page, or a counter of new deliveries?: The Service sets the gauge
devops_cli_service_webhook_delivery_failures{repo,code}from the newest deliveries page of each hook. A counter would count the same delivery again in each round, unless the Service kept a fifth state file. (best practice) [sources: k8s/README.md]- Chosen: A gauge of the newest page. It needs no state file, and the page holds the time, the event and the status code of each delivery.
- Rejected: A counter with a record of the counted delivery ids. It adds a state record, its write failure and its
devops_cli_service_state_unkeptvalue.
- Which status codes does the gauge count?: Each status code from 400 up, in its own series. (best practice) [sources: k8s/README.md]
- Chosen: Each code from 400 up. The route answers 2xx for a good delivery, and a 401, 413, 415, 429 or 503 is a fault that the runbook names.
- Rejected: 403 only. It hides a bad secret, a body above the cap and the rate limit.
- Rejected: Each code that is not 2xx. A 3xx is no refusal, and it adds a series with no meaning.
- How does the Service read the deliveries of a hook?: With the installation token of the GitHub App, with
webhooks: readadded to the permissions that the Service names. The App already grants read and write on every repository permission, so the mint succeeds. (best practice) [sources: k8s/README.md, docs/adr/0015-roadmap-jobs-act-as-a-github-app-on-the-personal-account.md]- Chosen: The App token with
webhooks: read. It keeps one credential, and the installation token takes one permission more. - Rejected: A token from the owner's keyring. It puts a second credential in the cluster, and the owner's token acts as the owner.
- Rejected: The
last_responseof each hook. It holds one delivery, so it cannot count a burst.
- Chosen: The App token with
- Which rule group and which test file hold the webhook alerts?: The rule group
roadmap-service-webhooksink8s/monitoring/prometheus-values.yaml. The promtool cases are intests/fixtures/prometheus_rules/roadmap_service_webhooks_tests.yaml, run bytests/prometheus/test_k8s_monitoring_alerting.py. [sources: k8s/monitoring/prometheus-values.yaml:848, tests/fixtures/prometheus_rules/roadmap_service_webhooks_tests.yaml, tests/prometheus/test_k8s_monitoring_alerting.py]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 12, 2026
22 of 60 deliveries fail and multiple event steps depend on them, so the failure blocks active work.Both concern failed webhook deliveries, but the candidate finds and fixes the 403 cause while #4560 builds a redelivery mechanism.devops-cli-service commentedon Nov 12, 2026
The 403 refusals lose webhook deliveries and block the event steps of #5014.Both items concern failed webhook deliveries, but #4560 redelivers them and this item finds the 403 cause and adds an alert.dan-petty commentedon Nov 12, 2026
Premise check: Cloudflare Access refuses the deliveries from 3 new GitHub hook ranges
The cause is at the edge, not in the repository. A change of an Access policy is owner decision O3, so I did not change it. The pull request for this issue adds only the edge check (steps 3 and 4).
Evidence (read on 2026-11-12, read-only commands)
uv run devops gh api 'repos/dan-petty/devops-cli/hooks/692250036/deliveries?per_page=100'at 10:18Z: 39 of the 100 newest deliveries (10:04-10:17Z) got HTTP 403. The 403 answers come from all events and actions (issues.labeled,issues.edited,pull_request.openedand others), and they mix with 202 answers in the same seconds. So the cause is not one event and not a burst.uv run devops gh api repos/dan-petty/devops-cli/hooks/692250036/deliveries/<id>for 6 of the 403 deliveries: each answer has the headersServer: cloudflare,Cf-Access-Domain: hooks.<domain>and the sameCf-Access-Aud, and the body is the pageError ・ Cloudflare Access. The 403 answers take 0.08-0.3 s. An accepted delivery has noCf-Access-*header, hasX-Devops-Versionfrom the Service, and its body is{"status":"accepted"}. So Cloudflare Access refuses the request before it gets to the tunnel. It is not a WAF rule or a rate rule.devops cloudflare access status --json: the applicationGitHub Webhooks - Roadmap Servicecovershooks.<domain>/webhooks/github.devops cloudflare access policies <app-id>gives two Bypass policies and no Allow policy:gh-hooks-public-ips: 6 ranges,192.30.252.0/22,185.199.108.0/22,140.82.112.0/20,143.55.64.0/20,2a0a:a440::/29,2606:50c0::/32.homelab-public-ip-bypass: the public address of the home network.uv run devops gh api meta --jq .hooksgives 9 ranges. These 3 are not ingh-hooks-public-ips:9.234.98.160/28,9.234.98.176/28,9.234.106.48/28. A delivery from one of them matches no Bypass policy and no Allow policy, so Access answers 403.devops cloudflare access syncmakes only the policyhomelab-public-ip-bypass. A person madegh-hooks-public-ipsin the dashboard. Setup step 6 ofk8s/README.mdsays "add a Bypass application" and names no ranges.Decision O3 for the owner
gh-hooks-public-ipsto include Everyone on the pathhooks.<domain>/webhooks/githubonly. The route keeps its own controls: the HMAC signature check (401), the Traefik limit of 60 requests a minute (429) and the alertRoadmapServiceWebhooksRejected. GitHub can change its ranges again with no notice.gh-hooks-public-ips. Then compare the policy withuv run devops gh api meta --jq .hookseach time the new alert fires.After the change, this command must give 0 (put the change time in place of
<time>, for example2026-11-12T12:00:00Z):uv run devops gh api 'repos/dan-petty/devops-cli/hooks/692250036/deliveries?per_page=100' --jq '[.[]|select(.status_code==403 and .delivered_at > "<time>")]|length'. Note: gh's--jqrounds the delivery IDs, so to read one delivery, take its ID from the output without--jq.devops-cli-service commentedon Nov 12, 2026
Status set to Ready at 87ae9ee (see proposed design in issue body).
Moved to new items: #5035.
fix(service): alert when GitHub cannot deliver a webhook
docs(openspec): archive the change of #5017
devops-cli-service commentedon Nov 12, 2026
Released in v0.118.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.118.0
docs(openspec): plan the shared-set and extra-grant corrections of #4757
devops-cli-service commentedon Nov 12, 2026
Live since 2026-11-12 12:40 UTC