Skip to content
This repository was archived by the owner on Oct 23, 2026. It is now read-only.

fix(release): polish --from ref errors and dashed-value parsing - #1203

Merged
betegon merged 4 commits into
mainfrom
fix/set-commits-from-ref-errors
Jul 6, 2026
Merged

betegon merged 4 commits into
mainfrom
fix/set-commits-from-ref-errors

Conversation

@betegon

@betegon betegon commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Rewrite --from VALUE → --from=VALUE when VALUE starts with -, so Stricli passes dashed refs (e.g. --from --format=x) through to our validation guard instead of treating them as unknown flags
  • Map unknown git refs in getCommitLog to a friendly ValidationError instead of surfacing raw git stderr/stack traces

Test plan

  • pnpm vitest run test/lib/argv-hoist.test.ts test/lib/git-commit-log.test.ts
  • Manual: sentry release set-commits test --from bogus-ref → Unknown git ref 'bogus-ref': not found in this repository. (exit 21)
  • Manual: sentry release set-commits test --from --format=x → --from must be a git ref, not an option (exit 21)

Made with Cursor

Rewrite `--from VALUE` to `--from=VALUE` when VALUE starts with `-` so
Stricli passes injection attempts to validation instead of treating them
as unknown flags. Map unknown git refs to ValidationError instead of raw
git stderr.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1203/

Built to branch gh-pages at 2026-07-06 17:17 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions

github-actions Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 94.64%. Project has 5335 uncovered lines.
✅ Project coverage is 81.83%. Comparing base (base) to head (head).

Files with missing lines (3)
File Patch % Lines
src/lib/git.ts 80.00% ⚠️ 2 Missing and 3 partials
src/lib/argv-hoist.ts 96.43% ⚠️ 1 Missing and 2 partials
src/lib/errors.ts 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    81.81%    81.83%    +0.02%
==========================================
  Files          423       423         —
  Lines        29308     29354       +46
  Branches     19082     19124       +42
==========================================
+ Hits         23975     24019       +44
- Misses        5333      5335        +2
- Partials      1982      1986        +4

Generated by Codecov Action

Match agent-friendly error patterns used elsewhere (hex-id, ResolutionError):
each --from/--path validation failure now includes example commands and notes
about the ref..HEAD range semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread src/commands/release/set-commits.ts Resolved
Move agent-friendly validation message building to errors.ts (matching
ContextError/ResolutionError conventions from lore). Use Note: for
diagnostic context and always pass field for Sentry fingerprinting.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1db4b5b. Configure here.

Comment thread src/lib/argv-hoist.ts Resolved
Comment thread src/lib/argv-hoist.ts Resolved
Skip rewrite when the token after --from is a registered global or
set-commits flag so --json/--auto are not swallowed. Replace the
misleading --from=<ref> Note with accurate git ref / injection wording.

Co-authored-by: Cursor <cursoragent@cursor.com>
@betegon
betegon merged commit ed185af into main Jul 6, 2026
32 checks passed
@betegon
betegon deleted the fix/set-commits-from-ref-errors branch July 6, 2026 17:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant