Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Description
Add optional, bounded retries around GitHub REST calls used to resolve and update refs (and other operations prone to flakes), so consumers do not need workflow-level workarounds. Default behavior must remain a single attempt (no retries unless configured).
Problem Statement
Downstream workflows (e.g. smoke-test deploy) sometimes fail inside this action with transient GitHub API errors such as 404 on get a reference shortly after the branch ref was created or updated. A later run with the same inputs often succeeds. Callers today must duplicate retry/re-mint logic in YAML or re-run entire jobs.
Proposed Solution
- Introduce a single, explicit configuration for how many times the action may attempt the ref/git API sequence (name TBD, e.g.
MAX_ATTEMPTSorAPI_RETRY_ATTEMPTS), with default1= current behavior (one try, no retry loop). - When
> 1, retry only on a narrow, documented set of transient conditions (e.g. HTTP 404 on ref get shortly after create, 5xx, rate limit / secondary rate limit responses), with bounded backoff and a hard cap on attempts. - Surface clear logs: attempt number, error classification, backoff delay.
- Document semantics in the action README (what counts as an attempt, which errors retry, compatibility).
Alternatives Considered
- Retry only in consumer workflows — works but duplicates YAML, cannot centralize classification/backoff, and mixes concerns with token minting (only workflows can re-mint app tokens).
- Unbounded or implicit retries — rejected; must stay bounded and opt-in beyond default single attempt.
Additional Context
- Motivated by intermittent deploy failures discussed in downstream issue: [BUG] Intermittent repository_dispatch deploy failure in commit-action (Git refs 404) devkit#354
- Related: Optimize createTree to reduce GitHub REST API usage #19 (rate limits / API volume); retry logic must avoid multiplying worst-case call volume without tight bounds and conservative backoff.
Impact
- Beneficiaries: All workflows using
vig-os/commit-action(release automation, smoke-test deploy, etc.). - Compatibility: Backward compatible if default remains one attempt.
- Not a breaking change if defaults preserve current behavior.
Changelog category: Added (user-visible behavior when opt-in retries are enabled)
- TDD compliance (see
.cursor/rules/tdd.mdcin consuming repos; add/adapt tests in this repo as appropriate)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
feat: bounded retry for transient API failures
docs(changelog): document retry feature and review follow-ups
docs(changelog): document retry feature and review follow-ups
docs(changelog): document retry feature and review follow-ups
release: Release 0.2.0