add issue uuid to webhook call to api-server#21
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds IssueID to response and webhook payload. In submitLinearIssue, sets submitResponse.IssueID from Linear issue creation result. In submitWebhook, includes this IssueID in webhookRequest. Structures submitResponse and webhookRequest updated to carry the new field. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Client
participant Service as Service (submit.go)
participant Linear as Linear API
participant Webhook as Webhook Receiver
Client->>Service: Submit request
Service->>Linear: Create Issue
Linear-->>Service: createResp (Issue.ID)
note right of Service: New: resp.IssueID = Issue.ID
Service->>Webhook: webhookRequest{ ..., issue_id: resp.IssueID }
Webhook-->>Service: 2xx/ack
Service-->>Client: submitResponse{ ..., issue_id }
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
submit.go (1)
842-848: Propagation to webhook payload: LGTM; consider a small regression testMapping
submitResp.IssueIDinto the webhook request looks correct. Consider adding a unit/handler test that asserts the encoded JSON includes"issue_id":"<uuid>"on successful Linear creates to prevent regressions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
submit.go(4 hunks)
🔇 Additional comments (3)
submit.go (3)
123-127: Add IssueID to submitResponse: LGTMOptionality via
omitemptyis appropriate and keeps the wire shape stable when Linear is disabled.
828-834: Validate empty IssueID handling in submitWebhook
ThewebhookRequeststruct always includes"issue_id"(even when empty) since it lacksomitempty. Confirm thatsubmitWebhook(and any downstream logic) tolerates an emptyIssueID—for example, it doesn’t attempt to parse it as a UUID or error when it’s"". If it doesn’t, either addomitemptyto the JSON tag or only setIssueIDwhen Linear integration is enabled and document the empty-string case.
808-811: MutationCreateIssue includesid, IssueID will be populated
Verified that the GraphQL mutation selectsidand the Go response type definesIssue.ID, soresp.IssueIDis correctly set.
needed for https://github.com/beeper/beeper-services/pull/448