Repository navigation
docs(cli): Reject sentry commands in fragment code blocks - #1639
Merged
Merged
Conversation
check:fragments only flagged headings named "Examples", so example blocks under topical headings (like "Using Attribute Keys" in #1559) slipped through. Now any shell code block in a command fragment that runs a `sentry` command fails the check unless it carries an explicit `<!-- allow-commands: <reason> -->` marker on the line above. Markers without a reason, or on blocks without commands, also fail, and generate-command-docs strips markers so they don't reach the docs or skill files. Existing violations are moved to docs.examples (local, local run, event view), dropped where an identical example already existed (log list, sourcemap upload, local -f), rewritten as prose, or marked as workflows or sample output. The subcommand-coverage hint now points to docs.examples instead of suggesting code examples in the fragment. Co-Authored-By: BYK <burak.kaya@sentry.io>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
BYK
approved these changes
Oct 23, 2026
sentry-junior Bot
added a commit
that referenced
this pull request
Oct 23, 2026
The block shows attribute keys used by span list and explore, so it cannot move into attribute list's docs.examples. Mark it with allow-commands to satisfy the fragment check added in #1639.
betegon
pushed a commit
that referenced
this pull request
Oct 25, 2026
The block shows attribute keys used by span list and explore, so it cannot move into attribute list's docs.examples. Mark it with allow-commands to satisfy the fragment check added in #1639.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
check:fragmentsonly failed on headings named "Examples", so example blocks under other headings slipped through, like## Using Attribute Keysin #1559 (comment). This PR makes the check look at the code instead of the heading.Now any shell code block (
bash/sh/shell/console/zshor unlabeled) in a command fragment that runs asentrycommand failscheck:fragments. That includes nested blocks, and commands after a$prompt,VAR=value,|, or&&. To keep a real workflow, sample output, or cross-command guide, put an explicit opt-out marker on the line directly above the block:<!-- allow-commands: multi-step CI release workflow -->The reason is required. A marker without a reason, on a block with no commands, or not directly above a code block also fails, so markers can't go stale quietly.
generate-command-docsstrips the markers, so they don't end up in the docs site or the committed skill files.Existing violations on
main:docs.examples:local --open,local -f ai,local --format json,local run --open, the agent-streamlocal run --format json, and theevent viewattachment download.log list --json | jq,sourcemap upload --allow-emptyandlocal -f error -f logalready existed as examples.send-eventalias note.auth.mdorg listsample output--json/--websections inindex.mdlocal.mdlocal.mdThe subcommand-coverage hint used to say "add a heading or code example". It now points to
docs.examples.#1559's current
attribute.mdgets flagged by this check, so it will need to move its examples intoattribute list'sdocs.examplesonce this lands.via BYK.
--
View Junior Session in Sentry