Make CLI project team optional with default
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- javascript, typescript
調査の方向性
まず packages/cli/src/lib/init/preflight.ts、packages/cli/src/commands/project/create.ts、packages/cli/src/lib/resolve-team.js を読んでください。init が既存のプロジェクトと新しいプロジェクトをどのように判定しているか、また createProjectWithDsn と createProjectWithAutoTeam がチームとエンドポイントをどのように解決しているかを追ってください。省略されたチームが提案されたローカル推論に従い、明示的に指定されたチームと既存プロジェクトのフローが意図された動作を維持すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
sentry init and sentry project create still force team selection too often, even when the org has one sensible default. Until the upstream API provides an implied default, the CLI should make team optional and infer it locally.
Current behavior
sentry init
- Without an explicit target, multi-org accounts hit a flat org select first (
"Which organization should the project be created in?"inpackages/cli/src/lib/init/preflight.ts) with no create-org option and weak defaulting. - Preflight then may prompt for a team (
"Which team should own this project?") before project create/select is decided — team is only relevant when creating a project, and should come after that decision. - New vs existing project is not auto-resolved from local signals (repo URL, cwd/git name, etc.); create-new is not an obvious top-level choice unless existing in-codebase Sentry metadata is already detected.
sentry project create
- Team is still a first-class create input via
--team/ team resolution (packages/cli/src/commands/project/create.ts,packages/cli/src/lib/resolve-team.js). - Happy path still resolves a concrete team before posting to the team-scoped create endpoint (
createProjectWithDsn→POST /teams/{org}/{team}/projects/). - There is already a member fallback that posts to the org-scoped endpoint and lets the server auto-create a personal
team-{username}(createProjectWithAutoTeam), but that is not the same as quietly defaulting to an existing org default team when the caller omits team.
Gap
- Flow order forces org/team picking before the real decision (new vs existing project), and does not use local repo signals to skip those steps.
- Team selection is noise for existing-project paths and still too prominent for headless create paths.
- Headless/agent project creation remains awkward because callers must understand teams even when they have no meaningful preference.
- Client-side inference is needed now; upstream API defaulting is tracked separately and may land later.
User stories
- As a new user running
sentry init, I do not want an early team prompt before I even decide whether I am creating or selecting a project. - As a headless/CLI user creating a project, I want to omit
--teamand still succeed. - As a member of a single-team org, I want create flows to default to that team without prompting.
- As a member of a multi-team org, I still want an explicit team choice to win when supplied.
- As someone creating projects into a large existing org, I do not want a surprising personal
team-{me}fork just because team was omitted.
Proposed solution
Reporter proposal for CLI-local behavior until (or unless) upstream API defines an implied default:
- Make team optional across create paths (
sentry initcreate branch andsentry project create). - When omitted, infer a deterministic default team (existing single accessible team / earliest active default-team behavior; do not invent a new personal team when a real default already exists).
- Keep explicit
--team/ explicit team selection unchanged. - For
initspecifically: resolve org → decide new vs existing project from local signals → only then collect create-specific details, and skip team entirely when it can be inferred. - Prefer create-new first only when there is no likely match; otherwise auto-select the match. Create-new vs select-existing should be top-level choices.
- Migrate to upstream implied-default API behavior when available.
Related:
- Upstream API: https://github.com/getsentry/sentry/issues/121490
- MCP client counterpart: https://github.com/getsentry/sentry-mcp/issues/1234
- Select overflow when option lists exceed terminal height: #1376
Requested by David Cramer.
--
- 主要言語
- TypeScript
- スター
- 121
- フォーク
- 14
- 平均マージ
- 23時間 54分
- マージ済み PR(30日)
- 103
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getsentry/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
-
bug jared
-
jared
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
似ている issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Crush オープン
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
ElementsProject/cln-application#167 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Quantco/pnpm-licenses#17 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100