Skip to content

Conversation

@everettbu
Copy link
Contributor

@everettbu everettbu commented Jul 26, 2025

Test 8

…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
Copilot AI review requested due to automatic review settings July 26, 2025 19:16
Copy link
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 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 SimpleCheckIn TypedDict definition to the shared types module
  • Extracted incident threshold logic into a dedicated incidents.py module
  • Created a new incident_occurrence.py module 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.
Copy link

Copilot AI Jul 26, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants