Skip to content

chore: add slack notification for UT deployment PRs - #4546

Merged
koladilip merged 1 commit into
developfrom
feature/int-3976-add-slack-notification-for-ut-deployment
Aug 13, 2025
Merged

koladilip merged 1 commit into
developfrom
feature/int-3976-add-slack-notification-for-ut-deployment

Conversation

@koladilip

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Added Slack notification functionality to the UT deployment workflow to notify the Control Plane team when DevOps PRs are created.

What is the related Linear task?

Resolves INT-3976

Please explain the objectives of your changes below

This PR implements Slack notifications for UT deployment as requested in the Linear issue. The changes include:

Any changes to existing capabilities/behaviour, mention the reason & what are the changes ?

  • Modified UT deployment workflow: Added PR URL capture for all three types of DevOps PRs (shared, hosted, dedicated transformers)
  • Added Slack notification step: New step that sends a notification with PR links to the Control Plane team
  • Updated Slack action security: Updated all Slack actions to use specific commit hash for security

Any new dependencies introduced with this change?

N/A - Uses existing Slack action with security update

Any new generic utility introduced or modified. Please explain the changes.

N/A

Any technical or performance related pointers to consider with the change?

  • Uses to prevent notification failures from blocking deployment
  • Captures PR URLs using for direct linking
  • Requires secret to be configured

Developer checklist

  • My code follows the style guidelines of this project
  • No breaking changes are being introduced.
  • All related docs linked with the PR?
  • All changes manually tested?
  • Any documentation changes needed with this change?
  • Is the PR limited to 10 file changes?
  • Is the PR limited to one linear task?
  • Are relevant unit and component test-cases added in new readability format?

@koladilip
koladilip requested a review from sivashanmukh as a code owner August 4, 2025 07:14
@koladilip
koladilip requested a review from a team August 4, 2025 07:14
@coderabbitai

coderabbitai Bot commented Aug 4, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added automated Slack notifications after deployment pull requests are created, including direct links for quick review and merge.
    • Captured URLs of created pull requests (shared, hosted, dedicated) within the pipeline for downstream visibility.
  • Chores

    • Pinned the Slack integration to an exact version in workflows to ensure reproducible, secure runs.
    • Refined CI steps to surface deployment metadata in environment variables for subsequent jobs.
    • Configured Slack notification to continue on error to avoid blocking the pipeline.

Walkthrough

Captures URLs of three created Helm chart PRs in the deployment workflow and adds a Slack notification step to post those links; additionally pins the Slack GitHub Action to a specific commit SHA in two other workflows for reproducibility. (46 words)

Changes

Cohort / File(s) Change Summary
Helm Chart PR Creation & Notification
.github/workflows/prepare-for-prod-ut-deploy.yml
PR creation steps now run gh pr create --fill --json url --jq '.url' and store each PR URL in environment variables (SHARED_PR_URL, HOSTED_PR_URL, DEDICATED_PR_URL). Adds a "Notify Control Plane Team" step that sends a formatted Slack message with deployment version and clickable PR links; uses secret token and continues-on-error.
Slack Action Pinning
.github/workflows/publish-new-release.yml, .github/workflows/slack-notify.yml
Replaces slackapi/[email protected] with a pinned commit SHA (91efab103c0de0a537f72a35f6b8cda0ee76bf0a) to ensure deterministic action resolution; no payload or env changes.

Sequence Diagram(s)

sequenceDiagram
    participant Workflow as GitHub Actions Workflow
    participant GitHub as GitHub
    participant Slack as Slack Channel

    Workflow->>GitHub: Create PR for shared Helm chart
    Workflow->>GitHub: Create PR for hosted Helm chart
    Workflow->>GitHub: Create PR for dedicated Helm chart
    Workflow->>Workflow: Capture PR URLs as env variables
    Workflow->>Slack: Send message with PR links and deployment version
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • sivashanmukh
  • krishna2020
  • maheshkutty
  • vinayteki95

Suggestions for improvement: consider centralizing Slack notification formatting (shared reusable step or composite action) and add a short comment explaining why the action is pinned to the specific commit SHA for future maintainers.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/int-3976-add-slack-notification-for-ut-deployment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai 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.

Actionable comments posted: 0

🔭 Outside diff range comments (1)
.github/workflows/prepare-for-prod-ut-deploy.yml (1)

99-134: yq is used before being installed – job will fail on a clean runner
ubuntu-latest images do not include yq by default, so all edit commands will exit with 127. Add an explicit install step before first use.

@@
       - name: Checkout
         uses: actions/[email protected]
         with:
           fetch-depth: 1
+
+      - name: Install yq
+        run: |
+          sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
+          sudo chmod +x /usr/local/bin/yq
🧹 Nitpick comments (3)
.github/workflows/publish-new-release.yml (1)

169-169: Inline comment can drift from the pinned SHA
The code pins the action to a commit, but the inline comment still says # v2.1.1. If you later bump the action to a different commit, the comment may become misleading. Consider either removing the version note or updating it together with the SHA.

.github/workflows/prepare-for-prod-ut-deploy.yml (2)

138-140: Reuse of temporary PR_URL var is harmless but hurts log clarity
Each block re-uses the same shell variable name PR_URL. While scoped to the individual script, future refactors may inadvertently reference the wrong value. Consider distinct names (SHARED_PR, HOSTED_PR, DEDICATED_PR) to keep log output unambiguous.

Also applies to: 156-158, 193-195


211-211: YAML-lint trailing-space warning
Line 211 contains trailing spaces, flagged by YAML-lint. Trim to keep the workflow lint-clean.

-        "type": "plain_text", 
+        "type": "plain_text",
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 65868f6 and 7a25c87b0f87b5bee62b7aaf646f360031393a7b.

📒 Files selected for processing (3)
  • .github/workflows/prepare-for-prod-ut-deploy.yml (3 hunks)
  • .github/workflows/publish-new-release.yml (1 hunks)
  • .github/workflows/slack-notify.yml (1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/prepare-for-prod-ut-deploy.yml

[error] 211-211: trailing spaces

(trailing-spaces)

⏰ 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). (8)
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
.github/workflows/slack-notify.yml (1)

25-25: Pinned Slack action SHA – solid supply-chain hardening
Moving from a version tag to the exact commit SHA improves reproducibility and defends against tag-hijacking attacks. Looks good.

.github/workflows/prepare-for-prod-ut-deploy.yml (1)

218-220: Slack message shows tag_name_ut but dedicated PR uses TAG_NAME
For dedicated transformers you branch and version with ${{ env.TAG_NAME }}, yet the Slack payload advertises ${{ needs.generate-tag-names.outputs.tag_name_ut }}. If these diverge (e.g., ut-x.y.z vs x.y.z) the message will mis-lead reviewers. Please verify which tag should be surfaced.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

Comment thread .github/workflows/slack-notify.yml Resolved
@koladilip
koladilip requested review from maheshkutty and utsabc August 4, 2025 09:18
@koladilip koladilip changed the title feat: add slack notification for UT deployment PRs chore: add slack notification for UT deployment PRs Aug 13, 2025
- Add PR URL capture for shared, hosted, and dedicated transformers
- Add Slack notification step with PR links for Control Plane team
- Update all Slack actions to use specific commit hash for security
@koladilip
koladilip force-pushed the feature/int-3976-add-slack-notification-for-ut-deployment branch from 7a25c87 to 2ce9414 Compare August 13, 2025 03:20
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Aug 13, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.79%. Comparing base (7ae313f) to head (2ce9414).
⚠️ Report is 32 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4546      +/-   ##
===========================================
+ Coverage    91.63%   91.79%   +0.16%     
===========================================
  Files          643      642       -1     
  Lines        34020    33886     -134     
  Branches      8048     8017      -31     
===========================================
- Hits         31174    31107      -67     
+ Misses        2588     2549      -39     
+ Partials       258      230      -28     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🧹 Nitpick comments (1)
.github/workflows/prepare-for-prod-ut-deploy.yml (1)

196-223: Fix trailing whitespace flagged by yamllint and verify Slack mention format.

  • Lint: Remove trailing spaces (Line 211) to satisfy YAML linting.
  • Mentions: @control-plane-on-call may not notify in Slack unless formatted as a user group or user mention token. Consider using a subteam mention token.

Apply this minimal lint fix:

-                    "type": "plain_text", 
+                    "type": "plain_text",

Optionally, update the mention to a subteam token (requires a secret with the subteam ID):

-              "text": "*UT Deployment PRs Created*\nCC: @control-plane-on-call",
+              "text": "*UT Deployment PRs Created*\nCC: <!subteam^${{ secrets.SLACK_CP_ONCALL_SUBTEAM_ID }}|control-plane-on-call>",

Follow-up:

  • Confirm that @control-plane-on-call currently results in a proper mention in your Slack workspace; if not, switch to the subteam token format above.
  • If you want to guarantee notification even when the Slack action transiently fails, the current continue-on-error: true is correct. If you also want to always post when PRs are created across sub-steps, consider making this step dependent only on success of the three PR steps, or explicitly document that it won’t run if those fail.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a25c87b0f87b5bee62b7aaf646f360031393a7b and 2ce9414.

📒 Files selected for processing (3)
  • .github/workflows/prepare-for-prod-ut-deploy.yml (3 hunks)
  • .github/workflows/publish-new-release.yml (1 hunks)
  • .github/workflows/slack-notify.yml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/publish-new-release.yml
  • .github/workflows/slack-notify.yml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/prepare-for-prod-ut-deploy.yml

[error] 211-211: trailing spaces

(trailing-spaces)

⏰ 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). (8)
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Code Coverage
  • GitHub Check: test_and_publish
  • GitHub Check: UT Tests
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)

@koladilip
koladilip merged commit 39820d7 into develop Aug 13, 2025
@koladilip
koladilip deleted the feature/int-3976-add-slack-notification-for-ut-deployment branch August 13, 2025 08:18
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.

6 participants