CDCgov / trusted-intermediary

Bringing together healthcare providers by reducing the connection burden.
Apache License 2.0
11 stars 5 forks source link

Add workflow step to notify on Automated Test failure #1585

Closed basiliskus closed 1 week ago

basiliskus commented 1 week ago

Description

So the eng. team is notified when the Automated Staging Test - Run integration tests action fails, we're adding a Slack incoming webhook that will send a notification to the cdcti-alerts-nonprod slack channel on test failure. I've tested it and it's working

Issue

1528

github-actions[bot] commented 1 week ago

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

**🎫 Ticket compliance analysis 🔶** **[1528](https://github.com/CDCgov/trusted-intermediary/issues/1528) - Partially compliant** Fully compliant requirements: - Look into adding a Slack Webhook to use in the workflow and notify the `cdcti-alerts-nonprod` slack channel Not compliant requirements: - Look into adding people to notify using `CODEOWNERS` file - Look into sending an email on test failure in the workflow
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missing Configuration
The Slack notification step lacks configuration for the message format and content.
github-actions[bot] commented 1 week ago

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Score
Enhancement
Add a detailed payload to the Slack notification to provide useful debugging information ___ **Ensure that the payload for the Slack notification includes meaningful information
about the test failure to help in debugging. Currently, the payload is not
specified, which might result in sending a generic or empty message.** [.github/workflows/automated-staging-test-run.yml [24-26]](https://github.com/CDCgov/trusted-intermediary/pull/1585/files#diff-a9c411385798f4163583c59bcef48d854efff93f3104514d6965eab187fc4f72R24-R26) ```diff uses: slackapi/slack-github-action@v1.27.0 with: payload-delimiter: "_" + payload: '{"text": "Automated test failed: ${{ github.workflow }} at ${{ github.run_id }}"}' ```
Suggestion importance[1-10]: 8 Why: Adding a detailed payload to the Slack notification is crucial for debugging. The suggestion correctly identifies a missing part in the PR and provides a meaningful improvement by specifying what should be included in the payload.
8
sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud