Skip to content

docs: add webhooks documentation (UI and API) [OD-702] - #2758

Open
claudiacodacy wants to merge 5 commits into
masterfrom
docs-add-webhooks-documentation-od-702
Open

claudiacodacy wants to merge 5 commits into
masterfrom
docs-add-webhooks-documentation-od-702

Conversation

@claudiacodacy

@claudiacodacy claudiacodacy commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Single PR for webhooks docs. This was split in two (#2767 API only, #2758 UI walkthrough) so the API page could ship ahead of the UI. The org Integrations UI is now almost ready, so we only need this one PR. #2767 is closed as superseded, and this PR carries everything.

Summary

  • Adds the org webhooks page, organizations/integrations/webhooks.md, registered under Organizations > Managing integrations next to the Slack and Jira integration pages.
  • UI walkthrough: open Integrations, page Webhooks, add an endpoint by its Payload URL, copy the signing secret from the card (shown once), delete an endpoint, the 10-endpoint limit, and the upgrade prompt for organizations without access.
  • API: the same operations through createWebhookEndpoint, listWebhookEndpoints and deleteWebhookEndpoint, with curl examples.
  • Wire contract: the quality.analysis.completed event, payload and headers, HMAC-SHA256 verification, and delivery behavior (10 s timeout, 5xx and timeout retried up to 2 more times at about 1 s then 5 s, 4xx not retried, dedupe on X-Codacy-Delivery for retries and commitSha for reanalysis).
  • Adds a row and footnote 6 to the organization permissions table.

No IA change: the page sits where both earlier PRs put it, and no file moves, so no redirects are needed.

Sourcing

Before merging

  • Merge after the org Integrations UI ships. codacy-spa#3144 (OD-699) is still open, and the UI is still behind the tempEventWebhooks flag.
  • codacy-spa#3144 links "How to verify deliveries" to #delivery-payload. Verification is under #verifying-a-delivery, so the link should change there.
  • The docs don't say whether non-admin members can see the endpoint list. The UI shows them a read-only list, but the list API needs organization write permission (per docs: add webhooks documentation (API only) [OD-702] #2767).

Test plan

  • mkdocs build --strict passes with no warnings
  • nav: entry present in mkdocs.yml, and site/organizations/integrations/webhooks/index.html is built
  • vale on the two changed pages: only the existing em-dash spacing (Microsoft.Dashes) and "backoff" flags remain

🤖 Generated with Claude Code

@claudiacodacy
claudiacodacy requested a review from a team as a code owner September 24, 2026 09:03
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Overall readability score: 54.21 (🟢 +0.01)

File Readability
roles-and-permissions-for-organizations.md 61.87 (🟢 +0)
webhooks.md 70.75 (🟢 +2.21)
View detailed metrics

🟢 - Shows an increase in readability
🔴 - Shows a decrease in readability

File Readability FRE GF ARI CLI DCRS
roles-and-permissions-for-organizations.md 61.87 31.17 8.45 11.9 12.93 6.21
  🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
webhooks.md 70.75 47.89 8.25 9.8 10.43 6.46
  🟢 +2.21 🟢 +0.3 🟢 +0.47 🟢 +0.2 🟢 +0.12 🟢 +0.28

Averages:

  Readability FRE GF ARI CLI DCRS
Average 54.21 43.01 10.9 12.33 12.27 7.99
  🟢 +0.01 🟢 +0 🟢 +0 🟢 +0 🟢 +0 🟢 +0
View metric targets
Metric Range Ideal score
Flesch Reading Ease 100 (very easy read) to 0 (extremely difficult read) 60
Gunning Fog 6 (very easy read) to 17 (extremely difficult read) 8 or less
Auto. Read. Index 6 (very easy read) to 14 (extremely difficult read) 8 or less
Coleman Liau Index 6 (very easy read) to 17 (extremely difficult read) 8 or less
Dale-Chall Readability 4.9 (very easy read) to 9.9 (extremely difficult read) 6.9 or less

@github-actions
github-actions Bot temporarily deployed to Netlify September 24, 2026 09:04 Inactive
@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

The webhook verification documentation allows replay of captured valid deliveries because the timestamp and delivery ID are not covered by the signature and replay handling is not defined. This security gap should be addressed before merging.

The strict MkDocs build and several acceptance criteria remain unverified because no build artifact or automated test evidence is included. Codacy is up to standards; no uncovered complex files were reported.

Test suggestions

  • Strict MkDocs build validates the new page and navigation entry without warnings.
  • Documentation covers adding, deleting, endpoint limits, permissions, HTTPS validation, and signing-secret lifecycle.
  • Documentation accurately describes branch and pull request event payloads and delivery conditions.
  • Documentation accurately describes headers, HMAC-SHA256 verification, timeout, retry, and deduplication behavior.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Strict MkDocs build validates the new page and navigation entry without warnings.
2. Documentation covers adding, deleting, endpoint limits, permissions, HTTPS validation, and signing-secret lifecycle.
3. Documentation accurately describes branch and pull request event payloads and delivery conditions.
4. Documentation accurately describes headers, HMAC-SHA256 verification, timeout, retry, and deduplication behavior.
Low confidence findings
  • Validate the documented endpoint-management flow against the shipped UI before relying on it as the authoritative guide.
  • Add or link automated evidence that mkdocs build --strict completes without warnings.

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback


1. Compute the HMAC-SHA256 hash of the raw request body, using the endpoint's signing secret as the key.
1. Hex-encode the hash and prefix it with `sha256=`.
1. Compare the result to the `X-Codacy-Signature` header using a constant-time comparison, and reject the delivery if they don't match.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

This verification flow permits replay of a captured, valid delivery. Include the timestamp and delivery ID in the signed material, or explicitly require consumers to deduplicate X-Codacy-Delivery values and document that the timestamp cannot be trusted for freshness unless it is covered by the signature. Define the exact HMAC input, require constant-time signature comparison, and explain rejection of duplicate delivery IDs and stale requests.

@github-actions
github-actions Bot temporarily deployed to Netlify September 24, 2026 09:12 Inactive
@github-actions
github-actions Bot temporarily deployed to Netlify September 24, 2026 09:28 Inactive
@andrzej-janczak

Copy link
Copy Markdown
Contributor

Heads-up: the M1 wire contract changed after this was approved (outbound-hooks#15, codacy-events#260):

  • X-Codacy-Timestamp header removed. The HMAC signs only the body, so an unsigned timestamp header could be replayed or altered without detection.
  • Body timestamp is now an ISO 8601 UTC string, second precision (e.g. "2025-09-17T23:00:00Z"), not unix seconds. It is inside the signed body.
  • New body field status: success, partial_success or failure. Webhooks now fire for failed analyses too.
    Please update the headers table, both JSON examples and the timestamp bullet before merging.

Copy link
Copy Markdown
Contributor Author

amazing

@andrzej-janczak

Copy link
Copy Markdown
Contributor

In "Delivery behavior", please also note that Codacy retries a 5xx or a timeout up to 2 more times (200 ms, 400 ms delay) before giving up; only a 4xx drops immediately, without retry. A retry reuses the same X-Codacy-Delivery value, so integrators should dedupe on X-Codacy-Delivery for retries and on commitSha for reanalysis. Matches outbound-hooks#15.

@github-actions
github-actions Bot temporarily deployed to Netlify September 28, 2026 11:14 Inactive
@claudiacodacy
claudiacodacy force-pushed the docs-add-webhooks-documentation-od-702 branch from 22e08dd to 3411b56 Compare September 28, 2026 11:17
@claudiacodacy claudiacodacy changed the title docs: add webhooks documentation [OD-702] docs: add the org Integrations UI walkthrough for webhooks [OD-702] Sep 28, 2026
@claudiacodacy
claudiacodacy changed the base branch from master to docs-webhooks-api-only-od-702 September 28, 2026 11:17
@claudiacodacy

Copy link
Copy Markdown
Contributor Author

Addressed both, on #2767 (the wire-contract content, inherited here):

  • Wire contract: dropped `X-Codacy-Timestamp`, moved `timestamp` into the signed body as ISO 8601 (`2025-09-17T23:00:00Z`), added `status` (`success`/`partial_success`/`failure`).
  • Delivery behavior: `5xx`/timeout retries up to 2 more times (200 ms, 400 ms), `4xx` drops immediately, retries reuse `X-Codacy-Delivery`.

Also split this PR in two: #2767 ships the API-only page this week (org Integrations UI isn't built yet), and this PR now carries just the UI walkthrough on top, to merge once the UI ships.

@github-actions
github-actions Bot temporarily deployed to Netlify September 28, 2026 11:18 Inactive
@andrzej-janczak

Copy link
Copy Markdown
Contributor

Update to the retry timing (outbound-hooks#24): a 5xx or timeout is now retried with exponential backoff, about 1 s then 2 s (with jitter), still 3 attempts in total; a 4xx is not retried. Please use these numbers instead of 200 ms / 400 ms.

claudiacodacy and others added 2 commits September 29, 2026 14:04
Documents the M1 webhooks feature for its first release: adding,
listing, and deleting an organization webhook endpoint via the Codacy
API (the org Integrations UI page ships in a follow-up), the
quality.analysis.completed event, the delivery payload and headers,
HMAC-SHA256 signature verification, and delivery behavior (10s
timeout, retry on 5xx/timeout, no retry on 4xx, dedupe on
X-Codacy-Delivery for retries and commitSha for reanalysis).

Registers the page under Organizations > Managing integrations in
mkdocs.yml, alongside the Slack and Jira integration pages, and adds
a row to the organization permissions table.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@claudiacodacy
claudiacodacy force-pushed the docs-add-webhooks-documentation-od-702 branch from 3411b56 to 694e068 Compare September 29, 2026 13:05
@claudiacodacy
claudiacodacy force-pushed the docs-webhooks-api-only-od-702 branch from 8d9b516 to 5d8fb7e Compare September 29, 2026 13:05
@github-actions
github-actions Bot temporarily deployed to Netlify September 29, 2026 13:06 Inactive
@andrzej-janczak

Copy link
Copy Markdown
Contributor

Correction to my previous note: the retry delays are about 1 s then 5 s (exponential factor 5, with jitter), still 3 attempts in total; a 4xx is not retried.

claudiacodacy and others added 2 commits September 29, 2026 14:48
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Restacks on #2767 (the API-only release for this week) and adds the
org Integrations > Webhooks UI: the Add endpoint flow, the one-time
signing-secret card, the endpoint list, and the upgrade prompt shown
when the organization isn't entitled. Merge once the UI ships
(OD-697, OD-699, OD-701, OD-709).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@claudiacodacy
claudiacodacy force-pushed the docs-add-webhooks-documentation-od-702 branch from 694e068 to 0afd385 Compare September 29, 2026 13:48
@github-actions
github-actions Bot temporarily deployed to Netlify September 29, 2026 13:52 Inactive
…e [OD-702]

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@claudiacodacy claudiacodacy changed the title docs: add the org Integrations UI walkthrough for webhooks [OD-702] docs: add webhooks documentation (UI and API) [OD-702] Sep 30, 2026
@claudiacodacy
claudiacodacy changed the base branch from docs-webhooks-api-only-od-702 to master September 30, 2026 08:37
@claudiacodacy

Copy link
Copy Markdown
Contributor Author

Retargeted to master and now carries the full webhooks docs (UI walkthrough, API, wire contract). Since the front end is almost ready, we only need this one PR, so I've closed #2767 as superseded. The two changes since the last review: the UI walkthrough now sits alongside the API section (the curl examples are back), and the labels are checked against the merged codacy-spa code. Three open items are listed under "Before merging" in the description.

This branch was successfully deployed

1 active deployment
Netlify — a0354a67 Deployed Sep 30, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants