fix(alerts): prevent ability to create alerts when service has never been deployed + fix API call early-return condition#2606
Conversation
…been deployed + fix API call early-return condition
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## staging #2606 +/- ##
===========================================
+ Coverage 47.45% 48.95% +1.50%
===========================================
Files 1231 409 -822
Lines 23042 9845 -13197
Branches 6849 3017 -3832
===========================================
- Hits 10934 4820 -6114
+ Misses 10045 4102 -5943
+ Partials 2063 923 -1140
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent creating alert rules for services that have never been deployed, and fixes an early-return condition in the alert-creation submit flow so services using either an Ingress or an HTTPRoute can proceed.
Changes:
- Disable “New alert” actions when
service_deployment_statusisNEVER_DEPLOYED(with a tooltip explanation). - Fix submit early-return in
AlertingCreationFlowto acceptingressName || httpRouteName. - Update
ServiceAlertingtests to mockuseDeploymentStatus.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| libs/domains/observability/feature/src/lib/service/service-alerting/service-alerting.tsx | Adds deployment-status gating + tooltip around the header “New alert” button. |
| libs/domains/observability/feature/src/lib/service/service-alerting/service-alerting.spec.tsx | Adds mocking for useDeploymentStatus in existing tests. |
| libs/domains/observability/feature/src/lib/alerting/alerting-creation-flow/alerting-creation-flow.tsx | Fixes early-return logic to allow either ingress or HTTPRoute. |
| libs/domains/observability/feature/src/lib/alerting/alert-rules-overview/alert-rules-overview.tsx | Adds deployment-status gating + tooltip around the empty-state “New alert” button. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 This PR is included in version 1.301.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Summary
PR fixing an issue where Alerts can be created even when a service has never been deployed. Also fixing a bug where the submit function ultimately calling the API endpoint to create an alert had a wrong early-return condition.
Screenshots / Recordings
Testing
yarn testoryarn test -u(if you need to regenerate snapshots)yarn formatyarn lintPR Checklist
.cursor/rules)feat(service): add new Terraform service) - required for semantic-release