feat: add dry_run input - #765
Conversation
Closes #511 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Warning Review limit reached
Next review available in: 47 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe action adds an optional ChangesDry-run support
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Input as Action input
participant Main as main
participant GitCommands as add/remove
participant Git as Git
participant Output as Action output
Input->>Main: provide dry_run=true
Main->>GitCommands: run staging probes
GitCommands->>Git: execute add/remove with --dry-run
Git-->>GitCommands: return probe results
GitCommands-->>Main: return staging results
Main->>Output: log planned Git operations
Main-->>Output: exit without mutation
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1⚔️ Resolve merge conflicts 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/io.ts`:
- Line 13: Update the dry_run property in InputTypes from string to boolean so
getInput('dry_run', true) produces a boolean-compatible value for the dryRun
flag used by main.ts, preventing non-boolean string values from controlling
execution.
In `@src/main.ts`:
- Around line 397-400: Update the staging-validation flow around
assertNoUnexpectedGitlinks to run during dryRun as well as normal execution. For
dry runs, use an isolated temporary Git index, apply the staging arguments to
that index, inspect its cached raw diff, and validate it without modifying the
repository’s real index; preserve the existing normal-execution behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: feccb94a-aff3-463f-b24a-5912c5b63572
📒 Files selected for processing (5)
README.mdaction.ymllib/index.jssrc/io.tssrc/main.ts
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main.ts`:
- Around line 430-435: Update the temporary-index setup in the main flow around
indexPath so repositories where HEAD does not resolve initialize tmpIndex as an
empty index instead of running git read-tree HEAD. Preserve copying an existing
index and retain the current read-tree behavior when HEAD resolves, so git add
--dry-run and first-commit execution continue to work.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c876f1cd-3d2a-445c-9a43-2a6629d1f677
📒 Files selected for processing (3)
lib/index.jssrc/io.tssrc/main.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/io.ts
Co-authored-by: Cursor <cursoragent@cursor.com>
Reconcile dry_run with push_attempts helpers and cover dry_run in integration tests. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
dry_runboolean input (defaultfalse) so workflows can validate configuration and preview what the action would do without mutating the repogit add --dry-run/git rm --dry-run; commit, tag, push, pull, fetch, checkout, and identity config are logged onlycommitted/pushed/tagged/tag_pushedremainfalse)Closes #511
Test plan
dry_run: trueon a dirty working tree and confirm logs show “Would …” steps with no commit/pushdry_run: trueon a clean tree and confirm “nothing would be committed”dry_run: false(or omitted) and confirm normal add/commit/push still worksnpm test+ lib integrity) passesMade with Cursor
Summary by CodeRabbit
New Features
Documentation