Skip to content

🔧 chore: handle when incident open period model isn't written to #93836

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

Merged
merged 1 commit into from
Jun 18, 2025

Conversation

iamrajjoshi
Copy link
Member

@iamrajjoshi iamrajjoshi commented Jun 18, 2025

in the in-between state when Open Periods is getting ready, lets create a sentry exception but still send a notification

@iamrajjoshi iamrajjoshi self-assigned this Jun 18, 2025
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jun 18, 2025
Copy link

codecov bot commented Jun 18, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/sentry/integrations/metric_alerts.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #93836    +/-   ##
========================================
  Coverage   88.03%   88.03%            
========================================
  Files       10328    10338    +10     
  Lines      596106   596539   +433     
  Branches    23146    23146            
========================================
+ Hits       524761   525174   +413     
- Misses      70889    70909    +20     
  Partials      456      456            

@iamrajjoshi iamrajjoshi marked this pull request as ready for review June 18, 2025 19:55
@iamrajjoshi iamrajjoshi requested review from a team as code owners June 18, 2025 19:55
workflow_engine_params["alert"] = str(open_period_incident.incident_identifier)
workflow_engine_params["alert"] = str(open_period_incident.incident_identifier)
except IncidentGroupOpenPeriod.DoesNotExist as e:
sentry_sdk.capture_exception(e)
Copy link
Member

Choose a reason for hiding this comment

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

Just an FYI, you don't need to call capture_exception with an exception in an except block. It should auto-capture the context already.

@iamrajjoshi iamrajjoshi merged commit 5a54b57 into master Jun 18, 2025
66 checks passed
@iamrajjoshi iamrajjoshi deleted the raj/handle-incident-open-period branch June 18, 2025 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants