Skip to content

fix(alerts): prevent ability to create alerts when service has never been deployed + fix API call early-return condition#2606

Merged
RemiBonnet merged 3 commits intostagingfrom
fix/alerts/alert-creation-issue
Apr 20, 2026
Merged

fix(alerts): prevent ability to create alerts when service has never been deployed + fix API call early-return condition#2606
RemiBonnet merged 3 commits intostagingfrom
fix/alerts/alert-creation-issue

Conversation

@rmnbrd
Copy link
Copy Markdown
Contributor

@rmnbrd rmnbrd commented Apr 17, 2026

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

Screenshot 2026-04-17 at 11 57 51 Screenshot 2026-04-17 at 11 57 46

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 17, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 48.95%. Comparing base (cb488d7) to head (0fd5533).
⚠️ Report is 1 commits behind head on staging.

Files with missing lines Patch % Lines
.../alerting-creation-flow/alerting-creation-flow.tsx 0.00% 1 Missing ⚠️
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     
Flag Coverage Δ
unittests 48.95% <88.88%> (+1.50%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rmnbrd rmnbrd marked this pull request as ready for review April 17, 2026 13:18
Copilot AI review requested due to automatic review settings April 17, 2026 13:18
@rmnbrd rmnbrd self-assigned this Apr 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_status is NEVER_DEPLOYED (with a tooltip explanation).
  • Fix submit early-return in AlertingCreationFlow to accept ingressName || httpRouteName.
  • Update ServiceAlerting tests to mock useDeploymentStatus.

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.

@RemiBonnet RemiBonnet merged commit 77ec122 into staging Apr 20, 2026
11 checks passed
@RemiBonnet RemiBonnet deleted the fix/alerts/alert-creation-issue branch April 20, 2026 06:39
@RemiBonnet
Copy link
Copy Markdown
Member

🎉 This PR is included in version 1.301.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants