ref(crons): Reorganize incident creation / issue occurrence logic#7
Open
everettbu wants to merge 1 commit into
Open
ref(crons): Reorganize incident creation / issue occurrence logic#7everettbu wants to merge 1 commit into
everettbu wants to merge 1 commit into
Conversation
…0528) Since we'll be doing more with issue occurrences split out the concept of incidents into it's own logic module, as well as incident_occurrence into it's own module Part of GH-80527
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR reorganizes incident creation and issue occurrence logic for cron monitors by extracting and modularizing code from the mark_failed.py file into separate, more focused modules.
- Moved the
SimpleCheckInTypedDict definition to the shared types module - Extracted incident threshold logic into a dedicated
incidents.pymodule - Created a new
incident_occurrence.pymodule for issue occurrence creation and related utilities
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/sentry/monitors/types.py | Added SimpleCheckIn TypedDict definition with documentation |
| src/sentry/monitors/logic/mark_failed.py | Removed extracted code and updated to use new modular functions |
| src/sentry/monitors/logic/incidents.py | New module containing incident threshold logic extracted from mark_failed.py |
| src/sentry/monitors/logic/incident_occurrence.py | New module containing issue occurrence creation and utility functions |
|
|
||
| def get_failure_reason(failed_checkins: Sequence[SimpleCheckIn]): | ||
| """ | ||
| Builds a humam readible string from a list of failed check-ins. |
There was a problem hiding this comment.
There is a typo in the docstring: 'humam' should be 'human' and 'readible' should be 'readable'.
Suggested change
| Builds a humam readible string from a list of failed check-ins. | |
| Builds a human readable string from a list of failed check-ins. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test 8