Skip to content

refactor(issue): extract shared parameters for issue commands#79

Merged
BYK merged 2 commits intomainfrom
refactor/issue-shared-params
Jan 27, 2026
Merged

refactor(issue): extract shared parameters for issue commands#79
BYK merged 2 commits intomainfrom
refactor/issue-shared-params

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Jan 27, 2026

Summary

Extracts shared parameter definitions for issue commands so that `view`, `explain`, `plan` (and future commands) automatically get consistent `--org` and `--project` flags and issue ID support.

Changes

  • Add `IssueIdFlags` interface and `issueIdFlags` definition in `utils.ts`
  • Add `issueIdPositional` for shared positional parameter (accepts numeric ID, short ID, suffix, alias-suffix)
  • Add `buildCommandHint()` helper for consistent error messages
  • Refactor `view`, `explain`, `plan` commands to use shared definitions

Benefits

  • Single source of truth for flag descriptions and parsing
  • Future issue commands get these features for free
  • ~50 lines of duplicate code removed
  • Follows Stricli's recommended pattern for shared flags

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 27, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Issue

  • Add workspace-scoped alias cache by BYK in #52
  • Add short ID aliases for multi-project support by BYK in #31

Other

  • (api) Align with gh api and curl conventions by BYK in #60
  • (auth) Add press 'c' to copy URL during login flow by betegon in #58
  • (commands) Rename get commands to view and add -w browser flag by BYK in #53
  • Add explain and plan commands (Seer AI) by MathurAditya724 in #39
  • Add Sentry SDK for error tracking and usage telemetry by BYK in #63

Bug Fixes 🐛

Issue

  • Support short ID aliases in explain and plan commands by BYK in #74
  • Use correct fallback for unrecognized alias-suffix inputs by BYK in #72
  • Handle cross-org project slug collisions in alias generation by BYK in #62
  • Use org-scoped endpoint for latest event + enhanced display by betegon in #40

Other

  • (api) Use query params for --field with GET requests by BYK in #59

Documentation 📚

  • (issue) Update list command tips to reference view instead of get by BYK in #73
  • (readme) Add installation section by betegon in #65
  • Update command references from 'get' to 'view' and document -w flag by BYK in #54

Internal Changes 🔧

  • (issue) Extract shared parameters for issue commands by BYK in #79
  • (release) Fix changelog-preview permissions by BYK in #41
  • Rename config folder from .sentry-cli-next to .sentry by BYK in #50

Other

  • test(e2e): use mock HTTP server instead of live API by BYK in #78

🤖 This preview updates automatically when you update the PR.

@BYK BYK marked this pull request as ready for review January 27, 2026 01:08
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 27, 2026

Codecov Results 📊

✅ Patch coverage is 96.15%. Project has 1663 uncovered lines.
✅ Project coverage is 64.83%. Comparing base (base) to head (head).

Files with missing lines (22)
File Patch % Lines
human.ts 18.35% ⚠️ 672 Missing
resolve-target.ts 18.67% ⚠️ 257 Missing
oauth.ts 21.71% ⚠️ 202 Missing
resolver.ts 3.23% ⚠️ 120 Missing
errors.ts 5.94% ⚠️ 95 Missing
api-client.ts 73.48% ⚠️ 74 Missing
api.ts 89.78% ⚠️ 47 Missing
seer.ts 75.54% ⚠️ 45 Missing
errors.ts 73.17% ⚠️ 33 Missing
seer.ts 77.04% ⚠️ 31 Missing
preload.ts 39.02% ⚠️ 25 Missing
detector.ts 87.79% ⚠️ 16 Missing
cache.ts 76.27% ⚠️ 14 Missing
telemetry.ts 89.87% ⚠️ 8 Missing
config.ts 97.11% ⚠️ 7 Missing
index.ts 95.06% ⚠️ 4 Missing
colors.ts 91.84% ⚠️ 4 Missing
env-file.ts 97.17% ⚠️ 3 Missing
utils.ts 98.64% ⚠️ 2 Missing
alias.ts 98.56% ⚠️ 2 Missing
java.ts 97.22% ⚠️ 1 Missing
parser.ts 98.63% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    64.65%    64.83%    +0.18%
==========================================
  Files           39        39         —
  Lines         4702      4728       +26
  Branches         0         0         —
==========================================
+ Hits          3040      3065       +25
- Misses        1662      1663        +1
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK force-pushed the refactor/issue-shared-params branch from 967aa1a to 077d242 Compare January 27, 2026 01:12
Add shared parameter definitions (IssueIdFlags, issueIdFlags, issueIdPositional)
that all issue commands (except list) can use. This ensures consistent --org and
--project flag handling and issue ID acceptance across view, explain, and plan
commands.

- Add IssueIdFlags type and issueIdFlags definition in utils.ts
- Add issueIdPositional for shared positional parameter
- Add buildCommandHint() helper for error messages
- Refactor view, explain, plan commands to use shared definitions
@BYK BYK force-pushed the refactor/issue-shared-params branch from 077d242 to e78ee9a Compare January 27, 2026 01:17
@BYK BYK enabled auto-merge (squash) January 27, 2026 07:40
@BYK BYK merged commit c369713 into main Jan 27, 2026
16 checks passed
@BYK BYK deleted the refactor/issue-shared-params branch January 27, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant