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: send slack message on failed performance tests #1598

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

arealmaas
Copy link
Collaborator

Description

Related Issue(s)

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added (if you find this hard, leave it and we'll help out)

Documentation

  • Documentation is updated (either in docs-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)

@arealmaas arealmaas requested review from a team as code owners December 12, 2024 13:32
Copy link
Contributor

coderabbitai bot commented Dec 12, 2024

📝 Walkthrough

Walkthrough

This pull request introduces modifications to the Slack notification system related to GitHub pipeline statuses. It updates the JSON structure in pipeline-failed.json to include "Performance Tests" in the job status notifications. Additionally, it renames and adjusts dependencies in the CI/CD workflow file .github/workflows/ci-cd-yt01.yml, ensuring performance tests are reported correctly. The workflow for sending CI/CD status messages to Slack is also updated to accommodate the new performance test status, enhancing the overall clarity and detail of notifications sent to Slack.

Changes

File Path Change Summary
.github/slack-templates/pipeline-failed.json Updated JSON structure to include "Performance Tests" in job status notifications.
.github/workflows/ci-cd-yt01.yml Renamed job from run-performance to run-performance-tests, updated dependencies, and added output variable performance_tests_status.
.github/workflows/workflow-send-ci-cd-status-slack-message.yml Added input parameter performance_tests_status, updated logic to include performance test status in Slack messages.

Possibly related issues

Possibly related PRs

Suggested reviewers

  • oskogstad
  • knuhau

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 generate docstrings to generate docstrings for this PR. (Experiment)
  • @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.

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

🧹 Outside diff range and nitpick comments (1)
.github/workflows/ci-cd-yt01.yml (1)

Line range hint 143-173: LGTM! Consider adjusting test duration for more reliable results.

The performance test job implementation looks good with:

  • Appropriate dependencies on infrastructure and app deployments
  • Matrix strategy for running multiple test files
  • Disabled fail-fast for comprehensive test results

However, the test duration of 30s might be too short for reliable performance metrics.

Consider increasing the duration to at least 2-3 minutes to account for warm-up periods and get more stable metrics:

-      duration: 30s
+      duration: 180s
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b5133d7 and c0049c5.

📒 Files selected for processing (3)
  • .github/slack-templates/pipeline-failed.json (1 hunks)
  • .github/workflows/ci-cd-yt01.yml (3 hunks)
  • .github/workflows/workflow-send-ci-cd-status-slack-message.yml (3 hunks)
🔇 Additional comments (3)
.github/workflows/ci-cd-yt01.yml (1)

178-178: LGTM! Proper integration of performance tests status.

The changes correctly integrate performance test results into the notification system by:

  • Adding the job dependency
  • Passing the test status to the notification workflow

Also applies to: 187-187

.github/workflows/workflow-send-ci-cd-status-slack-message.yml (2)

25-28: LGTM! Well-defined input parameter.

The performance_tests_status input parameter is properly defined with:

  • Consistent default value
  • Clear description
  • Correct type specification

76-76: LGTM! Consistent status handling implementation.

The changes properly integrate performance test status into the emoji determination and environment variables setup.

Also applies to: 93-93

@@ -23,7 +23,7 @@
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Job Status:*\n• Infrastructure: ${{ env.INFRA_STATUS }}\n• Apps: ${{ env.APPS_STATUS }}\n• Slack Notifier: ${{ env.SLACK_NOTIFIER_STATUS }}\n• E2E Tests: ${{ env.E2E_TESTS_STATUS }}\n• Schema NPM: ${{ env.SCHEMA_NPM_STATUS }}\n• Publish: ${{ env.PUBLISH_STATUS }}"
"text": "*Job Status:*\n• Infrastructure: ${{ env.INFRA_STATUS }}\n• Apps: ${{ env.APPS_STATUS }}\n• Slack Notifier: ${{ env.SLACK_NOTIFIER_STATUS }}\n• E2E Tests: ${{ env.E2E_TESTS_STATUS }}\n• Performance Tests: ${{ env.PERFORMANCE_TESTS_STATUS }}\n• Schema NPM: ${{ env.SCHEMA_NPM_STATUS }}\n• Publish: ${{ env.PUBLISH_STATUS }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Consider splitting the status message into columns for better readability

The status message line length (123 characters) exceeds Slack's optimal line length of 100 characters, which could cause wrapping and affect readability. Consider reformatting the message into two columns to improve the layout:

*Job Status:*
• Infrastructure: ${{ env.INFRA_STATUS }}        • Schema NPM: ${{ env.SCHEMA_NPM_STATUS }}
• Apps: ${{ env.APPS_STATUS }}                   • Publish: ${{ env.PUBLISH_STATUS }}
• Slack Notifier: ${{ env.SLACK_NOTIFIER_STATUS }}
• E2E Tests: ${{ env.E2E_TESTS_STATUS }}
• Performance Tests: ${{ env.PERFORMANCE_TESTS_STATUS }}
🔗 Analysis chain

LGTM! Verify message formatting in Slack.

The Performance Tests status is properly integrated into the Job Status section. However, it would be good to verify the message formatting in Slack to ensure readability with the additional status line.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the Slack message formatting by checking the line length
# Test: Check if the message text length might cause wrapping issues in Slack

# Get the line length
echo "Line length of the status text:"
echo "*Job Status:*\n• Infrastructure: ✓\n• Apps: ✓\n• Slack Notifier: ✓\n• E2E Tests: ✓\n• Performance Tests: ✓\n• Schema NPM: ✓\n• Publish: ✓" | wc -L

# Slack's message formatting typically starts to wrap around 100 characters
echo "Note: If the line length exceeds 100 characters, consider reformatting for better readability in Slack"

Length of output: 446

@arealmaas arealmaas merged commit b4440ca into main Dec 12, 2024
25 checks passed
@arealmaas arealmaas deleted the ci/enable-slack-message-on-failing-perf branch December 12, 2024 13:53
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.

2 participants