feat(init): add --org flag and fix misleading multi-org error#549
feat(init): add --org flag and fix misleading multi-org error#549
Conversation
- Add --org flag for symmetry with --team and discoverability. Equivalent to the positional `sentry init <org>/` syntax. Conflicts with target-provided org are caught at parse time. - Fix multiple-orgs error in --yes mode: was "Set SENTRY_ORG" (which init never reads), now references --org and the target syntax. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Internal Changes 🔧Coverage
Other
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 126 passed | Total: 126 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1039 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 96.03% 96.03% —%
==========================================
Files 193 193 —
Lines 26142 26142 —
Branches 0 0 —
==========================================
+ Hits 25103 25103 —
- Misses 1039 1039 —
- Partials 0 0 —Generated by Codecov Action |
…t check Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The --org flag was inconsistent with all other commands (none have it). The right fix is to make the org/project positional syntax unambiguous in the help text by using labeled examples with generic my-org/my-project names instead of acme/, which could be mistaken for a filesystem path. Also updates the multiple-orgs error message to use the positional syntax. Co-Authored-By: Claude Sonnet 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.
| return { | ||
| ok: false, | ||
| error: `Multiple organizations found (${slugs}). Set SENTRY_ORG to specify which one.`, | ||
| error: `Multiple organizations found (${slugs}). Use 'sentry init my-org/ [directory]' to specify which one.`, |
There was a problem hiding this comment.
Error message omits --org flag the PR promised
High Severity
The PR title and description explicitly state that an --org flag is being added and that this error message "now references --org and the target syntax." However, the --org flag is entirely missing — InitFlags has no org property, parameters.flags has no org definition, and no alias is registered. The updated error message at line 698 only mentions positional syntax (sentry init my-org/) and not --org. Every --org-related item in the test plan (five of six) would fail. This appears to be the primary feature of the PR but its implementation was not included.
Additional Locations (1)
|
closing this. related #554 |


Summary
--org <slug>flag tosentry initfor symmetry with--teamand discoverability. Equivalent to the positionalsentry init <org>/syntax — users who see "organization not found" and run--helpnow have an obvious flag to use.--yes+ multiple-orgs error message: it said "Set SENTRY_ORG" butsentry initnever reads that env var. Now references--organd the target syntax.Test plan
sentry init --helpshows--orgflagsentry init --org acme-corpbehaves likesentry init acme/sentry init --org acme-corp ./mydirbehaves likesentry init acme/ ./mydirsentry init acme/ --org other-org→ error: "conflicts with target org"sentry init --yeswith multiple orgs shows updated error message referencing--org🤖 Generated with Claude Code