Skip to content

Commit b576c7a

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/project-list-pagination-v2
2 parents 5404423 + 35d9b0d commit b576c7a

File tree

16 files changed

+789
-65
lines changed

16 files changed

+789
-65
lines changed

.craft.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ artifactProvider:
99
name: github
1010
config:
1111
artifacts:
12-
ci.yml:
13-
- 'sentry-*'
12+
Build:
13+
- '/^sentry-.*$/'
1414
- 'npm-package'
1515
- 'gh-pages'
1616
targets:

.github/workflows/ci.yml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: Build
22

33
on:
44
push:
@@ -47,7 +47,18 @@ jobs:
4747
if: needs.changes.outputs.skill == 'true'
4848
runs-on: ubuntu-latest
4949
steps:
50+
- name: Get auth token
51+
id: token
52+
# Fork PRs don't have access to secrets, so this step is skipped
53+
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
54+
uses: actions/create-github-app-token@v2.2.1
55+
with:
56+
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
57+
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
5058
- uses: actions/checkout@v4
59+
with:
60+
token: ${{ steps.token.outputs.token || github.token }}
61+
ref: ${{ github.head_ref || github.ref_name }}
5162
- uses: oven-sh/setup-bun@v2
5263
- uses: actions/cache@v4
5364
id: cache
@@ -60,33 +71,18 @@ jobs:
6071
id: check
6172
run: bun run check:skill
6273
continue-on-error: true
63-
- name: Output regeneration instructions
64-
if: steps.check.outcome == 'failure'
65-
env:
66-
GITHUB_REPOSITORY: ${{ github.repository }}
67-
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
68-
IS_FORK: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
74+
- name: Auto-commit regenerated SKILL.md
75+
if: steps.check.outcome == 'failure' && steps.token.outcome == 'success'
6976
run: |
70-
echo "## SKILL.md is out of date" >> $GITHUB_STEP_SUMMARY
71-
echo "" >> $GITHUB_STEP_SUMMARY
72-
echo "The CLI commands have changed but \`plugins/sentry-cli/skills/sentry-cli/SKILL.md\` hasn't been updated." >> $GITHUB_STEP_SUMMARY
73-
echo "" >> $GITHUB_STEP_SUMMARY
74-
75-
echo "### To fix, run locally and commit:" >> $GITHUB_STEP_SUMMARY
76-
echo "" >> $GITHUB_STEP_SUMMARY
77-
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
78-
echo "bun run generate:skill" >> $GITHUB_STEP_SUMMARY
79-
echo "git add plugins/sentry-cli/skills/sentry-cli/SKILL.md" >> $GITHUB_STEP_SUMMARY
80-
echo "git commit -m 'chore: Regenerate SKILL.md'" >> $GITHUB_STEP_SUMMARY
81-
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
82-
83-
if [ "$IS_FORK" != "true" ]; then
84-
WORKFLOW_URL="https://github.com/${GITHUB_REPOSITORY}/actions/workflows/generate-skill.yml/dispatch?ref=main&inputs%5Bbranch%5D=${BRANCH_NAME}"
85-
echo "" >> $GITHUB_STEP_SUMMARY
86-
echo "Or [trigger the Generate SKILL.md workflow](${WORKFLOW_URL}) to auto-commit the fix." >> $GITHUB_STEP_SUMMARY
87-
fi
88-
89-
echo "::error::SKILL.md is out of date. See job summary for fix options."
77+
git config user.name "github-actions[bot]"
78+
git config user.email "github-actions[bot]@users.noreply.github.com"
79+
git add plugins/sentry-cli/skills/sentry-cli/SKILL.md
80+
git commit -m "chore: regenerate SKILL.md"
81+
git push
82+
- name: Fail for fork PRs with stale SKILL.md
83+
if: steps.check.outcome == 'failure' && steps.token.outcome != 'success'
84+
run: |
85+
echo "::error::SKILL.md is out of date. Run 'bun run generate:skill' locally and commit the result."
9086
exit 1
9187
9288
lint:

CHANGELOG.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,107 @@
11
# Changelog
22

33
<!-- Craft will auto-populate this file -->
4+
## 0.9.1
5+
6+
### New Features ✨
7+
8+
#### Cli
9+
10+
- Add setup command for shell integration by @BYK in [#213](https://github.com/getsentry/cli/pull/213)
11+
- Add plural command aliases for list commands by @betegon in [#209](https://github.com/getsentry/cli/pull/209)
12+
13+
#### Other
14+
15+
- (formatters) Display span duration in span tree by @betegon in [#219](https://github.com/getsentry/cli/pull/219)
16+
- (log) Add view command to display log entry details by @betegon in [#212](https://github.com/getsentry/cli/pull/212)
17+
- (repo) Add repo list command by @betegon in [#222](https://github.com/getsentry/cli/pull/222)
18+
- (setup) Auto-install Claude Code agent skill during setup by @BYK in [#216](https://github.com/getsentry/cli/pull/216)
19+
- (trace) Add trace list and view commands by @betegon in [#218](https://github.com/getsentry/cli/pull/218)
20+
21+
### Bug Fixes 🐛
22+
23+
#### Upgrade
24+
25+
- Handle EPERM in isProcessRunning for cross-user locks by @BYK in [#211](https://github.com/getsentry/cli/pull/211)
26+
- Replace curl pipe with direct binary download by @BYK in [#208](https://github.com/getsentry/cli/pull/208)
27+
28+
#### Other
29+
30+
- (craft) Use regex pattern for binary artifact matching by @BYK in [#230](https://github.com/getsentry/cli/pull/230)
31+
- (deps) Move runtime dependencies to devDependencies by @BYK in [#225](https://github.com/getsentry/cli/pull/225)
32+
33+
### Documentation 📚
34+
35+
- (log) Add documentation for sentry log view command by @betegon in [#214](https://github.com/getsentry/cli/pull/214)
36+
- Add documentation for log command by @betegon in [#210](https://github.com/getsentry/cli/pull/210)
37+
38+
### Internal Changes 🔧
39+
40+
#### Ci
41+
42+
- Auto-commit SKILL.md when stale by @betegon in [#224](https://github.com/getsentry/cli/pull/224)
43+
- Remove merge-artifacts job with Craft 2.21.1 by @BYK in [#215](https://github.com/getsentry/cli/pull/215)
44+
45+
#### Other
46+
47+
- (project) Replace --org flag with org/project positional by @betegon in [#223](https://github.com/getsentry/cli/pull/223)
48+
- (setup) Unify binary placement via setup --install by @BYK in [#217](https://github.com/getsentry/cli/pull/217)
49+
- Rename CI workflow to Build and fix artifact filter by @BYK in [#229](https://github.com/getsentry/cli/pull/229)
50+
- Handle fork PRs in SKILL.md auto-commit by @BYK in [#227](https://github.com/getsentry/cli/pull/227)
51+
- Enable minify for standalone binaries by @BYK in [#220](https://github.com/getsentry/cli/pull/220)
52+
53+
### Other
54+
55+
- release: 0.9.0 by @BYK in [1452e02c](https://github.com/getsentry/cli/commit/1452e02ca3e359388a4e84578e8dad81f63f3f2d)
56+
57+
## 0.9.0
58+
59+
### New Features ✨
60+
61+
#### Cli
62+
63+
- Add setup command for shell integration by @BYK in [#213](https://github.com/getsentry/cli/pull/213)
64+
- Add plural command aliases for list commands by @betegon in [#209](https://github.com/getsentry/cli/pull/209)
65+
66+
#### Other
67+
68+
- (formatters) Display span duration in span tree by @betegon in [#219](https://github.com/getsentry/cli/pull/219)
69+
- (log) Add view command to display log entry details by @betegon in [#212](https://github.com/getsentry/cli/pull/212)
70+
- (repo) Add repo list command by @betegon in [#222](https://github.com/getsentry/cli/pull/222)
71+
- (setup) Auto-install Claude Code agent skill during setup by @BYK in [#216](https://github.com/getsentry/cli/pull/216)
72+
- (trace) Add trace list and view commands by @betegon in [#218](https://github.com/getsentry/cli/pull/218)
73+
74+
### Bug Fixes 🐛
75+
76+
#### Upgrade
77+
78+
- Handle EPERM in isProcessRunning for cross-user locks by @BYK in [#211](https://github.com/getsentry/cli/pull/211)
79+
- Replace curl pipe with direct binary download by @BYK in [#208](https://github.com/getsentry/cli/pull/208)
80+
81+
#### Other
82+
83+
- (deps) Move runtime dependencies to devDependencies by @BYK in [#225](https://github.com/getsentry/cli/pull/225)
84+
85+
### Documentation 📚
86+
87+
- (log) Add documentation for sentry log view command by @betegon in [#214](https://github.com/getsentry/cli/pull/214)
88+
- Add documentation for log command by @betegon in [#210](https://github.com/getsentry/cli/pull/210)
89+
90+
### Internal Changes 🔧
91+
92+
#### Ci
93+
94+
- Auto-commit SKILL.md when stale by @betegon in [#224](https://github.com/getsentry/cli/pull/224)
95+
- Remove merge-artifacts job with Craft 2.21.1 by @BYK in [#215](https://github.com/getsentry/cli/pull/215)
96+
97+
#### Other
98+
99+
- (project) Replace --org flag with org/project positional by @betegon in [#223](https://github.com/getsentry/cli/pull/223)
100+
- (setup) Unify binary placement via setup --install by @BYK in [#217](https://github.com/getsentry/cli/pull/217)
101+
- Rename CI workflow to Build and fix artifact filter by @BYK in [#229](https://github.com/getsentry/cli/pull/229)
102+
- Handle fork PRs in SKILL.md auto-commit by @BYK in [#227](https://github.com/getsentry/cli/pull/227)
103+
- Enable minify for standalone binaries by @BYK in [#220](https://github.com/getsentry/cli/pull/220)
104+
4105
## 0.8.0
5106

6107
### New Features ✨

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sentry",
3-
"version": "0.9.0-dev.0",
3+
"version": "0.10.0-dev.0",
44
"description": "Sentry CLI - A command-line interface for using Sentry built by robots and humans for robots and humans",
55
"type": "module",
66
"bin": {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "sentry-cli",
3-
"version": "0.9.0",
3+
"version": "0.10.0",
44
"description": "Skills for using the Sentry CLI to interact with Sentry from the command line"
55
}

src/commands/cli/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ function printWelcomeMessage(
171171
log(`Installed sentry v${version} to ${binaryPath}`);
172172
log("");
173173
log("Get started:");
174-
log(" sentry login Authenticate with Sentry");
174+
log(" sentry auth login Authenticate with Sentry");
175175
log(" sentry --help See all available commands");
176176
log("");
177177
log("https://cli.sentry.dev");

src/lib/formatters/colors.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,24 @@ export function levelColor(text: string, level: string | undefined): string {
8888
const colorFn = LEVEL_COLORS[normalizedLevel];
8989
return colorFn ? colorFn(text) : text;
9090
}
91+
92+
// Fixability-based Coloring
93+
94+
/** Fixability tier labels returned by getSeerFixabilityLabel() */
95+
export type FixabilityTier = "high" | "med" | "low";
96+
97+
const FIXABILITY_COLORS: Record<FixabilityTier, (text: string) => string> = {
98+
high: green,
99+
med: yellow,
100+
low: red,
101+
};
102+
103+
/**
104+
* Color text based on Seer fixability tier.
105+
*
106+
* @param text - Text to colorize
107+
* @param tier - Fixability tier label (`"high"`, `"med"`, or `"low"`)
108+
*/
109+
export function fixabilityColor(text: string, tier: FixabilityTier): string {
110+
return FIXABILITY_COLORS[tier](text);
111+
}

src/lib/formatters/human.ts

Lines changed: 87 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ import type {
2323
import { withSerializeSpan } from "../telemetry.js";
2424
import {
2525
boldUnderline,
26+
type FixabilityTier,
27+
fixabilityColor,
2628
green,
2729
levelColor,
2830
muted,
@@ -55,6 +57,60 @@ function capitalize(str: string): string {
5557
return str.charAt(0).toUpperCase() + str.slice(1);
5658
}
5759

60+
/**
61+
* Convert Seer fixability score to a tier label.
62+
*
63+
* Thresholds are simplified from Sentry core (sentry/seer/autofix/constants.py)
64+
* into 3 tiers for CLI display.
65+
*
66+
* @param score - Numeric fixability score (0-1)
67+
* @returns `"high"` | `"med"` | `"low"`
68+
*/
69+
export function getSeerFixabilityLabel(score: number): FixabilityTier {
70+
if (score > 0.66) {
71+
return "high";
72+
}
73+
if (score > 0.33) {
74+
return "med";
75+
}
76+
return "low";
77+
}
78+
79+
/**
80+
* Format fixability score as "label(pct%)" for compact list display.
81+
*
82+
* @param score - Numeric fixability score, or null/undefined if unavailable
83+
* @returns Formatted string like `"med(50%)"`, or `""` when score is unavailable
84+
*/
85+
export function formatFixability(score: number | null | undefined): string {
86+
if (score === null || score === undefined) {
87+
return "";
88+
}
89+
const label = getSeerFixabilityLabel(score);
90+
const pct = Math.round(score * 100);
91+
return `${label}(${pct}%)`;
92+
}
93+
94+
/**
95+
* Format fixability score for detail view: "Label (pct%)".
96+
*
97+
* Uses capitalized label with space before parens for readability
98+
* in the single-issue detail display.
99+
*
100+
* @param score - Numeric fixability score, or null/undefined if unavailable
101+
* @returns Formatted string like `"Med (50%)"`, or `""` when score is unavailable
102+
*/
103+
export function formatFixabilityDetail(
104+
score: number | null | undefined
105+
): string {
106+
if (score === null || score === undefined) {
107+
return "";
108+
}
109+
const label = getSeerFixabilityLabel(score);
110+
const pct = Math.round(score * 100);
111+
return `${capitalize(label)} (${pct}%)`;
112+
}
113+
58114
/** Map of entry type strings to their TypeScript types */
59115
type EntryTypeMap = {
60116
exception: ExceptionEntry;
@@ -254,10 +310,12 @@ const COL_ALIAS = 15;
254310
const COL_SHORT_ID = 22;
255311
const COL_COUNT = 5;
256312
const COL_SEEN = 10;
313+
/** Width for the FIXABILITY column (longest value "high(100%)" = 10) */
314+
const COL_FIX = 10;
257315

258316
/** Column where title starts in single-project mode (no ALIAS column) */
259317
const TITLE_START_COL =
260-
COL_LEVEL + 1 + COL_SHORT_ID + 1 + COL_COUNT + 2 + COL_SEEN + 2; // = 50
318+
COL_LEVEL + 1 + COL_SHORT_ID + 1 + COL_COUNT + 2 + COL_SEEN + 2 + COL_FIX + 2;
261319

262320
/** Column where title starts in multi-project mode (with ALIAS column) */
263321
const TITLE_START_COL_MULTI =
@@ -270,7 +328,9 @@ const TITLE_START_COL_MULTI =
270328
COL_COUNT +
271329
2 +
272330
COL_SEEN +
273-
2; // = 66
331+
2 +
332+
COL_FIX +
333+
2;
274334

275335
/**
276336
* Format the header row for issue list table.
@@ -291,6 +351,8 @@ export function formatIssueListHeader(isMultiProject = false): string {
291351
" " +
292352
"SEEN".padEnd(COL_SEEN) +
293353
" " +
354+
"FIXABILITY".padEnd(COL_FIX) +
355+
" " +
294356
"TITLE"
295357
);
296358
}
@@ -303,6 +365,8 @@ export function formatIssueListHeader(isMultiProject = false): string {
303365
" " +
304366
"SEEN".padEnd(COL_SEEN) +
305367
" " +
368+
"FIXABILITY".padEnd(COL_FIX) +
369+
" " +
306370
"TITLE"
307371
);
308372
}
@@ -521,6 +585,15 @@ export function formatIssueRow(
521585
const count = `${issue.count}`.padStart(COL_COUNT);
522586
const seen = formatRelativeTime(issue.lastSeen);
523587

588+
// Fixability column (color applied after padding to preserve alignment)
589+
const fixText = formatFixability(issue.seerFixabilityScore);
590+
const fixPadding = " ".repeat(Math.max(0, COL_FIX - fixText.length));
591+
const score = issue.seerFixabilityScore;
592+
const fix =
593+
fixText && score !== null && score !== undefined
594+
? fixabilityColor(fixText, getSeerFixabilityLabel(score)) + fixPadding
595+
: fixPadding;
596+
524597
// Multi-project mode: include ALIAS column
525598
if (isMultiProject) {
526599
const aliasShorthand = computeAliasShorthand(issue.shortId, projectAlias);
@@ -529,11 +602,11 @@ export function formatIssueRow(
529602
);
530603
const alias = `${aliasShorthand}${aliasPadding}`;
531604
const title = wrapTitle(issue.title, TITLE_START_COL_MULTI, termWidth);
532-
return `${level} ${alias} ${shortId} ${count} ${seen} ${title}`;
605+
return `${level} ${alias} ${shortId} ${count} ${seen} ${fix} ${title}`;
533606
}
534607

535608
const title = wrapTitle(issue.title, TITLE_START_COL, termWidth);
536-
return `${level} ${shortId} ${count} ${seen} ${title}`;
609+
return `${level} ${shortId} ${count} ${seen} ${fix} ${title}`;
537610
}
538611

539612
/**
@@ -564,6 +637,16 @@ export function formatIssueDetails(issue: SentryIssue): string[] {
564637
lines.push(`Priority: ${capitalize(issue.priority)}`);
565638
}
566639

640+
// Seer fixability
641+
if (
642+
issue.seerFixabilityScore !== null &&
643+
issue.seerFixabilityScore !== undefined
644+
) {
645+
const fixDetail = formatFixabilityDetail(issue.seerFixabilityScore);
646+
const tier = getSeerFixabilityLabel(issue.seerFixabilityScore);
647+
lines.push(`Fixability: ${fixabilityColor(fixDetail, tier)}`);
648+
}
649+
567650
// Level with unhandled indicator
568651
let levelLine = issue.level ?? "unknown";
569652
if (issue.isUnhandled) {

0 commit comments

Comments
 (0)