project create: Add a flag to skip the default alert rule

Open Beginner friendly
#2,444 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
cli

Research direction

Start with the project create command and trace how it builds the project creation request. The API request type in packages/cli/src/lib/api/projects.ts already includes default_rules?: boolean; check how command flags are parsed and passed through. Done when the proposed flag sends default_rules: false and the command’s tests cover the behavior.

Written by the indexing model from the issue text.

Description

sentry project create always adds the default alert ("Send a notification for high priority issues"). There is no flag to turn this off.

The API already supports it: POST /teams/{org}/{team}/projects/ accepts default_rules: false, and packages/cli/src/lib/api/projects.ts already has default_rules?: boolean in the request type. But the project create command does not expose it.

This is useful for test, demo, and reproduction projects, where the default alert only makes noise. Now the only workaround is the raw API:

sentry api /teams/<org>/<team>/projects/ --method POST \
  --raw-field name=my-app --raw-field slug=my-app --raw-field platform=node \
  --field default_rules=false

Proposal: add a flag, for example sentry project create my-app:node --no-alerts (or --no-default-rules), that sends default_rules: false.

CLI version: 0.50.0

Dominant language
TypeScript
Stars
975
Forks
189
Avg merge
1d 2h
Merged PRs (30d)
571

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/toolkit

All issues in getsentry/toolkit

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.