-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
ref(hc): Move PagerDutyService into control silo #53084
Conversation
This PR has a migration; here is the generated SQL for --
-- Custom state/database change combination
-- |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #53084 +/- ##
=======================================
Coverage 79.51% 79.51%
=======================================
Files 4938 4939 +1
Lines 207934 207971 +37
Branches 35473 35478 +5
=======================================
+ Hits 165335 165372 +37
+ Misses 37566 37559 -7
- Partials 5033 5040 +7
|
This PR has a migration; here is the generated SQL for --
-- Custom state/database change combination
-- |
|
||
integration = integration_service.get_integration( | ||
organization_integration_id=service.organization_integration_id | ||
ois = integration_service.get_organization_integrations( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I find these 2-3 letter variable names harder to follow than a more verbose variable at least denoting the type
pds | ||
for oi in ois | ||
for pds in oi.config.get("pagerduty_services", []) | ||
if pds["id"] == service_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it possible to have more than one match per service_id? If so is this expected/valid behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, there should only be one -- the service_id is a global unique identifier from the PagerDutyService object. In the future, we'll likely generate these by other means when we drop the model all together.
__include_in_export__ = False | ||
|
||
organization_integration_id = HybridCloudForeignKey( | ||
"sentry.OrganizationIntegration", on_delete="CASCADE" | ||
# organization_integration_id = HybridCloudForeignKey( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover comments?
# if oi.integration | ||
# i for i in integrations if i.provider == ExternalProviders.PAGERDUTY.name | ||
# if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More leftover comments?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, I'll clean up
PR reverted: 7e86a48 |
This reverts commit 4840bb4. Co-authored-by: corps <593850+corps@users.noreply.github.com>
Notably, this migration is a net zero SQL, it only has to change the state of these columns in django.
I'll want to add the constraint on organization_integration incrementally as a separate PR for 2 reasons