Skip to content

Commit 6503900

Browse files
authored
ref(feedback): update integration test and doc for #3403 (#3486)
Follow-up from #3403. #skip-changelog (doc and renaming)
1 parent eb2356b commit 6503900

File tree

3 files changed

+12
-83
lines changed

3 files changed

+12
-83
lines changed

relay-dynamic-config/src/global.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,12 @@ pub struct Options {
167167
)]
168168
pub feedback_ingest_topic_rollout_rate: f32,
169169

170-
/// Flag for handling feedback and attachments in the same envelope. Temporary FF for fast-revert
171-
/// (will remove after user feedback GA release).
170+
/// Flag for handling feedback and attachments in the same envelope. This is for the SDK team to send less requests
171+
/// for the user feedback screenshots feature. Prior to this change, feedback sent w/attachments would be produced
172+
/// to the attachments topic, rather than its own topic. The items are now split up accordingly.
172173
///
173-
/// Enabling this will also separate the logic for producing feedback, to its own match case in
174-
/// StoreService::store_envelope
174+
/// This option is used as a temporary FF/kill-switch to toggle back to the old code path in relay's StoreService.
175+
/// This is for testing convenience and will be removed after user feedback's GA release.
175176
#[serde(
176177
rename = "feedback.ingest-inline-attachments",
177178
deserialize_with = "default_on_error",

tests/.idea/workspace.xml

-69
This file was deleted.

tests/integration/test_feedback.py

+7-10
Original file line numberDiff line numberDiff line change
@@ -169,21 +169,18 @@ def test_feedback_with_attachment_in_same_envelope(
169169
mini_sentry.add_basic_project_config(
170170
42, extra={"config": {"features": ["organizations:user-feedback-ingest"]}}
171171
)
172-
mini_sentry.set_global_config_option(
173-
"feedback.ingest-topic.rollout-rate", 1.0 if use_feedback_topic else 0.0
174-
)
175172
# Test will only pass with this option set
176173
mini_sentry.set_global_config_option("feedback.ingest-inline-attachments", True)
177174

178175
if use_feedback_topic:
179176
mini_sentry.set_global_config_option("feedback.ingest-topic.rollout-rate", 1.0)
180-
feedback_consumer_ = feedback_consumer(timeout=20)
181177
other_consumer = events_consumer(timeout=20)
178+
feedback_consumer = feedback_consumer(timeout=20)
182179
else:
183180
mini_sentry.set_global_config_option("feedback.ingest-topic.rollout-rate", 0.0)
184-
feedback_consumer_ = events_consumer(timeout=20)
185181
other_consumer = feedback_consumer(timeout=20)
186-
attachments_consumer_ = attachments_consumer(timeout=20)
182+
feedback_consumer = events_consumer(timeout=20)
183+
attachments_consumer = attachments_consumer(timeout=20)
187184

188185
feedback = generate_feedback_sdk_event()
189186
event_id = feedback["event_id"]
@@ -213,14 +210,14 @@ def test_feedback_with_attachment_in_same_envelope(
213210
# attachment data (relaxed version of test_attachments.py)
214211
received_contents = {} # attachment id -> bytes
215212
while set(received_contents.values()) != {attachment_contents}:
216-
chunk, v = attachments_consumer_.get_attachment_chunk()
213+
chunk, v = attachments_consumer.get_attachment_chunk()
217214
received_contents[v["id"]] = received_contents.get(v["id"], b"") + chunk
218215
assert v["event_id"] == event_id
219216
assert v["project_id"] == project_id
220217
assert len(received_contents) == 1
221218

222219
# attachment headers
223-
attachment_event = attachments_consumer_.get_individual_attachment()
220+
attachment_event = attachments_consumer.get_individual_attachment()
224221
assert attachment_event["event_id"] == event_id
225222
assert attachment_event["project_id"] == project_id
226223
attachment = attachment_event["attachment"]
@@ -229,7 +226,7 @@ def test_feedback_with_attachment_in_same_envelope(
229226
assert attachment["size"] == attachment_headers["length"]
230227

231228
# feedback event sent to correct topic
232-
event, message = feedback_consumer_.get_event()
229+
event, message = feedback_consumer.get_event()
233230
assert event["type"] == "feedback"
234231

235232
parsed_feedback = json.loads(message["payload"])
@@ -240,4 +237,4 @@ def test_feedback_with_attachment_in_same_envelope(
240237
other_consumer.assert_empty()
241238

242239
# test message wasn't sent to attachments topic
243-
attachments_consumer_.assert_empty()
240+
attachments_consumer.assert_empty()

0 commit comments

Comments
 (0)