Skip to content

feat: add namespace in the slack notification#2452

Merged
alepane21 merged 1 commit intomainfrom
ale/eng-5538-update-the-slack-webhook-payload-to-include-the-namespace
Jan 14, 2026
Merged

feat: add namespace in the slack notification#2452
alepane21 merged 1 commit intomainfrom
ale/eng-5538-update-the-slack-webhook-payload-to-include-the-namespace

Conversation

@alepane21
Copy link
Copy Markdown
Contributor

@alepane21 alepane21 commented Jan 14, 2026

Summary by CodeRabbit

  • Improvements
    • Slack notifications for federated graph schema updates now include namespace context, providing better clarity on which namespace has been updated.

✏️ Tip: You can customize this high-level summary in your review settings.

Checklist

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 14, 2026

Walkthrough

The 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

Cohort / File(s) Summary
Webhook Notification Message Update
controlplane/src/core/webhooks/OrganizationWebhookService.ts
Modified Slack notification message text for federated graph schema updates to include namespace context in bold formatting.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding namespace context to Slack notifications for federated graph updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings


📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 73f4c88 and b307de6.

📒 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.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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.name and graph.namespace into 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 for MONOGRAPH_SCHEMA_UPDATED events but still says "federated graph".

Suggested fix
+        const escapeMrkdwn = (s: string) =>
+          s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').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

📥 Commits

Reviewing files that changed from the base of the PR and between 73f4c88 and b307de6.

📒 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
Copy link
Copy Markdown

codecov Bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 62.78%. Comparing base (c8f945d) to head (b307de6).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ne/src/core/webhooks/OrganizationWebhookService.ts 0.00% 1 Missing ⚠️
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     
Files with missing lines Coverage Δ
...ne/src/core/webhooks/OrganizationWebhookService.ts 20.56% <0.00%> (ø)

... and 524 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@alepane21 alepane21 merged commit 8721174 into main Jan 14, 2026
12 checks passed
@alepane21 alepane21 deleted the ale/eng-5538-update-the-slack-webhook-payload-to-include-the-namespace branch January 14, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants