Skip to content

chore: add TBP failures to postgres channel #36630

Merged
abhvsn merged 3 commits intoreleasefrom
chore/workflow-alert-tbp-failure
Oct 4, 2024
Merged

chore: add TBP failures to postgres channel #36630
abhvsn merged 3 commits intoreleasefrom
chore/workflow-alert-tbp-failure

Conversation

@AnaghHegde
Copy link
Contributor

@AnaghHegde AnaghHegde commented Oct 1, 2024

Description

Notify the DB Infra team for any failures in TBP workflow for the Postgres failures. This is keep the PG stable and tackle the Cypres/JUnit failures when the changes are merged from release branch.

Automation

/ok-to-test tags="@tag.Sanity"

🔍 Cypress test results

Warning

Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/11174148513
Commit: 46166d8
Cypress dashboard.
Tags: @tag.Sanity
Spec:
It seems like no tests ran 😔. We are not able to recognize it, please check workflow here.


Fri, 04 Oct 2024 04:50:44 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features

    • Enhanced failure notification mechanism for workflow failures, now notifying two Slack channels when the workflow fails on the master and pg branches.
  • Chores

    • Updated workflow configuration to support additional notification channels for improved communication.

@AnaghHegde AnaghHegde self-assigned this Oct 1, 2024
@AnaghHegde AnaghHegde requested a review from sharat87 as a code owner October 1, 2024 08:50
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 1, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

The pull request introduces modifications to the .github/workflows/test-build-docker-image.yml file, specifically enhancing the notification system for workflow failures. Two new jobs are added to send failure alerts to distinct Slack channels when the workflow fails on the master and pg branches. This change involves constructing Slack messages and using curl commands to post them, while maintaining the overall structure of the workflow.

Changes

File Path Change Summary
.github/workflows/test-build-docker-image.yml Added jobs notify-slack-for-promotion and notify-slack-for-pg to send failure notifications to Slack channels.

Possibly related PRs

Suggested labels

Task, Move to Postgres, DB Infrastructure Pod

Suggested reviewers

  • sharat87
  • abhvsn

In the realm of code, a change so bright,
Notifications now take flight!
To Slack they send a message clear,
Alerting all when failures near.
With channels two, the word will spread,
Ensuring none are left misled! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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.

Documentation and Community

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

@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Oct 1, 2024
Copy link
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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between bb11bf5 and d106c38.

📒 Files selected for processing (1)
  • .github/workflows/test-build-docker-image.yml (1 hunks)

Comment on lines +502 to +513

# This is the ChannelId of the pro-postgres-sync channel.
body="$(jq -nc \
--arg channel C07JMLWEXDJ \
--arg text "$slack_message" \
'$ARGS.named'
)"
curl --version
curl -v https://slack.com/api/chat.postMessage \
--header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw "$body"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Class, let's examine this new addition to our workflow!

Now, pay attention to how we've expanded our communication strategy. We're not just notifying one channel anymore, but two! This is like sending a note home to both your parents and your grandparents.

Let's break it down:

  1. We're using a new channel ID for the "pro-postgres-sync" channel.
  2. We're crafting the message body just like before, very consistent!
  3. We're using curl again to send the message, just like a carrier pigeon but faster!

However, there's room for improvement:

  1. The curl --version command on line 509 seems unnecessary. It's like checking if your pencil works before writing - usually not needed!
  2. We're missing the --fail-with-body option in this new curl command. Remember, it's always good to know why something didn't work!

Let's make these small adjustments:

-          curl --version
           curl -v https://slack.com/api/chat.postMessage \
+            --fail-with-body \
             --header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \
             --header 'Content-Type: application/json; charset=utf-8' \
             --data-raw "$body"

Can anyone tell me why these changes will make our code better?

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# This is the ChannelId of the pro-postgres-sync channel.
body="$(jq -nc \
--arg channel C07JMLWEXDJ \
--arg text "$slack_message" \
'$ARGS.named'
)"
curl --version
curl -v https://slack.com/api/chat.postMessage \
--header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw "$body"
# This is the ChannelId of the pro-postgres-sync channel.
body="$(jq -nc \
--arg channel C07JMLWEXDJ \
--arg text "$slack_message" \
'$ARGS.named'
)"
curl -v https://slack.com/api/chat.postMessage \
--fail-with-body \
--header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw "$body"

@AnaghHegde AnaghHegde requested review from abhvsn and removed request for sharat87 October 3, 2024 12:39
@AnaghHegde AnaghHegde added the ok-to-test Required label for CI label Oct 3, 2024
abhvsn
abhvsn previously approved these changes Oct 4, 2024
Co-authored-by: Abhijeet <41686026+abhvsn@users.noreply.github.com>
@abhvsn abhvsn merged commit 799ccd0 into release Oct 4, 2024
@abhvsn abhvsn deleted the chore/workflow-alert-tbp-failure branch October 4, 2024 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants