Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix slack matrix notifications #2496

Merged
merged 1 commit into from
Jul 17, 2024
Merged

ci: fix slack matrix notifications #2496

merged 1 commit into from
Jul 17, 2024

Conversation

gartnera
Copy link
Member

@gartnera gartnera commented Jul 17, 2024

Description

The slack e2e failure webhooks haven't been working quite right since #2422. Move the alert step from the reusable workflow to the top level e2e workflow and manually format and send the message. Now we'll only see one message per matrix run and the URL will actually work.

How Has This Been Tested?

See this slack channel for example

Summary by CodeRabbit

  • Chores
    • Added a step in the GitHub Actions workflow to send Slack notifications with E2E test results.
    • Removed redundant Slack notification step from the reusable E2E workflow.

Copy link
Contributor

coderabbitai bot commented Jul 17, 2024

Walkthrough

The GitHub Actions workflows have been updated to improve Slack notifications. A new step was added to the E2E workflow to send detailed Slack messages with test results, while the reusable E2E workflow had its Slack notification step removed. These changes streamline how test run statuses are communicated.

Changes

Files Summary of Changes
.github/workflows/e2e.yml Added a step to send Slack messages with E2E test results, including job statuses and overall status.
.github/workflows/reusable-e2e.yml Removed the conditional "Notify Slack on Failure" step that used an external action for Slack notifications.

Sequence Diagram(s)

sequenceDiagram
    participant GitHubActions
    participant E2EWorkflow
    participant SlackWebhook
    
    GitHubActions->>E2EWorkflow: Run E2E tests
    E2EWorkflow->>E2EWorkflow: Process test results
    E2EWorkflow->>SlackWebhook: Send Slack message with test results
    SlackWebhook->>E2EWorkflow: Acknowledge message
Loading

Poem

In the realm of code, a change takes flight,
Messages to Slack, from tests in the night.
No failure whispers, just results so clear,
Streamlined and simple, bringing cheer.
With every commit, a new dawn's sight. 🌟


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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 ci Changes to CI pipeline or github actions label Jul 17, 2024
@gartnera gartnera added the no-changelog Skip changelog CI check label Jul 17, 2024
@gartnera gartnera force-pushed the fix-slack-matrix branch 6 times, most recently from ef200ab to c80aff0 Compare July 17, 2024 18:03
@gartnera gartnera marked this pull request as ready for review July 17, 2024 18:08
@gartnera gartnera requested a review from a team as a code owner July 17, 2024 18:08
Copy link
Contributor

@morde08 morde08 left a comment

Choose a reason for hiding this comment

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

LGTM

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

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8e1cfa7 and 08117b6.

Files selected for processing (2)
  • .github/workflows/e2e.yml (1 hunks)
  • .github/workflows/reusable-e2e.yml (1 hunks)
Additional comments not posted (8)
.github/workflows/reusable-e2e.yml (4)

Line range hint 1-50: Workflow Review: General Configuration

The general configuration of the workflow, including triggers and job settings, appears to be correctly defined. The removal of the Slack notification step does not seem to affect these configurations.


Line range hint 51-100: Workflow Review: Docker and Cache Configurations

The steps for Docker login, cache restoration, and cache injection are well-defined. These steps are crucial for optimizing build times and ensuring that the environment is correctly set up for the tests.


Line range hint 101-150: Workflow Review: Test Execution and Logging

The steps for building the Docker image, starting the test, and handling logs are appropriately configured. The use of docker logs -f for log watching and the conditional steps for log dumping and uploading on failure are good practices.


Line range hint 151-200: Workflow Review: Cleanup Operations

The steps for stopping the network and cleaning up the workspace are essential for maintaining a clean test environment. These steps are executed regardless of the job's success or failure, which is a good practice.

.github/workflows/e2e.yml (4)

Line range hint 1-50: Workflow Review: General Configuration and Triggers

The configuration for triggers such as push, pull_request, and schedule is correctly set up. The use of workflow_dispatch with multiple test options provides flexibility for manual triggers.


Line range hint 51-100: Workflow Review: Job Matrix and Conditionals

The use of a job matrix based on test labels and conditions is a robust way to handle different test scenarios. The script for setting outputs based on the context and event type is well-implemented.


Line range hint 101-150: Workflow Review: E2E Job Configuration

The configuration for the E2E jobs using a reusable workflow is correctly set up. The matrix strategy and the conditional inclusion of jobs based on the outputs from the matrix-conditionals step are well thought out.


Line range hint 151-209: Workflow Review: Slack Notification Step

The new Slack notification step is complex and involves fetching job details, processing them, and sending a formatted message to Slack. The conditions for sending the message (on schedule or failed push events) are appropriate. However, the script should be reviewed to ensure that the message formatting and the logic for determining the overall result are correct.

@gartnera gartnera enabled auto-merge July 17, 2024 18:33
@gartnera gartnera added this pull request to the merge queue Jul 17, 2024
Merged via the queue into develop with commit a0868bd Jul 17, 2024
29 checks passed
@gartnera gartnera deleted the fix-slack-matrix branch July 17, 2024 20:25
morde08 pushed a commit that referenced this pull request Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Changes to CI pipeline or github actions no-changelog Skip changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants