[pull] master from getsentry:master#2013
Merged
Merged
Conversation
Replace the local timer context manager in `sentry.utils.snuba` with `metrics.timer` from `sentry.utils.metrics` so timing in this file matches the rest of the codebase. Metric names are preserved as `snuba.client.<name>`; each timing now also carries the standard `result=success|failure` tag emitted by `metrics.timer`.
Replaces the `owner=1` → 400 stub in
`OrganizationIndexEndpoint._get_from_control` with a real implementation
that queries `OrganizationMemberMapping` for the user's owner-role orgs
and computes `singleOwner` from an aggregated count of active co-owners.
Returns the same `[{organization, singleOwner}]` shape as the cell-side
path, so existing frontend callers (account close + security enrolment)
can migrate to this endpoint without major frontend changes.
Also fixes an N+1 query in the existing cell-side path. The cell version
runs `has_single_owner()` and a full feature-flag evaluation
(`features.batch_has`
+ per-feature `features.has` + onboarding/option queries) per org.
Control issues the same queries regardless of org count and skips
feature evaluation entirely since org features are no longer returned
from control.
Co-Authored-By: untitaker <837573+untitaker@users.noreply.github.com> Co-authored-by: getsentry-bot <10587625+getsentry-bot@users.noreply.github.com> Co-authored-by: untitaker <837573+untitaker@users.noreply.github.com>
Endpoint is private with zero external usage and no live frontend or backend callers — superseded by the events-trace and EAP trace endpoints. Remove the endpoint, its URL route, and its test class. --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
…low deletion (#116537) It's broken for project deletion to result in org-scoped workflow deletion, and for teams with legacy alerting models, this is a real risk. It's not too troubling if the project was the only user of the workflow, and arguably expected, but removing org-scoped data when no longer used anywhere is a choice we haven't yet made, so best to default to the safest path. The legacy Rule endpoint still will delete the Workflow associated, which is troublesome in sharing cases, but will be addressed elsewhere. This is spun off of #116532.
…ectors (#116532) For reasons valid and otherwise, it's possible to have multiple legacy models (Rule, AlertRule) mapped to the same Workflow or Detector. For read purposes, this can be convenient for preserving the old interface, but mutations in this case are confusing at best. Moreover, our deletion code had assumed no sharing, which meant that deleting a Rule can result in a workflow used by many other projects being deleted, which is almost certainly not the intended behavior. To address this, here we: 1. Remove the ability for Rules to delete Workflows. They only delete their link to them. Rules are vestigial; they should be removable without impacting Workflows. 2. Serve a 400 when a user attempts to modify a Rule/AlertRule backed by a shared Workflow or Detector, providing an error that indicates that the new API should be used. This is less convenient, as some operations may be totally fine, but allowing changing one Rule to update another Rule with a different id via shared backend is wrong. At this point they're all aliases I think (at least, for Rules) but there's no way via the legacy API to know that. Thus, we ask them to use the new API in this case. The second part in particular may prove annoying, but we can fix it by un-merging (in some cases) or they can use new APIs.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )