-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(issues): infer project platform if not set #95402
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 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
36b63c7
add helper to set project platform
lobsterkatie 88faf1b
infer project platform if not set
cvxluo 6fb23e5
stop inferring project if changed manually
cvxluo afc8907
fix tests
cvxluo c559e38
handle 'other' events
cvxluo 2d2ec4d
clean up typos + tests
cvxluo c7c5a2a
Merge branch 'master' into cvxluo/infer-project-platform
cvxluo 05c536d
add lock + atomic transaction
cvxluo 597b3c4
stop inferring to 'other' + options gating + filter out sample events
cvxluo 9bfc4ba
clean up option key
cvxluo 29f6f79
wrap refresh in transaction
cvxluo 1a95c89
adjust cache key
cvxluo 1e25c0a
use queryset update instead of transaction
cvxluo b0e8ec8
use VALID_PLATFORMS instead of ad-hoc event platform filtering
cvxluo 26c7fe3
save changes
cvxluo 7bde68e
better filtering
cvxluo 054c0b2
fix query
cvxluo 89d40a7
fix comment
cvxluo 553895b
remove extra lock + cache
cvxluo 6f7ee89
try except
cvxluo 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from sentry.testutils.cases import TestCase | ||
from sentry.testutils.helpers import override_options | ||
from sentry.testutils.helpers.eventprocessing import save_new_event | ||
|
||
|
||
class ProjectPlatformInferTest(TestCase): | ||
@override_options({"sentry:infer_project_platform": 1.0}) | ||
def test_platform_inferred_on_event(self): | ||
project = self.create_project() | ||
|
||
save_new_event({"message": "test", "platform": "javascript"}, project) | ||
|
||
project.refresh_from_db() | ||
assert project.platform == "javascript" | ||
|
||
@override_options({"sentry:infer_project_platform": 1.0}) | ||
def test_platform_does_not_override_existing_platform(self): | ||
project = self.create_project(platform="python") | ||
|
||
save_new_event({"message": "test", "platform": "javascript"}, project) | ||
|
||
project.refresh_from_db() | ||
assert project.platform == "python" |
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.
Nit: Could combine this into the same
if