Make project-create team optional with default
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 23m
- Merged PRs (30d)
- 607
Description
Summary
Creating a project still forces a team decision in API/headless paths even when the org only has one sensible default. That friction shows up for new users (who don't know what a team is) and for CLI/headless onboarding, where team selection is especially painful.
Current behavior
- Canonical create path is team-scoped:
POST /teams/{org_slug}/{team_slug}/projects/(src/sentry/core/endpoints/team_projects.py). The team is required in the URL. - Org-level
POST /organizations/{org_slug}/projects/does not accept a team either; it auto-creates a personalteam-{username}team and binds the project there (src/sentry/core/endpoints/organization_projects.py). - Web UI already defaults the team selector to the first accessible team and mostly works for new customers, but still surfaces the control and validates a missing team (
static/app/views/projectInstall/createProject.tsx). - There is already a backend helper that resolves "the default team" as the earliest active team, or creates one from a provided slug if none exists:
get_or_create_default_teaminsrc/sentry/organizations/services/organization/impl.py.
Gap / impact
- New users hit a required team choice they don't understand during project creation.
- Headless/CLI project creation is worse because callers must discover and supply a team slug even when the org effectively has one default.
- Team names are often low-signal (org-name default,
team-{username}, etc.), so forcing the choice adds complexity without clear value for single-team orgs. - Teams still matter for larger orgs, but front-loading them on every create path over-exposes the concept.
User stories
- As a new user creating my first project, I don't want to choose a team I don't understand; Sentry should just put the project somewhere sensible.
- As a headless/CLI user (or agent) creating a project, I want to omit team entirely and still succeed.
- As a member of a single-team org, I want project create to default to that team without prompting.
- As a member of a multi-team org, I still want to be able to pick a team when it matters.
- As someone onboarding into a large existing org, I don't want nonsensical team names or an unnecessary team fork (
team-{me}) just to create a project.
Proposed solution
Make the team parameter optional on project creation and default it to the org's default team when omitted.
"Default team" still needs a crisp definition (likely the existing earliest-active-team behavior from get_or_create_default_team, not a new personal team), including permission and multi-team edge cases.
This is intentionally an API-first fix so CLI/headless flows inherit it; UI can keep hiding/defaulting team when n <= 1 as a follow-on.
Requested by David Cramer.
--
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/sentry/core/endpoints/team_projects.py and src/sentry/core/endpoints/organization_projects.py, then read get_or_create_default_team in src/sentry/organizations/services/organization/impl.py. Trace how project creation resolves teams and permissions when the parameter is omitted. Done means API/headless creation can omit the team, uses the defined default without creating an unnecessary personal team, and preserves explicit team selection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100