Conversation
WalkthroughThe federated graph schema update notification in the webhook service is modified to include namespace context. The Slack message now appends the graph's namespace in the notification text, changing from a simple update statement to one that specifies the namespace where the update occurred. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
✏️ Tip: You can disable this entire section by setting Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
controlplane/src/core/webhooks/OrganizationWebhookService.ts (1)
317-325: Escape mrkdwn control characters and fix "federated graph" label for monograph events.The message interpolates
graph.nameandgraph.namespaceinto mrkdwn text without escaping. Slack mrkdwn requires HTML-entity escaping for&,<, and>. Additionally,*is a mrkdwn formatting character and should be escaped in plain text. This applies to both the display text and URL components. Also, this message is used forMONOGRAPH_SCHEMA_UPDATEDevents but still says "federated graph".Suggested fix
+ const escapeMrkdwn = (s: string) => + s.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/\*/g, '\\*'); + const safeLinkText = escapeMrkdwn(graph.name); + const safeNamespace = escapeMrkdwn(graph.namespace); + const graphKind = + eventData.eventName === OrganizationEventName.MONOGRAPH_SCHEMA_UPDATED ? 'monograph' : 'federated graph'; + + const baseUrl = process.env.WEB_BASE_URL ?? ''; + const graphUrl = + `${baseUrl}/${encodeURIComponent(eventData.payload.organization.slug)}` + + `/${encodeURIComponent(graph.namespace)}/graph/${encodeURIComponent(graph.name)}`; + const tempData: { blocks: any[]; attachments: any[] } = { blocks: [ { type: 'section', text: { type: 'mrkdwn', - text: `🚀 Schema of the federated graph *<${process.env.WEB_BASE_URL}/${eventData.payload.organization.slug}/${graph.namespace}/graph/${graph.name} | ${graph.name}>* in *${graph.namespace}* namespace has been updated 🎉`, + text: `🚀 Schema of the ${graphKind} *<${graphUrl}|${safeLinkText}>* in *${safeNamespace}* namespace has been updated 🎉`, }, }, ],
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
controlplane/src/core/webhooks/OrganizationWebhookService.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: build_test
- GitHub Check: build_push_image
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (go)
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2452 +/- ##
==========================================
+ Coverage 60.84% 62.78% +1.94%
==========================================
Files 229 296 +67
Lines 23839 41422 +17583
Branches 0 4262 +4262
==========================================
+ Hits 14504 26007 +11503
- Misses 8089 15394 +7305
+ Partials 1246 21 -1225
🚀 New features to boost your workflow:
|
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.
Checklist