From 6503900bf9cd24773c91d625c1b561702d61aa5c Mon Sep 17 00:00:00 2001 From: Andrew Liu <159852527+aliu3ntry@users.noreply.github.com> Date: Fri, 26 Apr 2024 10:48:14 -0700 Subject: [PATCH] ref(feedback): update integration test and doc for #3403 (#3486) Follow-up from https://github.com/getsentry/relay/pull/3403. #skip-changelog (doc and renaming) --- relay-dynamic-config/src/global.rs | 9 ++-- tests/.idea/workspace.xml | 69 ------------------------------ tests/integration/test_feedback.py | 17 +++----- 3 files changed, 12 insertions(+), 83 deletions(-) delete mode 100644 tests/.idea/workspace.xml diff --git a/relay-dynamic-config/src/global.rs b/relay-dynamic-config/src/global.rs index c1fc054e22..9ad4860c77 100644 --- a/relay-dynamic-config/src/global.rs +++ b/relay-dynamic-config/src/global.rs @@ -167,11 +167,12 @@ pub struct Options { )] pub feedback_ingest_topic_rollout_rate: f32, - /// Flag for handling feedback and attachments in the same envelope. Temporary FF for fast-revert - /// (will remove after user feedback GA release). + /// Flag for handling feedback and attachments in the same envelope. This is for the SDK team to send less requests + /// for the user feedback screenshots feature. Prior to this change, feedback sent w/attachments would be produced + /// to the attachments topic, rather than its own topic. The items are now split up accordingly. /// - /// Enabling this will also separate the logic for producing feedback, to its own match case in - /// StoreService::store_envelope + /// This option is used as a temporary FF/kill-switch to toggle back to the old code path in relay's StoreService. + /// This is for testing convenience and will be removed after user feedback's GA release. #[serde( rename = "feedback.ingest-inline-attachments", deserialize_with = "default_on_error", diff --git a/tests/.idea/workspace.xml b/tests/.idea/workspace.xml deleted file mode 100644 index 3b77dea1ba..0000000000 --- a/tests/.idea/workspace.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1713824101510 - - - - - - \ No newline at end of file diff --git a/tests/integration/test_feedback.py b/tests/integration/test_feedback.py index 5e17b6715c..a3a8df6791 100644 --- a/tests/integration/test_feedback.py +++ b/tests/integration/test_feedback.py @@ -169,21 +169,18 @@ def test_feedback_with_attachment_in_same_envelope( mini_sentry.add_basic_project_config( 42, extra={"config": {"features": ["organizations:user-feedback-ingest"]}} ) - mini_sentry.set_global_config_option( - "feedback.ingest-topic.rollout-rate", 1.0 if use_feedback_topic else 0.0 - ) # Test will only pass with this option set mini_sentry.set_global_config_option("feedback.ingest-inline-attachments", True) if use_feedback_topic: mini_sentry.set_global_config_option("feedback.ingest-topic.rollout-rate", 1.0) - feedback_consumer_ = feedback_consumer(timeout=20) other_consumer = events_consumer(timeout=20) + feedback_consumer = feedback_consumer(timeout=20) else: mini_sentry.set_global_config_option("feedback.ingest-topic.rollout-rate", 0.0) - feedback_consumer_ = events_consumer(timeout=20) other_consumer = feedback_consumer(timeout=20) - attachments_consumer_ = attachments_consumer(timeout=20) + feedback_consumer = events_consumer(timeout=20) + attachments_consumer = attachments_consumer(timeout=20) feedback = generate_feedback_sdk_event() event_id = feedback["event_id"] @@ -213,14 +210,14 @@ def test_feedback_with_attachment_in_same_envelope( # attachment data (relaxed version of test_attachments.py) received_contents = {} # attachment id -> bytes while set(received_contents.values()) != {attachment_contents}: - chunk, v = attachments_consumer_.get_attachment_chunk() + chunk, v = attachments_consumer.get_attachment_chunk() received_contents[v["id"]] = received_contents.get(v["id"], b"") + chunk assert v["event_id"] == event_id assert v["project_id"] == project_id assert len(received_contents) == 1 # attachment headers - attachment_event = attachments_consumer_.get_individual_attachment() + attachment_event = attachments_consumer.get_individual_attachment() assert attachment_event["event_id"] == event_id assert attachment_event["project_id"] == project_id attachment = attachment_event["attachment"] @@ -229,7 +226,7 @@ def test_feedback_with_attachment_in_same_envelope( assert attachment["size"] == attachment_headers["length"] # feedback event sent to correct topic - event, message = feedback_consumer_.get_event() + event, message = feedback_consumer.get_event() assert event["type"] == "feedback" parsed_feedback = json.loads(message["payload"]) @@ -240,4 +237,4 @@ def test_feedback_with_attachment_in_same_envelope( other_consumer.assert_empty() # test message wasn't sent to attachments topic - attachments_consumer_.assert_empty() + attachments_consumer.assert_empty()