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

feat(grouping): Upgrade projects to the latest grouping configuration #51040

Merged
merged 5 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/sentry/conf/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -3134,6 +3134,7 @@ class TopicDefinition(TypedDict):
}

# If this is turned on, then sentry will perform automatic grouping updates.
# This is enabled in production
SENTRY_GROUPING_AUTO_UPDATE_ENABLED = False

# How long is the migration phase for grouping updates?
Expand Down
6 changes: 4 additions & 2 deletions src/sentry/projectoptions/defaults.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from sentry.projectoptions import register

# latest epoch
# This controls what sentry:option-epoch value is given to a project when it is created
# The epoch of a project will determine what options are valid options for that specific project
LATEST_EPOCH = 11

# grouping related configs
Expand All @@ -13,10 +14,11 @@
# TODO: we might instead want to fall back to the latest of the project's
# epoch instead.
LEGACY_GROUPING_CONFIG = "legacy:2019-03-12"
DEFAULT_GROUPING_CONFIG = "newstyle:2019-10-29"
DEFAULT_GROUPING_CONFIG = "newstyle:2023-01-11"
# NOTE: this is empty for now to migrate projects off the deprecated
# `mobile` strategy via grouping auto-updates.
BETA_GROUPING_CONFIG = ""
# This registers the option as a valid project option
register(
key="sentry:grouping_config",
epoch_defaults={
Expand Down
2 changes: 1 addition & 1 deletion tests/sentry/api/endpoints/test_grouping_levels.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def test_error_not_hierarchical(client, default_project, reset_snuba, factories)
def test_error_project_not_hierarchical(client, default_organization, reset_snuba, factories):

project = Project.objects.create(organization=default_organization, slug="test-project")
project.update_option("sentry:grouping_config", "newstyle:2019-10-29")
project.update_option("sentry:grouping_config", "newstyle:2023-01-11")

group = Group.objects.create(project=project)
grouphash = GroupHash.objects.create(
Expand Down
4 changes: 2 additions & 2 deletions tests/sentry/api/endpoints/test_project_grouping_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def setUp(self):
def test_feature_flag_off(self):
response = self.get_success_response(self.project.organization.slug, self.project.slug)
for config in response.data:
assert config["latest"] == (config["id"] == "newstyle:2019-10-29")
assert config["latest"] == (config["id"] == "newstyle:2023-01-11")

@with_feature({"organizations:grouping-tree-ui": True})
@mock.patch("sentry.grouping.strategies.base.projectoptions.LATEST_EPOCH", 7)
def test_feature_flag_on(self):
response = self.get_success_response(self.project.organization.slug, self.project.slug)
for config in response.data:
assert config["latest"] == (config["id"] == "newstyle:2019-10-29")
assert config["latest"] == (config["id"] == "newstyle:2023-01-11")
2 changes: 1 addition & 1 deletion tests/sentry/event_manager/test_event_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def test_applies_secondary_grouping(self):
manager.normalize()
event = manager.save(project.id)

project.update_option("sentry:grouping_config", "newstyle:2019-10-29")
project.update_option("sentry:grouping_config", "newstyle:2023-01-11")
project.update_option("sentry:secondary_grouping_config", "legacy:2019-03-12")
project.update_option("sentry:secondary_grouping_expiry", time() + (24 * 90 * 3600))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
created: '2020-08-21T21:07:53.458907Z'
creator: sentry
source: tests/sentry/grouping/similarity/test_features.py
---
similarity:2020-07-23:fingerprint:ident-shingle: "symcache-error"
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","lib.rs"],["function","__rust_maybe_catch_panic"]],[["filename","rt.rs"],["function","std::rt::lang_start_internal::{{closure}}"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","panicking.rs"],["function","std::panicking::try"]],[["filename","lib.rs"],["function","__rust_maybe_catch_panic"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","rt.rs"],["function","std::rt::lang_start_internal::{{closure}}"]],[["function","std::rt::lang_start::{{closure}}"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","rt.rs"],["function","std::rt::lang_start_internal::{{closure}}"]],[["function","symbolicator::main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","__libc_start_main"]],[["function","main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","_start"]],[["function","__libc_start_main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","actix::contextimpl::ContextFut<T>::poll"]],[["function","futures::future::then::Then<T>::poll"]]]
Expand All @@ -25,7 +23,6 @@ similarity:2020-07-23:stacktrace:frames-pairs: [[["function","futures::task_impl
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","futures::task_impl::std::set"]],[["function","actix::contextimpl::ContextFut<T>::poll"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","main"]],[["filename","panicking.rs"],["function","std::panicking::try"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","main"]],[["function","symbolicator::main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","std::rt::lang_start::{{closure}}"]],[["function","symbolicator::main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","std::thread::local::LocalKey<T>::with"]],[["function","tokio_current_thread::Entered<T>::block_on"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","symbolic_symcache::cache::SymCache::parse"]],[["function","symbolic_symcache::format::Header::parse"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","symbolic_symcache::format::Header::parse"]],[["function","failure::error::error_impl::ErrorImpl::from"]]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
---
created: '2020-08-21T21:07:53.192427Z'
creator: sentry
source: tests/sentry/grouping/similarity/test_features.py
---
similarity:2020-07-23:fingerprint:ident-shingle: "symcache-error"
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","lib.rs"],["function","__rust_maybe_catch_panic"]],[["filename","rt.rs"],["function","std::rt::lang_start_internal::{{closure}}"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","panicking.rs"],["function","std::panicking::try"]],[["filename","lib.rs"],["function","__rust_maybe_catch_panic"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","rt.rs"],["function","std::rt::lang_start_internal::{{closure}}"]],[["function","std::rt::lang_start::{{closure}}"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","rt.rs"],["function","std::rt::lang_start_internal::{{closure}}"]],[["function","symbolicator::main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","__libc_start_main"]],[["function","main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","_start"]],[["function","__libc_start_main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","actix::contextimpl::ContextFut<T>::poll"]],[["function","futures::future::then::Then<T>::poll"]]]
Expand All @@ -25,7 +23,6 @@ similarity:2020-07-23:stacktrace:frames-pairs: [[["function","futures::task_impl
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","futures::task_impl::std::set"]],[["function","actix::contextimpl::ContextFut<T>::poll"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","main"]],[["filename","panicking.rs"],["function","std::panicking::try"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","main"]],[["function","symbolicator::main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","std::rt::lang_start::{{closure}}"]],[["function","symbolicator::main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","std::thread::local::LocalKey<T>::with"]],[["function","tokio_current_thread::Entered<T>::block_on"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","symbolic_symcache::cache::SymCache::parse"]],[["function","symbolic_symcache::format::Header::parse"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","symbolic_symcache::format::Header::parse"]],[["function","failure::error::error_impl::ErrorImpl::from"]]]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
created: '2020-08-21T21:07:53.321111Z'
creator: sentry
source: tests/sentry/grouping/similarity/test_features.py
---
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","lib.rs"],["function","__rust_maybe_catch_panic"]],[["filename","rt.rs"],["function","std::rt::lang_start_internal::{{closure}}"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","panicking.rs"],["function","std::panicking::try"]],[["filename","lib.rs"],["function","__rust_maybe_catch_panic"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","rt.rs"],["function","std::rt::lang_start_internal::{{closure}}"]],[["function","std::rt::lang_start::{{closure}}"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["filename","rt.rs"],["function","std::rt::lang_start_internal::{{closure}}"]],[["function","symbolicator::main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","__libc_start_main"]],[["function","main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","_start"]],[["function","__libc_start_main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","actix::contextimpl::ContextFut<T>::poll"]],[["function","futures::future::then::Then<T>::poll"]]]
Expand All @@ -24,7 +22,6 @@ similarity:2020-07-23:stacktrace:frames-pairs: [[["function","futures::task_impl
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","futures::task_impl::std::set"]],[["function","actix::contextimpl::ContextFut<T>::poll"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","main"]],[["filename","panicking.rs"],["function","std::panicking::try"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","main"]],[["function","symbolicator::main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","std::rt::lang_start::{{closure}}"]],[["function","symbolicator::main"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","std::thread::local::LocalKey<T>::with"]],[["function","tokio_current_thread::Entered<T>::block_on"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","symbolic_symcache::cache::SymCache::parse"]],[["function","symbolic_symcache::format::Header::parse"]]]
similarity:2020-07-23:stacktrace:frames-pairs: [[["function","symbolic_symcache::format::Header::parse"]],[["function","failure::error::error_impl::ErrorImpl::from"]]]
Expand Down
Loading