fix(project): create multiple projects; clear error on space-crammed names#1191
Open
betegon wants to merge 10 commits into
Open
fix(project): create multiple projects; clear error on space-crammed names#1191betegon wants to merge 10 commits into
betegon wants to merge 10 commits into
Conversation
…names Names are now variadic (like issue merge): `sentry project create web api worker node` creates three projects; the trailing arg is the platform, or use --platform. `create <name> <platform>` still works. When a single name has spaces and the API 400s, the error points to the variadic form instead of a cryptic HTTP 400. Fixes the cause of Sentry CLI-1YY. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
|
Contributor
Codecov Results 📊✅ Patch coverage is 92.41%. Project has 5318 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 81.78% 81.80% +0.02%
==========================================
Files 423 423 —
Lines 29194 29222 +28
Branches 18980 18997 +17
==========================================
+ Hits 23874 23904 +30
- Misses 5320 5318 -2
- Partials 1968 1973 +5Generated by Codecov Action |
Match the sibling error-builders (buildPlatformError, isPlatformError) which annotate their return types. Co-authored-by: Cursor <cursoragent@cursor.com>
Pair `project create` with the CLI's multi-value flag convention (`--features a,b`, set-commits `--path a,b`, `auth login --scope a,b`): each positional name may now also be comma-separated, so `create web,api,worker node` == `create web api worker node`. Commas are never valid in a slug, so this is unambiguous and prevents an agent comma-habit (`a,b,c`) from silently creating one `a-b-c` project. Co-authored-by: Cursor <cursoragent@cursor.com>
Positionals are space-separated variadic (also comma-tolerant); optional flags are comma-separated. Splits the rule by argument type so agents pick the right shape. Co-authored-by: Cursor <cursoragent@cursor.com>
USAGE_HINT now reflects variadic names + platform ([<org>/]<name...> <platform>). The crammed-name 400 message no longer asserts names "can't span multiple words" (the 400 may be a length issue), instead framing both the multi-project and single-project fixes. Co-authored-by: Cursor <cursoragent@cursor.com>
resolvePlatformAndNames passed only args[0] to buildPlatformError, so a bad platform with multiple names (`create proj1 proj2 bad`) hinted just `proj1`. Echo the full name list per branch so the usage example matches what was typed. Co-authored-by: Cursor <cursoragent@cursor.com>
In multi-project create, the auto-create team slug is now pinned to the first project for the whole batch. A real run already creates one team on the first project and reuses it; dry-run previews now agree instead of showing a divergent "would create team" per project in an empty org. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
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.
Reviewed by Cursor Bugbot for commit 3ea97b8. Configure here.
createProjectWithAutoTeamFallback rethrew 400s unchanged, so a crammed multi-word name that reached the org-scoped fallback (after a team-scoped 403) still surfaced the raw API error. Apply the same actionable guidance there. Co-authored-by: Cursor <cursoragent@cursor.com>
- Extract projectExistsError() so the 409 "already exists" message + view hint live in one place (was duplicated across the team and org-scoped fallback paths). - Pass a field to the multi-org ValidationError so error-reporting doesn't collapse it into the unfielded fingerprint. - Use USAGE_HINT for the missing-name error instead of a stale hardcoded usage string. Co-authored-by: Cursor <cursoragent@cursor.com>
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
sentry project createnow creates multiple projects at once, and turns the cryptic 400 from space-crammed names into actionable guidance.This fixes the production issue behind Sentry
CLI-1YY(https://sentry.sentry.io/issues/7529054898/): AI agents were callingsentry project create "web api worker ..."— all the names crammed into one quoted argument — and the API rejected the resulting name with a bareHTTP 400.What changed
issue mergeconvention):sentry project create web api worker nodecreates three projects. The trailing positional is the platform, or pass--platform/-p. All names share one org.sentry project create my-app nodestill works exactly as before.sentry project create web api worker node) instead of surfacing a raw 400.Commas are intentionally not used — spaces are ambiguous (Sentry display names may contain them), so we rely on separate arguments, which is also how every other multi-value command in the CLI works.
Test plan
pnpm vitest run test/commands/project/create.test.ts— 44 pass (3 new: multiple names,--platformflag, crammed-name 400 guidance).--platformflag, and missing-platform error.