Skip to content

chore: pass slack bot token to slackapi - #4577

Merged
maheshkutty merged 2 commits into
developfrom
chore.pass_token_slackapi
Aug 21, 2025
Merged

maheshkutty merged 2 commits into
developfrom
chore.pass_token_slackapi

Conversation

@maheshkutty

Copy link
Copy Markdown
Contributor

What are the changes introduced in this PR?

Correct way to pass the Slack bot token under the with field:
https://docs.slack.dev/tools/slack-github-action/sending-techniques/sending-data-slack-api-method/?utm_source=chatgpt.com

What is the related Linear task?

Resolves INT-4049

Please explain the objectives of your changes below

Put down any required details on the broader aspect of your changes. If there are any dependent changes, mandatorily mention them here

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

N/A

Any new dependencies introduced with this change?

N/A

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

N/A

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

N/A

@coderabbitai review


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?

Reviewer checklist

  • Is the type of change in the PR title appropriate as per the changes?

  • Verified that there are no credentials or confidential data exposed with the changes.

@maheshkutty
maheshkutty requested a review from a team August 20, 2025 11:20
@coderabbitai

coderabbitai Bot commented Aug 20, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores
    • Updated Slack notification steps across release and deployment workflows to use a direct token input instead of environment variables.
    • Improves reliability and security of Slack notifications without changing message content or channels.
    • Standardizes configuration for consistent behavior across workflows.

Walkthrough

Three GitHub Actions workflows now pass the Slack bot token via the Slack action’s with.token: ${{ secrets.SLACK_BOT_TOKEN }} input instead of setting env: SLACK_BOT_TOKEN. Message payloads, channels, and other step fields are unchanged. (48 words)

Changes

Cohort / File(s) Summary of Changes
CI Workflows: Slack token input switch
.github/workflows/publish-new-release.yml, .github/workflows/prepare-for-prod-ut-deploy.yml, .github/workflows/slack-notify.yml
Replaced env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} with with: token: ${{ secrets.SLACK_BOT_TOKEN }} in Slack action steps. Other step fields (method, payload, channel, continue-on-error) unchanged.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Runner as GitHub Actions Runner
    participant SlackAction as slackapi/slack-github-action
    participant Slack as Slack API

    Note over Runner,SlackAction #F3F4F6: Old flow (env-based token)
    Runner->>SlackAction: invoke step (env.SLACK_BOT_TOKEN present)
    SlackAction->>Slack: POST message (Authorization: Bearer <env token>)
    Slack-->>SlackAction: 2xx / error
    SlackAction-->>Runner: step result

    Note over Runner,SlackAction #EEF7EF: New flow (with.token input)
    Runner->>SlackAction: invoke step (with.token: ${{ secrets.SLACK_BOT_TOKEN }})
    SlackAction->>Slack: POST message (Authorization: Bearer <input token>)
    Slack-->>SlackAction: 2xx / error
    SlackAction-->>Runner: step result
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–15 minutes

Possibly related PRs

Suggested reviewers

  • sivashanmukh
  • krishna2020
  • vinayteki95

Suggestions

  • Confirm the pinned slack-github-action version supports the token input; update/pin if necessary.
  • Run these workflows on a non-production branch to verify Slack delivery and step success.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between c05847f5ac351fac65b9e60575a97bc061db3da7 and 6b27013.

📒 Files selected for processing (3)
  • .github/workflows/prepare-for-prod-ut-deploy.yml (1 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 (3)
  • .github/workflows/slack-notify.yml
  • .github/workflows/publish-new-release.yml
  • .github/workflows/prepare-for-prod-ut-deploy.yml
⏰ 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). (9)
  • 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: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore.pass_token_slackapi

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: 1

🧹 Nitpick comments (3)
.github/workflows/publish-new-release.yml (3)

167-201: Optional: Decide if Slack should notify even when earlier steps fail.

Right now, the Slack step will be skipped if a prior step fails; continue-on-error: true only prevents this step from failing the job. If you want notifications regardless of previous step outcomes, gate the step with always(), and optionally tailor the payload for success vs failure.

Example (minimal change to always run the step):

       - name: Notify Slack Channel
         id: slack
         uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a  # v2.1.1
-        continue-on-error: true
+        if: ${{ always() }}
+        continue-on-error: true

If you want different messages, add two steps with if: ${{ success() }} and if: ${{ failure() }} respectively.


178-200: Optional: Reduce duplicated message text in payload.

You repeat the same content in both text and a block section. Keeping text concise (for notifications/fallback) and using blocks for the full message reduces duplication and maintenance cost.

Example payload tweak:

-              "text": "*<${{env.RELEASES_URL}}v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\nCC: <!subteam^S02AEQL26CT> <!subteam^S03SEKBFX0D> <@U021E50QAGY>",
+              "text": "New release published: v${{ steps.extract-version.outputs.release_version }}",
               "blocks": [
                 {
                   "type": "header",
                   "text": {
                     "type": "plain_text",
                     "text": ":tada:  ${{ env.PROJECT_NAME }} - New GitHub Release  :tada:"
                   }
                 },
                 {
                   "type": "divider"
                 },
                 {
                   "type": "section",
                   "text": {
                     "type": "mrkdwn",
-                    "text": "*<${{env.RELEASES_URL}}v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\nCC: <!subteam^S02AEQL26CT> <!subteam^S03SEKBFX0D> <@U021E50QAGY>"
+                    "text": "*<${{env.RELEASES_URL}}v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\nCC: <!subteam^S02AEQL26CT> <!subteam^S03SEKBFX0D> <@U021E50QAGY>"
                   }
                 }
               ]

169-170: No newer stable slack-github-action release
The latest stable v2.x remains v2.1.1—your pinned SHA corresponds to that tag. There is a v2.0.0-rc.1 pre-release, but no newer stable release is available.

Optional improvement:

  • To automatically pick up future v2 patch releases (while avoiding major bumps), consider pinning to
    • slackapi/slack-github-action@v2
    • or @v2.1.1
    instead of a raw commit SHA.
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between bfa80ef and 86a7564e4b918fc31da01ce56f1aaa867ce491a5.

📒 Files selected for processing (1)
  • .github/workflows/publish-new-release.yml (1 hunks)
⏰ 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). (9)
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • 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: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
.github/workflows/publish-new-release.yml (1)

176-176: Token passed via with.token is correct for slackapi/slack-github-action v2.

This aligns with the action’s recommended usage and avoids relying on env for auth. Nice cleanup.

@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@codecov

codecov Bot commented Aug 20, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.81%. Comparing base (99c3e78) to head (6b27013).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4577   +/-   ##
========================================
  Coverage    91.81%   91.81%           
========================================
  Files          642      642           
  Lines        33930    33930           
  Branches      8041     8042    +1     
========================================
  Hits         31152    31152           
- Misses        2526     2548   +22     
+ Partials       252      230   -22     

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

koladilip
koladilip previously approved these changes Aug 20, 2025
manish339k
manish339k previously approved these changes Aug 20, 2025
@maheshkutty
maheshkutty dismissed stale reviews from manish339k and koladilip via c05847f August 20, 2025 12:26
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@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

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

196-203: Same token-handling concern here; verify with.token support, or keep env: SLACK_BOT_TOKEN as a temporary safety net

The change is consistent with the other workflow. If with.token is not a supported input on v2.1.1, this step will fail to authenticate and silently continue due to continue-on-error: true, resulting in missing Slack notifications.

Action items:

  • Verify that with.token is supported in v2.1.1.
  • Optionally keep env: SLACK_BOT_TOKEN until validation is complete.

Use the same verification steps as noted in the other file. Suggested safe fallback:

       - name: Notify Control Plane Team
         uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a  # v2.1.1
         continue-on-error: true
         with:
           method: chat.postMessage
           token: ${{ secrets.SLACK_BOT_TOKEN }}
           payload: |
             {
               "channel": "${{ secrets.SLACK_CONTROL_PLANE_CHANNEL_ID }}",
               "text": "*UT Deployment PRs Created*\nCC: @control-plane-on-call",
               ...
             }
+        env:
+          SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 86a7564e4b918fc31da01ce56f1aaa867ce491a5 and c05847f5ac351fac65b9e60575a97bc061db3da7.

📒 Files selected for processing (2)
  • .github/workflows/prepare-for-prod-ut-deploy.yml (1 hunks)
  • .github/workflows/slack-notify.yml (1 hunks)
⏰ 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). (9)
  • GitHub Check: Build User 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 Transformer Docker Image - PR / Build Transformer Docker Image AMD64
  • GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
  • GitHub Check: Code Coverage
  • GitHub Check: UT Tests
  • GitHub Check: test_and_publish
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
.github/workflows/slack-notify.yml (1)

24-33: Slack action supports with.token in v2.1.1; no fallback needed

The pinned SHA (slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a, v2.1.1) officially accepts a token input, so your step will authenticate correctly with:

- name: notify
  uses: slackapi/slack-github-action@91efab103c0de0a537f72a35f6b8cda0ee76bf0a
  continue-on-error: true
  with:
    method: chat.postMessage
    token: ${{ secrets.SLACK_BOT_TOKEN }}
    payload: |
      {
        "channel": "${{ secrets.SLACK_INTEGRATION_DEV_CHANNEL_ID }}",
        "text": "*<prod release tests failed>*\nCC: <!subteam^S02AEQL26CT>",
        …
      }
  env:
    PROJECT_NAME: 'Rudder Transformer'

No additional env: SLACK_BOT_TOKEN fallback is required.

@maheshkutty
maheshkutty force-pushed the chore.pass_token_slackapi branch from c05847f to 6b27013 Compare August 21, 2025 07:39
@devops-github-rudderstack

Copy link
Copy Markdown
Contributor

Allure Test reports for this run are available at:

@sonarqubecloud

Copy link
Copy Markdown

@maheshkutty
maheshkutty merged commit 5e8a85b into develop Aug 21, 2025
@maheshkutty
maheshkutty deleted the chore.pass_token_slackapi branch August 21, 2025 08:47
@coderabbitai coderabbitai Bot mentioned this pull request Oct 9, 2025
10 tasks
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.

4 participants