feat: add create-kafka-topic skill#157
Conversation
Adds a skill that provisions a new Kafka topic across the four repos that must agree for a Sentry topic to exist: sentry-kafka-schemas (schema + CODEOWNERS), ops (partitions, per-region overrides, all_topics), sentry (Topic enum + cluster mapping), and getsentry (cellsilo cluster mapping). Opens one PR per repo and reports the four PR links with their merge-order dependencies. Reconciled against the taskworker-ingest-push topic PRs (sentry-kafka-schemas#484, ops#20917, sentry#117135, getsentry#20495). CI handles ops materialized config, so the skill only edits source-of-truth files. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Testing the skill surfaced two issues: - getsentry no longer needs a per-topic change. It loads KAFKA_TOPIC_TO_CLUSTER at runtime from the topicctl-generated YAML mounted by ops (getsentry#20512, #20661), so the cellsilo.py edit is obsolete. The skill is now 3 repos, not 4. - Make the "which regions to enable" prompt an explicit blocking gate so it is never inferred from a reference topic. Updates SKILL.md, SPEC.md, and the README description accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The team used for the sentry-kafka-schemas CODEOWNERS entry is now also added as a reviewer (--reviewer) on all three PRs. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
New ops regional override files must have a counterpart in the cookiecutter-region template (disabled: true) so newly-created regions get the topic too; Warden's cookiecutter-region-backport check flags the omission. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Instead of deferring the sentry-kafka-schemas pin bump, the ops and sentry PRs now bump to the anticipated next version (latest released patch + 1) so the required change is visible in the diff. The PR body flags the version as anticipated, and for sentry notes that uv.lock's resolved entry must be regenerated with `uv lock` once the release publishes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Enabled regions outside the sibling-derived candidate set are now always given an override file (file set = candidate ∪ user-enabled regions). - Use the full shared_config/kafka/topics/regional_overrides/... path for per-region override files so they're staged by git add. - Clarify the Topic enum member is SCREAMING_SNAKE_CASE while the value is the kebab-case topic name, with a concrete example. - Note the KAFKA_TOPIC_TO_CLUSTER value is "default" today, but to match a sibling family if that ever differs. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Addressed the review comments in 6daf901:
|
untitaker
left a comment
There was a problem hiding this comment.
i think the skill should ask a few clarifying questions about whether this really needs a schema change. if this is just another taskbroker or outcomes topic then a few steps can be skipped
Which steps can be skipped? |
|
see getsentry/sentry-kafka-schemas#490 (review) -- this is not how we create taskworker or outcomes topics. we already have a schema definition for those, and sentry-kafka-schemas should not contain infra-specific topics that are not present in self-hosted or elsewhere EDIT: after discussing in slack we did create taskworker topics like that. I do think we should still add a caveat about outcomes |
Add a public/private decision up front: - Public (available to self-hosted): unchanged three-PR flow (sentry-kafka-schemas + ops + sentry). - Private (internal regions only): a single ops PR. The per-region overrides carry `cluster:` + `override_topic: <public_topic>` to inherit the public topic's topic_creation_config. No sentry-kafka-schemas change, no sentry change, no all_topics.yaml entry, and no version bump. Steps 1 (schemas) and 4 (sentry) are marked public-only; Step 0 asks the public/private question and, for private, the override topic; Step 3 and the report handle both paths. SPEC and README updated. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
- Collect a reference/sibling topic in Step 0 (it was used by Steps 2-4 but never gathered). - Broaden the collision check to all locations (sentry-kafka-schemas, ops default + regional overrides, and the sentry Topic enum / cluster map), regardless of public/private (was schemas-only for public). - Add a clarifying question + caveat that not every public topic needs a new schema entry; outcomes topics in particular reuse an existing schema and must not be added to sentry-kafka-schemas (per reviewer feedback). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Addressed the latest review feedback in aefd099:
The remaining Bugbot comments (enum member naming, regional-override path prefix, hardcoded cluster, enabled-region file set) were already fixed in earlier commits (2739a04, 6daf901) and re-anchored to the latest commit as lines shifted. |
Two inconsistencies introduced by the public/private split: - Outcomes-style public topics skip Step 1 (no new schema), but the version bumps (Steps 3/4) and the report (Step 5) still assumed a schemas release. Gate the bumps and add a two-PR report variant (ops + sentry, no bump) for the reuse-existing-schema case. - The collision check referenced $SCHEMAS/$SENTRY for private topics, which only locate $OPS. Scope the collision check to the repos each path locates (ops always; schemas + sentry for public). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Addressed the two new findings in 26adc81 and resolved the threads:
The earlier Bugbot comments (enum naming, override path, hardcoded cluster, enabled-region file set) were already resolved. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 26adc81. Configure here.
| - Private topics: ops PR only — no `sentry-kafka-schemas` change, no `sentry` change, no `all_topics.yaml` entry, no version bump. The `override_topic` must be an existing public topic in `all_topics.yaml`. | ||
| - Insert enum / `all_topics.yaml` entries next to sibling topics (grouped by family), not alphabetically. | ||
| - Confirm the generated schema file with the user before opening the first PR (public). | ||
| - Sequencing (only when Step 1 adds a new schema): the schemas PR gates the dependency bumps in `sentry`/`ops`. When the topic reuses an existing schema (outcomes) or is private, there is no schemas release, no version bump, and no cross-PR ordering. The ops/sentry PRs still bump the pin to the anticipated next version (latest released patch + 1) so the required change is visible; the PR body must flag it as anticipated and, for sentry, note that `uv.lock` must be regenerated with `uv lock` once the release publishes. Private topics have no such dependency. |
There was a problem hiding this comment.
SPEC contradicts no version bump
High Severity
The Runtime Contract sequencing bullet first states there is no version bump when Step 1 is skipped (outcomes or private), then immediately instructs ops/sentry PRs to bump sentry-kafka-schemas to the anticipated next version. That reverses Step 3.5/4.3 and can produce spurious dependency bumps.
Reviewed by Cursor Bugbot for commit 26adc81. Configure here.
| - Per-region override contents: `disabled: true` when not enabled. When enabled, `cluster:` (+ `partitions:` only if it differs from the default); **private topics also include `override_topic: <override_topic>`**. | ||
| - Private topics: ops PR only — no `sentry-kafka-schemas` change, no `sentry` change, no `all_topics.yaml` entry, no version bump. The `override_topic` must be an existing public topic in `all_topics.yaml`. | ||
| - Insert enum / `all_topics.yaml` entries next to sibling topics (grouped by family), not alphabetically. | ||
| - Confirm the generated schema file with the user before opening the first PR (public). |
There was a problem hiding this comment.
Schema confirm applies wrongly
Medium Severity
The non-negotiable constraint requires confirming the generated schema file before the first PR for any public topic. When Step 1 is skipped (outcomes), there is no schema file, yet the first PR is ops—this constraint does not fit that path.
Reviewed by Cursor Bugbot for commit 26adc81. Configure here.
| Commit and open the PR (drop `python/requirements.txt` from the `git add` for private topics): | ||
|
|
||
| ```bash | ||
| git add shared_config/kafka/topics/ cookiecutters/cookiecutter-region/ python/requirements.txt |
There was a problem hiding this comment.
Commit omits schema-skip case
Medium Severity
Step 3’s commit note only says to drop python/requirements.txt from git add for private topics, not when Step 1 was skipped for public topics that reuse a schema. The sample commands always stage requirements.txt and, in Step 4, pyproject.toml/uv.lock, which fights the explicit “skip the bump” rules.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 26adc81. Configure here.
|
This has become a mess of a PR. I'm going to close this and try again later. |


Adds a
create-kafka-topicskill that provisions a new Kafka topic across the four repos that must all agree for a Sentry topic to exist and deploy:all_topics.yaml, schemas requirement bumpTopicenum +KAFKA_TOPIC_TO_CLUSTER, schemas dependency bumpIt opens one PR per repo and reports the four PR links annotated with their merge-order dependencies (the schemas PR must merge + release before the ops/sentry version bumps).
The steps and file formats were reconciled against the real
taskworker-ingest-pushtopic PRs (sentry-kafka-schemas#484, ops#20917, sentry#117135, getsentry#20495). Per how ops works, CI regenerates the materialized/k8s config (make materialize), so the skill only edits source-of-truth files.Includes the required
SPEC.mdand registration inREADME.md,.claude/settings.json, and theclaude-settings-auditallowlist.🤖 Generated with Claude Code