feat(init): add create-sentry-project local op with org resolution fallback#333
Merged
betegon merged 7 commits intofeat/init-commandfrom Mar 4, 2026
Merged
Conversation
…llback Adds a new `create-sentry-project` local operation that resolves the org (via local config, env, or interactive API fallback), resolves/creates a team, creates the project, fetches the DSN, and returns all details. Includes tests with extracted `mockDownstreamSuccess` helper and coverage for the cancel path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Init
Trace
Other
Bug Fixes 🐛Api
Formatters
Setup
Other
Internal Changes 🔧Api
Other
🤖 This preview updates automatically when you update the PR. |
Contributor
Codecov Results 📊✅ 100 passed | Total: 100 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 95.74%. Project has 3197 uncovered lines. Files with missing lines (2)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 82.43% 82.91% +0.48%
==========================================
Files 126 133 +7
Lines 17792 18704 +912
Branches 0 0 —
==========================================
+ Hits 14666 15507 +841
- Misses 3126 3197 +71
- Partials 0 0 —Generated by Codecov Action |
Fixes TS2532 where TypeScript couldn't infer that orgs[0] is defined after checking orgs.length === 1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… slug Biome's noNonNullAssertion rule disallows `!`. Use `&& orgs[0]` guard to narrow the type safely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the shared `slugify` function to `src/lib/utils.ts` and import it in both consumers (`project/create.ts` and `local-ops.ts`) to avoid duplicated logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
slugify(name) can produce an empty string when the project name contains only special characters, which silently skips team auto-creation and results in a confusing "No teams found" error. Pre-compute the slug and return an early error if it's empty. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the
create-sentry-projectlocal operation so the remote workflow can ask the CLI to create a Sentry project. Resolves the org via local config / env vars first, falling back to listing orgs from the API (auto-selects if only one, prompts interactively if multiple).Changes
createSentryProjecthandler inlocal-ops.tswith extractedresolveOrgSlughelper that handles all org resolution paths (config, single-org auto-select, multi-org interactive prompt,--yesguard)CreateSentryProjectPayloadtype added totypes.ts--yes, interactive select, user cancel, API error, and missing DSN pathsmockDownstreamSuccesshelper to reduce test duplicationTest Plan