docs: add webhooks documentation [OD-702] - #2758
claudiacodacy wants to merge 3 commits into
Conversation
Documents the organization Webhooks page (org Integrations > Webhooks): adding and managing an endpoint, the quality.analysis.completed event, the delivery payload and headers, HMAC-SHA256 signature verification, and delivery behavior (10s timeout, no retry, dedupe on commitSha). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Overall readability score: 54.16 (🟢 +0.06)
View detailed metrics🟢 - Shows an increase in readability
Averages:
View metric targets
|
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
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 --strictcompletes 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. |
There was a problem hiding this comment.
🟡 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.
Adding and managing organization webhook endpoints is org admin/manager only, same as audit logs, and gated to Business plan the same way. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…[OD-702] - State that the Webhooks page itself shows the upgrade prompt when the org isn't entitled (confirmed by OD-701's dedicated upsell page), not just a vague pointer to contact sales. - Note there's no delivery log or resend, per the M1 "not in scope" list, since that's the first thing a reader will ask after "no retry." Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Heads-up: the M1 wire contract changed after this was approved (outbound-hooks#15, codacy-events#260):
|
|
amazing |
Summary
quality.analysis.completedevent (branch analysis finished / pull request analysis finished), the delivery payload and headers, HMAC-SHA256 signature verification, and delivery behavior (10s timeout, no retry, dedupe oncommitSha).mkdocs.yml, alongside the Slack and Jira integration pages.Sourcing
Grounded primarily in the current (2026-09-21) Linear project spec — US1–US8 and the wire event example — which is the authoritative description of what M1 ships, not the earlier repo-scoped design iterations it superseded. That means the page documents the full committed scope (add/list/delete an endpoint, both events, the signed payload, entitlement), not just the pieces already merged.
Cross-checked against the merged
codacy-websiteapiv3.yamlwebhook endpoints schemas and the shippedcodacy-sparoute/copy, but only to confirm naming and the page's URL — most of the UI this page documents (the add-endpoint flow, the signing-secret card, the upsell page) is still unbuilt (OD-697, OD-699, OD-701, OD-709 are open), and the merged v3 API is a mocked scaffold pending its real backend (OD-735).Filed under
organizations/integrations/and namedwebhooks.mdto match the docs path (organizations/integrations/webhooks/) already hardcoded inWebhooksPage.tsx.Test plan
mkdocs build --strictpasses with no warningsvale docs/organizations/integrations/webhooks.md— clean except pre-existing repo-wide em dash spacing style (Microsoft.Dashes), which is advisory and matches convention used throughout the rest of the docs (e.g.organizations/managing-security-and-risk.md)nav:entry confirmed by eye inmkdocs.yml🤖 Generated with Claude Code