-
-
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 5 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 |
---|---|---|
|
@@ -600,6 +600,7 @@ def test_options(self): | |
"sentry:verify_ssl": False, | ||
"feedback:branding": False, | ||
"filters:react-hydration-errors": True, | ||
"filters:chunk-load-error": True, | ||
} | ||
with self.feature("projects:custom-inbound-filters"), outbox_runner(): | ||
self.get_success_response(self.org_slug, self.proj_slug, options=options) | ||
|
@@ -716,6 +717,12 @@ def test_options(self): | |
event=audit_log.get_event_id("PROJECT_EDIT"), | ||
).exists() | ||
assert project.get_option("filters:react-hydration-errors", "1") | ||
with assume_test_silo_mode(SiloMode.CONTROL): | ||
assert AuditLogEntry.objects.filter( | ||
organization_id=project.organization_id, | ||
event=audit_log.get_event_id("PROJECT_EDIT"), | ||
).exists() | ||
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. Q: what does this piece do? It seems duplicated for each option. 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. I admit that I have replicated the test without thinking much about it but I have now removed it since semantically it does not make sense, since no mutation of the project options is happening between the checks. |
||
assert project.get_option("filters:chunk-load-error", "1") | ||
|
||
def test_bookmarks(self): | ||
self.get_success_response(self.org_slug, self.proj_slug, isBookmarked="false") | ||
|
@@ -855,6 +862,13 @@ def test_react_hydration_errors(self): | |
assert self.project.get_option("filters:react-hydration-errors") == value | ||
assert resp.data["options"]["filters:react-hydration-errors"] == value | ||
|
||
def test_chunk_load_error(self): | ||
value = False | ||
options = {"filters:chunk-load-error": value} | ||
resp = self.get_success_response(self.org_slug, self.proj_slug, options=options) | ||
assert self.project.get_option("filters:chunk-load-error") == value | ||
assert resp.data["options"]["filters:chunk-load-error"] == value | ||
|
||
def test_relay_pii_config(self): | ||
value = '{"applications": {"freeform": []}}' | ||
resp = self.get_success_response(self.org_slug, self.proj_slug, relayPiiConfig=value) | ||
|
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) | ||
|
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?