Skip to content

Commit 2d37cdd

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/project-create
2 parents 6390271 + 233fa6c commit 2d37cdd

File tree

32 files changed

+5059
-1237
lines changed

32 files changed

+5059
-1237
lines changed

AGENTS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,20 @@ import type { SentryContext } from "../../context.js";
319319
import { getAuthToken } from "../../lib/config.js";
320320
```
321321
322+
### List Command Infrastructure
323+
324+
Two abstraction levels exist for list commands:
325+
326+
1. **`src/lib/list-command.ts`** — `buildOrgListCommand` factory + shared Stricli parameter constants (`LIST_TARGET_POSITIONAL`, `LIST_JSON_FLAG`, `LIST_CURSOR_FLAG`, `buildListLimitFlag`). Use this for simple entity lists like `team list` and `repo list`.
327+
328+
2. **`src/lib/org-list.ts`** — `dispatchOrgScopedList` with `OrgListConfig` and a 4-mode handler map: `auto-detect`, `explicit`, `org-all`, `project-search`. Complex commands (`project list`, `issue list`) call `dispatchOrgScopedList` with an `overrides` map directly instead of using `buildOrgListCommand`.
329+
330+
Key rules when writing overrides:
331+
- Each mode handler receives a `HandlerContext<T>` with the narrowed `parsed` plus shared I/O (`stdout`, `cwd`, `flags`). Access parsed fields via `ctx.parsed.org`, `ctx.parsed.projectSlug`, etc. — no manual `Extract<>` casts needed.
332+
- Commands with extra fields (e.g., `stderr`, `setContext`) spread the context and add them: `(ctx) => handle({ ...ctx, flags, stderr, setContext })`. Override `ctx.flags` with the command-specific flags type when needed.
333+
- `resolveCursor()` must be called **inside** the `org-all` override closure, not before `dispatchOrgScopedList`, so that `--cursor` validation errors fire correctly for non-org-all modes.
334+
- `handleProjectSearch` errors must use `"Project"` as the `ContextError` resource, not `config.entityName`.
335+
322336
## Commenting & Documentation (JSDoc-first)
323337
324338
### Default Rule

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"typecheck": "tsc --noEmit",
1818
"lint": "bunx ultracite check",
1919
"lint:fix": "bunx ultracite fix",
20-
"test": "bun test",
20+
"test": "bun run test:unit && bun run test:isolated",
2121
"test:unit": "bun test test/lib test/commands test/types --coverage --coverage-reporter=lcov",
2222
"test:isolated": "bun test test/isolated",
2323
"test:e2e": "bun test test/e2e",

plugins/sentry-cli/skills/sentry-cli/SKILL.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,10 @@ List issues in a project
202202

203203
**Flags:**
204204
- `-q, --query <value> - Search query (Sentry search syntax)`
205-
- `-n, --limit <value> - Maximum number of issues to return - (default: "10")`
205+
- `-n, --limit <value> - Maximum number of issues to list - (default: "10")`
206206
- `-s, --sort <value> - Sort by: date, new, freq, user - (default: "date")`
207-
- `--json - Output as JSON`
207+
- `--json - Output JSON`
208+
- `-c, --cursor <value> - Pagination cursor — only for <org>/ mode (use "last" to continue)`
208209

209210
**Examples:**
210211

@@ -441,25 +442,27 @@ Update the Sentry CLI to the latest version
441442

442443
Work with Sentry repositories
443444

444-
#### `sentry repo list <org>`
445+
#### `sentry repo list <target>`
445446

446447
List repositories
447448

448449
**Flags:**
449450
- `-n, --limit <value> - Maximum number of repositories to list - (default: "30")`
450451
- `--json - Output JSON`
452+
- `-c, --cursor <value> - Pagination cursor (use "last" to continue from previous page)`
451453

452454
### Team
453455

454456
Work with Sentry teams
455457

456-
#### `sentry team list <org>`
458+
#### `sentry team list <target>`
457459

458460
List teams
459461

460462
**Flags:**
461463
- `-n, --limit <value> - Maximum number of teams to list - (default: "30")`
462464
- `--json - Output JSON`
465+
- `-c, --cursor <value> - Pagination cursor (use "last" to continue from previous page)`
463466

464467
**Examples:**
465468

@@ -589,9 +592,10 @@ List issues in a project
589592

590593
**Flags:**
591594
- `-q, --query <value> - Search query (Sentry search syntax)`
592-
- `-n, --limit <value> - Maximum number of issues to return - (default: "10")`
595+
- `-n, --limit <value> - Maximum number of issues to list - (default: "10")`
593596
- `-s, --sort <value> - Sort by: date, new, freq, user - (default: "date")`
594-
- `--json - Output as JSON`
597+
- `--json - Output JSON`
598+
- `-c, --cursor <value> - Pagination cursor — only for <org>/ mode (use "last" to continue)`
595599

596600
### Orgs
597601

@@ -623,25 +627,27 @@ List projects
623627

624628
List repositories
625629

626-
#### `sentry repos <org>`
630+
#### `sentry repos <target>`
627631

628632
List repositories
629633

630634
**Flags:**
631635
- `-n, --limit <value> - Maximum number of repositories to list - (default: "30")`
632636
- `--json - Output JSON`
637+
- `-c, --cursor <value> - Pagination cursor (use "last" to continue from previous page)`
633638

634639
### Teams
635640

636641
List teams
637642

638-
#### `sentry teams <org>`
643+
#### `sentry teams <target>`
639644

640645
List teams
641646

642647
**Flags:**
643648
- `-n, --limit <value> - Maximum number of teams to list - (default: "30")`
644649
- `--json - Output JSON`
650+
- `-c, --cursor <value> - Pagination cursor (use "last" to continue from previous page)`
645651

646652
### Logs
647653

src/commands/cli/fix.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ function formatIssue(issue: SchemaIssue): string {
2424
if (issue.type === "missing_table") {
2525
return `Missing table: ${issue.table}`;
2626
}
27-
return `Missing column: ${issue.table}.${issue.column}`;
27+
if (issue.type === "missing_column") {
28+
return `Missing column: ${issue.table}.${issue.column}`;
29+
}
30+
return `Wrong primary key: ${issue.table}`;
2831
}
2932

3033
/** Expected permissions for the config directory (owner rwx) */

0 commit comments

Comments
 (0)