-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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(inbound-filters): Add inbound filter for ChunkLoadError #57277
Changes from 6 commits
fb811de
ddb91b9
862acfe
7949be9
773f2d4
df9c8b3
eeb0c9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,6 +179,7 @@ def test_project_config_uses_filter_features( | |
default_project.update_option("sentry:error_messages", error_messages) | ||
default_project.update_option("sentry:releases", releases) | ||
default_project.update_option("filters:react-hydration-errors", False) | ||
default_project.update_option("filters:chunk-load-error", False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should have a test to ensure this value produces a valid project config. If the feature is disabled, it won't be validated with the project config. If the config is invalid we will only see it in production when Relay is unable to parse the project config. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep I was going to add it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the test in a follow up commit. |
||
|
||
if has_blacklisted_ips: | ||
default_project.update_option("sentry:blacklisted_ips", blacklisted_ips) | ||
|
@@ -205,6 +206,23 @@ def test_project_config_uses_filter_features( | |
assert cfg_client_ips is None | ||
|
||
|
||
@django_db_all | ||
@region_silo_test(stable=True) | ||
def test_project_config_with_chunk_load_error_filter(default_project): | ||
default_project.update_option("filters:react-hydration-errors", False) | ||
default_project.update_option("filters:chunk-load-error", True) | ||
|
||
project_cfg = get_project_config(default_project, full_config=True) | ||
|
||
cfg = project_cfg.to_dict() | ||
_validate_project_config(cfg["config"]) | ||
cfg_error_messages = get_path(cfg, "config", "filterSettings", "errorMessages") | ||
|
||
assert cfg_error_messages == { | ||
"patterns": ["ChunkLoadError: Loading chunk * failed.\n(error: *)"] | ||
} | ||
|
||
|
||
@django_db_all | ||
@region_silo_test(stable=True) | ||
@mock.patch("sentry.relay.config.EXPOSABLE_FEATURES", ["organizations:profiling"]) | ||
|
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.
You may want to check in a unit test in relay to make sure this pattern works. See for example getsentry/relay#1903.
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 did write a unit test for it, just wasn't sure if I should make a PR with it. wydt?