Skip to content

chore(tasks) Add taskworker-launchpad topics to Topic enum#111338

Merged
markstory merged 4 commits intomasterfrom
chore-taskworker-launchpad-topic
Mar 24, 2026
Merged

chore(tasks) Add taskworker-launchpad topics to Topic enum#111338
markstory merged 4 commits intomasterfrom
chore-taskworker-launchpad-topic

Conversation

@markstory
Copy link
Member

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
@markstory markstory requested a review from a team as a code owner March 23, 2026 19:55
@markstory markstory requested review from a team March 23, 2026 19:55
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 23, 2026
@github-actions
Copy link
Contributor

Backend Test Failures

Failures on f47d315 in this run:

tests/sentry/conf/test_kafka_definition.py::test_topic_definitionlog
.venv/lib/python3.13/site-packages/sentry_kafka_schemas/sentry_kafka_schemas.py:80: in get_topic
    with open(topic_path) as f:
E   FileNotFoundError: [Errno 2] No such file or directory: '/home/runner/work/sentry/sentry/.venv/lib/python3.13/site-packages/sentry_kafka_schemas/topics/taskworker-launchpad.yaml'

During handling of the above exception, another exception occurred:
tests/sentry/conf/test_kafka_definition.py:18: in test_topic_definition
    assert sentry_kafka_schemas.get_topic(topic.value) is not None
.venv/lib/python3.13/site-packages/sentry_kafka_schemas/sentry_kafka_schemas.py:83: in get_topic
    raise SchemaNotFound
E   sentry_kafka_schemas.sentry_kafka_schemas.SchemaNotFound

@markstory markstory requested a review from a team as a code owner March 24, 2026 17:33
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Create PR

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.

Comment on lines +99 to +100
TASKWORKER_LAUNCHPAD = "taskworker-launchpad"
TASKWORKER_LAUNCHPAD_DLQ = "taskworker-launchpad-dlq"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions
Copy link
Contributor

Backend Test Failures

Failures on fdc65e1 in this run:

tests/sentry/conf/test_kafka_definition.py::test_topic_definitionlog
tests/sentry/conf/test_kafka_definition.py:21: in test_topic_definition
    cluster_name = settings.KAFKA_TOPIC_TO_CLUSTER[topic.value]
E   KeyError: 'taskworker-launchpad'

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Fix in Cursor Fix in Web

@markstory markstory merged commit 3c7a4e6 into master Mar 24, 2026
108 checks passed
@markstory markstory deleted the chore-taskworker-launchpad-topic branch March 24, 2026 20:29
Asynchronite pushed a commit to Asynchronite/sentry that referenced this pull request Mar 24, 2026
…#111338)

Add launchpad topics to sentry's Topic enum so we can use it.

Requires getsentry/getsentry#19642
Requires getsentry/sentry-kafka-schemas#477
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants