-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(similarity-embedding): Add endpoint to call backfill script #68751
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
Merged
Merged
Changes from 12 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
3af8c26
feat(similarity-embedding): Create backfill script for inserting records
jangjodi 5f9e6ca
fix: Fix query
jangjodi 0d5c986
Merge branch 'master' into jodi/similarity-embeddings-backfill
jangjodi 95a76e7
ref: Add seer timeout, remove script
jangjodi fb42e6b
ref: Move script back and change to use hash
jangjodi f19acd1
Merge branch 'master' into jodi/similarity-embeddings-backfill
jangjodi f33b4d3
fix: Typing and typo
jangjodi 0a2ccb8
feat(similarity-embedding): Add endpoint to call backfill script
jangjodi c70b217
fix: Typo
jangjodi b3f5bad
:hammer_and_wrench: apply pre-commit fixes
getsantry[bot] 812cf9e
ref: Rename files, add superuser check
jangjodi 2fbc24c
fix: Typo
jangjodi 799dddd
ref: Change snuba cross tenant id to cross org
jangjodi 168b5d9
fix: Remove unused import
jangjodi 18ab9af
fix: Remove line
jangjodi c1c5095
:hammer_and_wrench: apply pre-commit fixes
getsantry[bot] a2fe821
ref: Use metrics wraps and change metadata structure
jangjodi 51851f6
Merge branch 'master' into jodi/similarity-embeddings-backfill
jangjodi 81558a9
:hammer_and_wrench: apply pre-commit fixes
getsantry[bot] 00c74e3
ref: Change import
jangjodi b02f0dd
fix: Fix call
jangjodi 81efe15
:hammer_and_wrench: apply pre-commit fixes
getsantry[bot] 1579982
fix: Merge conflict
jangjodi e5234d3
ref: Add seer sleep and seer delete table feature flag
jangjodi fed1b77
ref: Make seperate async calls, remove option
jangjodi cb09dbf
Merge branch 'master' into jodi/similarity-embeddings-backfill
jangjodi 3e4ad4d
:hammer_and_wrench: apply pre-commit fixes
getsantry[bot] a158726
fix: Remove task
jangjodi 97bf841
Merge branch 'jodi/similarity-embeddings-backfill' into jodi/record-b…
jangjodi f2ed707
fix: Typo
jangjodi 49a06a0
fix: Delete renamed files
jangjodi ec25516
ref: Spawn tasks with delay linearly
jangjodi 3efc188
ref: Add time limits on task
jangjodi ec9a5aa
fix: Typing
jangjodi 01fbead
Merge branch 'master' into jodi/similarity-embeddings-backfill
jangjodi 0e5f265
:hammer_and_wrench: apply pre-commit fixes
getsantry[bot] ffa4917
fix: Merge and early return
jangjodi ad4bb8a
Merge branch 'jodi/similarity-embeddings-backfill' into jodi/record-b…
jangjodi de5a5a3
fix: Merge
jangjodi 5f62163
Merge branch 'jodi/similarity-embeddings-backfill' into jodi/record-b…
jangjodi 4e90a0b
ref: Change post request to match backfill
jangjodi 7dda2b6
Merge branch 'master' into jodi/similarity-embeddings-backfill
jangjodi 2f7885f
ref: Add new feature flag
jangjodi e2adbe0
Merge branch 'jodi/similarity-embeddings-backfill' into jodi/record-b…
jangjodi 116a4d8
Merge branch 'master' into jodi/record-backfill-script-endpoint
jangjodi 0a35cf6
fix: Feature flag
jangjodi 24eb106
fix: Merge
jangjodi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
28 changes: 28 additions & 0 deletions
28
src/sentry/api/endpoints/project_backfill_similar_issues_embeddings_records.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from rest_framework.request import Request | ||
from rest_framework.response import Response | ||
|
||
from sentry import features | ||
from sentry.api.api_owners import ApiOwner | ||
from sentry.api.api_publish_status import ApiPublishStatus | ||
from sentry.api.base import region_silo_endpoint | ||
from sentry.api.bases.project import ProjectEndpoint | ||
from sentry.auth.superuser import is_active_superuser | ||
from sentry.tasks.backfill_seer_grouping_records import backfill_seer_grouping_records | ||
|
||
region_silo_endpoint | ||
|
||
|
||
@region_silo_endpoint | ||
class ProjectBackfillSimilarIssuesEmbeddingsRecords(ProjectEndpoint): | ||
owner = ApiOwner.ISSUES | ||
publish_status = { | ||
"POST": ApiPublishStatus.PRIVATE, | ||
} | ||
|
||
def post(self, request: Request, project) -> Response: | ||
if not features.has( | ||
"projects:similarity-embeddings-grouping", project | ||
) or not is_active_superuser(request): | ||
return Response(status=404) | ||
backfill_seer_grouping_records.delay(project) | ||
return Response(status=204) |
23 changes: 23 additions & 0 deletions
23
src/sentry/api/endpoints/project_similar_issues_embeddings_records.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from rest_framework.request import Request | ||
jangjodi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
from rest_framework.response import Response | ||
jangjodi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
from sentry import features | ||
from sentry.api.api_owners import ApiOwner | ||
from sentry.api.api_publish_status import ApiPublishStatus | ||
from sentry.api.base import region_silo_endpoint | ||
from sentry.api.bases.project import ProjectEndpoint | ||
from sentry.tasks.backfill_seer_grouping_records import backfill_seer_grouping_records | ||
|
||
|
||
@region_silo_endpoint | ||
class ProjectSimilarIssuesEmbeddingsRecords(ProjectEndpoint): | ||
jangjodi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
owner = ApiOwner.ISSUES | ||
publish_status = { | ||
"POST": ApiPublishStatus.PRIVATE, | ||
} | ||
|
||
def post(self, request: Request, project) -> Response: | ||
if not features.has("projects:similarity-embeddings-grouping", project): | ||
return Response(status=404) | ||
backfill_seer_grouping_records.delay(project) | ||
jangjodi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return Response(status=204) |
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
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
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
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
Oops, something went wrong.
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.
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.
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.
I'm not sure why this keeps re-appearing - it doesn't show up in my code editor locally either