chore(tasks) Add taskworker-launchpad topics to Topic enum#111338
chore(tasks) Add taskworker-launchpad topics to Topic enum#111338
Conversation
Add launchpad topics to sentry's Topic enum so we can use it. Requires getsentry/getsentry#19642 Requires getsentry/sentry-kafka-schemas#477
Backend Test FailuresFailures on
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: New topics missing from KAFKA_TOPIC_TO_CLUSTER mapping
- Added taskworker-launchpad and taskworker-launchpad-dlq entries to KAFKA_TOPIC_TO_CLUSTER mapping in src/sentry/conf/server.py to prevent KeyError when get_topic_definition is called.
Or push these changes by commenting:
@cursor push 85bc5eeb0c
Preview (85bc5eeb0c)
diff --git a/src/sentry/conf/server.py b/src/sentry/conf/server.py
--- a/src/sentry/conf/server.py
+++ b/src/sentry/conf/server.py
@@ -2693,6 +2693,8 @@
"taskworker-ingest-profiling-dlq": "default",
"taskworker-internal": "default",
"taskworker-internal-dlq": "default",
+ "taskworker-launchpad": "default",
+ "taskworker-launchpad-dlq": "default",
"taskworker-limited": "default",
"taskworker-limited-dlq": "default",
"taskworker-long": "default",This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
| TASKWORKER_LAUNCHPAD = "taskworker-launchpad" | ||
| TASKWORKER_LAUNCHPAD_DLQ = "taskworker-launchpad-dlq" |
There was a problem hiding this comment.
Bug: The new Kafka topics TASKWORKER_LAUNCHPAD and TASKWORKER_LAUNCHPAD_DLQ are missing from the KAFKA_TOPIC_TO_CLUSTER mapping, which will cause CI tests to fail.
Severity: CRITICAL
Suggested Fix
Add entries for 'taskworker-launchpad' and 'taskworker-launchpad-dlq' to the KAFKA_TOPIC_TO_CLUSTER dictionary located in src/sentry/conf/server.py, mapping them to the correct Kafka cluster.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/sentry/conf/types/kafka_definition.py#L99-L100
Potential issue: The new enum values `TASKWORKER_LAUNCHPAD` and
`TASKWORKER_LAUNCHPAD_DLQ` were added to the `Topic` enum, but corresponding entries
were not added to the `KAFKA_TOPIC_TO_CLUSTER` dictionary. This discrepancy will cause
the `test_topic_definition()` test to fail, as it asserts that the length of the `Topic`
enum must equal the length of the `KAFKA_TOPIC_TO_CLUSTER` dictionary. This test failure
will block the pull request from being merged. Furthermore, any runtime call to
`get_topic_definition()` with these new topics would result in a `KeyError` because the
function performs a direct dictionary lookup without a fallback.
Did we get this right? 👍 / 👎 to inform future reviews.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| "taskworker-limited": "default", | ||
| "taskworker-limited-dlq": "default", | ||
| "taskworker-launchpad": "default", | ||
| "taskworker-launchpad-dlq": "default", |
There was a problem hiding this comment.
Alphabetical ordering broken for launchpad topic entries
Low Severity
The taskworker-launchpad and taskworker-launchpad-dlq entries are placed after taskworker-limited in the KAFKA_TOPIC_TO_CLUSTER dict, breaking the alphabetical ordering convention that the rest of the list follows. In kafka_definition.py, the corresponding enum members are correctly placed before TASKWORKER_LIMITED. The two files are now inconsistent in their ordering.
…#111338) Add launchpad topics to sentry's Topic enum so we can use it. Requires getsentry/getsentry#19642 Requires getsentry/sentry-kafka-schemas#477



Add launchpad topics to sentry's Topic enum so we can use it.
Requires getsentry/getsentry#19642
Requires getsentry/sentry-kafka-schemas#477