Skip to content
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(outcomes) Add methods to build outcomes queries without django #45730

Merged
merged 4 commits into from Mar 15, 2023

Conversation

markstory
Copy link
Member

The query builder for outcomes is coupled to Django's QueryDict object. Adding a simple python primitive based API will make building outcomes queries simpler as you don't need to build more intermerdiary objects.

If folks are ok with this approach, I'll convert the other outcomes queries in getsentry + sentry to use the new factory methods and then make __init__ not rely on QueryDict anymore.

The query builder for outcomes is coupled to Django's QueryDict object.
Adding a simple python primitive based API will make building outcomes
queries simpler as you don't need to build more intermerdiary objects.

If folks are ok with this approach, I'll convert the other outcomes
queries in getsentry + sentry to use the new factory methods and then
make `__init__` not rely on `QueryDict` anymore.
@markstory markstory requested a review from a team March 13, 2023 20:35
@markstory markstory requested a review from a team as a code owner March 13, 2023 20:35
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 13, 2023
Copy link
Member

@JoshFerge JoshFerge left a comment

Choose a reason for hiding this comment

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

nice. how do we prevent people from querying the outcomes table directly? wonder if we can add an approved_caller abstraction somewhere in the snuba logic.

@markstory
Copy link
Member Author

how do we prevent people from querying the outcomes table directly? wonder if we can add an approved_caller abstraction somewhere in the snuba logic.

One idea I've had for this is that top-level modules (sentry.snuba) would expose their 'public' interface via exports in __init__.py. We could then use linting to identify call sites that are accessing internals of modules.

@markstory markstory merged commit e72067b into master Mar 15, 2023
51 checks passed
@markstory markstory deleted the outcomes-query-builder branch March 15, 2023 14:56
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2023
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.

None yet

2 participants