Skip to content

Conversation

@malwilley
Copy link
Member

Similar to #92574, but for uptime monitors

@malwilley malwilley requested a review from evanpurkhiser May 30, 2025 19:49
@malwilley malwilley requested review from a team as code owners May 30, 2025 19:49
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label May 30, 2025
@codecov
Copy link

codecov bot commented May 30, 2025

Codecov Report

Attention: Patch coverage is 94.44444% with 3 lines in your changes missing coverage. Please review.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...endpoints/organization_uptime_alert_index_count.py 92.85% 2 Missing ⚠️
...tors/endpoints/organization_monitor_index_count.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master   #92583    +/-   ##
========================================
  Coverage   87.89%   87.89%            
========================================
  Files       10239    10241     +2     
  Lines      587082   587222   +140     
  Branches    22806    22806            
========================================
+ Hits       515998   516129   +131     
- Misses      70658    70667     +9     
  Partials      426      426            

Comment on lines 41 to 48
queryset = ProjectUptimeSubscription.objects.filter(
project__organization_id=organization.id, project_id__in=filter_params["project_id"]
).exclude(
status__in=[
ObjectStatus.PENDING_DELETION,
ObjectStatus.DELETION_IN_PROGRESS,
]
)
Copy link
Member

Choose a reason for hiding this comment

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

Could you actually have this pull from the Detector model instead? Here's where we create those from project subs

detector = Detector.objects.create(
type=GROUP_TYPE_UPTIME_DOMAIN_CHECK_FAILURE,
project=project_sub.project,
name=project_sub.name,
owner_user_id=project_sub.owner_user_id,
owner_team_id=project_sub.owner_team_id,
config={
"environment": env,
"mode": project_sub.mode,
},
workflow_condition_group=condition_group,
)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup! Changed to check that instead

@malwilley malwilley merged commit 7aa63ab into master Jun 2, 2025
61 checks passed
@malwilley malwilley deleted the malwilley/feat/uptime-monitor-count-endpoint branch June 2, 2025 16:18
@github-actions github-actions bot locked and limited conversation to collaborators Jun 18, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants