Skip to content

feat: add push_attempts to retry failed pushes - #764

Merged
EndBug merged 1 commit into
mainfrom
cursor/b3e41d10
Aug 9, 2026
Merged

feat: add push_attempts to retry failed pushes#764
EndBug merged 1 commit into
mainfrom
cursor/b3e41d10

Conversation

@EndBug

@EndBug EndBug commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a push_attempts input (default 1) so the action can retry a failed push
  • When pull is set, re-pulls between attempts and refreshes commit SHA outputs after rebase
  • Documents the concurrent/matrix use case and validates the new input

Closes #321

Test plan

  • npm test (includes parsePushAttempts unit tests + lint)
  • npm run build (committed lib/ matches source)
  • Manual: two concurrent jobs with pull: --rebase --autostash and push_attempts: 3 both commit successfully

Made with Cursor

Summary by CodeRabbit

  • New Features
    • Added the push_attempts option to configure how many times pushing is attempted.
    • Failed pushes can optionally pull the latest changes before retrying.
    • Commit information is refreshed between retry attempts when applicable.
    • Invalid, zero, negative, decimal, or unsupported values are rejected.
  • Documentation
    • Added configuration guidance, default behavior, retry details, and an example for concurrent jobs.
  • Bug Fixes
    • Added warnings when multiple push attempts are configured without pull support.

Allow concurrent workflows to recover from push races by re-pulling between attempts when pull is configured.

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

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c5516447-b4d6-402b-9305-446575a797c0

📥 Commits

Reviewing files that changed from the base of the PR and between 645ecc0 and 1c01fa3.

📒 Files selected for processing (6)
  • README.md
  • action.yml
  • lib/index.js
  • src/io.ts
  • src/main.ts
  • test/io.test.ts

📝 Walkthrough

Walkthrough

The action adds a validated push_attempts input. Push failures can trigger configured retries, optional pulls, commit SHA refreshes, and centralized push handling. Documentation and parser tests cover the new input.

Changes

Push retry workflow

Layer / File(s) Summary
Retry input contract
action.yml, src/io.ts, README.md, test/io.test.ts
The action defines push_attempts with a default of 1. Input validation accepts positive decimal integers and rejects invalid values. Documentation and tests cover the input.
Pull and restage support
src/main.ts
pullFromRemote centralizes fetching, pulling, conflict detection, and optional restaging.
Retry push execution
src/main.ts
Pushes use the configured attempt count. Failed attempts can pull before retrying. Rebased commits refresh SHA outputs, and pushCommit centralizes push operations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubAction
  participant checkInputs
  participant main
  participant pullFromRemote
  participant pushCommit
  participant GitRemote

  GitHubAction->>checkInputs: provide push_attempts
  checkInputs-->>main: parsed attempt count

  loop Configured attempts
    main->>pushCommit: push commit
    pushCommit->>GitRemote: push branch
    GitRemote-->>pushCommit: success or failure
    alt Failure with attempts remaining and pull configured
      main->>pullFromRemote: pull before retry
      pullFromRemote->>GitRemote: fetch and pull
      pullFromRemote-->>main: updated commit state
    end
  end
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: adding configurable retry attempts for failed pushes.
Linked Issues check ✅ Passed The changes implement retry support for concurrent push races with configured pull and rebase behavior described in issue #321.
Out of Scope Changes check ✅ Passed The code, input declaration, documentation, and tests directly support the retry feature and linked issue #321.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/b3e41d10

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EndBug
EndBug marked this pull request as ready for review August 9, 2026 18:30
@EndBug
EndBug merged commit df70d11 into main Aug 9, 2026
11 checks passed
@EndBug
EndBug deleted the cursor/b3e41d10 branch August 9, 2026 18:33
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.

Feature requestion: add "retry" option

1 participant