Skip to content

feat(cli): Add persistent tips default and SENTRY_DISABLE_TIPS override - #1522

Merged
BYK merged 4 commits into
mainfrom
byk/feat/cli-disable-tips
Oct 16, 2026
Merged

BYK merged 4 commits into
mainfrom
byk/feat/cli-disable-tips

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Closes #1479

Lets users hide the Tip: ... hints printed below command output:

  • sentry cli defaults tips off stores the preference in the CLI DB, next to the existing graphics/telemetry defaults, and it shows up in sentry cli defaults (human + JSON) and --clear.
  • SENTRY_DISABLE_TIPS=1 turns tips off for a session and wins over the stored preference. It's registered in the env-var registry so it appears in the generated configuration docs.
  • No CLI flag, per review on the original PR.

This ports getsentry/cli#1414, which stalled before the repo move, and applies the feedback left there. The main behavior change from that version: the command hint footer also carries pagination, dry-run, cancellation and "not found" notices, so we no longer drop the whole hint. Only Tip: text is stripped (a whole line, or a trailing ... Tip: ... sentence), and the cache-age footer stays. The issue list footer tip and the project create tip, which are rendered by formatters rather than the hint footer, follow the same setting.

Tips that are part of error messages (unknown-command suggestions, Tip: use --help) are left alone on purpose. They're recovery guidance, not footer noise.

via byk.

--

View Junior Session [Sentry]

Let users hide the `Tip: ...` hints printed below command output, either
persistently with `sentry cli defaults tips off` or per session with
`SENTRY_DISABLE_TIPS=1` (the env var wins over the stored preference).

Only tip text is removed: pagination, dry-run, cancellation and other
notices that share the command hint footer are kept, as is the cache-age
footer. No CLI flag is added.

Ported from getsentry/cli#1414 with the review feedback applied.

Closes #1479

Co-Authored-By: Burak Yigit Kaya <burak.kaya@sentry.io>
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Oct 16, 2026 8:40pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 16, 2026
Comment thread packages/cli/src/commands/cli/defaults.ts Outdated
Comment thread packages/cli/src/lib/db/defaults.ts Outdated
Comment thread packages/cli/src/lib/db/defaults.ts Outdated
Comment thread packages/cli/src/lib/formatters/human.ts
- Add getOnOffPreference/setOnOffPreference so the telemetry,
  agent-skills, graphics and tips accessors stop duplicating the
  metadata read/write logic, and an onOffHandler factory for the
  matching `sentry cli defaults` handlers.
- Build the clear-all confirmation key list from the defaults registry
  instead of a hand-maintained string.
- Memoize tipsSuppressed() per env object (same pattern as
  getAuthToken), reset when the tips default changes and between tests.
Comment thread packages/cli/src/commands/cli/defaults.ts Outdated
Replace the per-preference get/set wrappers (telemetry, agent-skills,
graphics, tips) with exported getOnOffPreference(name) and
setOnOffPreference(name, enabled) backed by one key map, and build the
matching `sentry cli defaults` handlers from ON_OFF_PREFERENCES. The tips
cache reset moves into a per-preference change hook.

@BYK BYK left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preference names should be an enum or a restricted string type.

I also think with your latest abstractions a bunch of tests became redundant.

Declare the on/off preference names as a const tuple so OnOffPreference
is a restricted string union (no Object.keys cast), derive their
metadata keys and DefaultsState fields from it, and collapse the
per-preference storage tests into one parameterized block.
@sentry-junior

sentry-junior Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review notes in 4401285:

  • The on/off preference names are now a const tuple, ON_OFF_PREFERENCES, so OnOffPreference is a literal string union with no Object.keys cast. Their defaults.<name> metadata keys and their DefaultsState fields come from that tuple too.
  • The nine near-identical storage tests (get/set/clear for telemetry, agent-skills and tips) are now one describe.each(ON_OFF_PREFERENCES) block. It now covers graphics too.

@BYK
BYK merged commit 0bf3b3a into main Oct 16, 2026
26 checks passed
@BYK
BYK deleted the byk/feat/cli-disable-tips branch October 16, 2026 22:00

This branch was previously deployed

1 inactive deployment
Preview — 4401285b Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable tips

1 participant