Skip to content

fix: retry transient GitHub 5xx and skip failing items during sync - #97

Merged
c-vigo merged 1 commit into
devfrom
bugfix/96-sync-transient-5xx
Jun 10, 2026
Merged

c-vigo merged 1 commit into
devfrom
bugfix/96-sync-transient-5xx

Conversation

@c-vigo

@c-vigo c-vigo commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the daily-failing Sync Issues and PRs scheduled workflow (#96).

The action now:

  • Retries transient GitHub 5xx / rate-limit / network errors with exponential backoff (withRetry)
  • Sanitizes GitHub "Unicorn!" HTML error pages into concise messages
  • Skips individual issues/PRs that fail persistently instead of aborting the entire sync run

Root cause

The scheduled workflow was crashing mid-PR-sync when a single unguarded API call returned a transient 5xx (GitHub's "Unicorn!" HTML page). Example failing run: https://github.com/vig-os/sync-issues-action/actions/runs/27257549903

Changes

  • src/index.ts: add withRetry, formatGitHubError, isRetryableError; wrap pulls.list/pulls.get and issues.listForRepo/issues.get; route existing fetch helpers through retry
  • src/__tests__/unit/index.test.ts: tests for retry-success, skip-on-persistent-failure, and updated error-handling behavior
  • dist/: rebuilt bundle

Test plan

  • npm run lint
  • npm test (100 tests pass)

Release required to stop daily failures

The dogfooding workflow .github/workflows/sync-issues.yml pins the action by released SHA (@bad447d… # v0.2.2). A new release (e.g. v0.2.3) and pinned-SHA bump in that workflow is required before the scheduled runs will pick up this fix.

Closes #96

Add withRetry helper with exponential backoff for 5xx, rate-limit, and
network errors. Sanitize GitHub Unicorn HTML responses into concise
messages. Skip individual issues/PRs that fail persistently instead of
aborting the entire scheduled sync run.

Fixes #96
@c-vigo
c-vigo merged commit ff23093 into dev Jun 10, 2026
17 checks passed
@c-vigo
c-vigo deleted the bugfix/96-sync-transient-5xx branch June 10, 2026 09:12
c-vigo added a commit that referenced this pull request Jul 16, 2026
…ease (#114)

Unblocks the last red check on release PR #110 (Commit Messages), per
approved plan in #113.

The release-PR validation range `merge-base(main, head)..head` spans all
pre-devkit history since v0.2.2; commit `9574ee12` (PR #97, merged
2026-06-10 before the gate existed) lacks the mandatory `Refs:` line and
is immutable on `dev`. This patch advances `BASE_SHA` past that single
SHA behind a `git merge-base --is-ancestor` guard:

- **Release PR (#110)**: merge-base (Feb) is an ancestor of the waived
commit → base advances → the one grandfathered commit is skipped,
everything after it (June onward, incl. #112 and the freeze commit) is
still validated.
- **Dev PRs**: merge-bases are at dev's recent tip, not ancestors of the
waived commit → range unchanged.

Verified locally: `validate-commit-range` passes on the release span
with the advanced base; `actionlint` + full hook run green.
Self-healing: once 0.3.0 lands on `main`, merge-bases move past June,
and the next devkit `ci.yml` regeneration drops the patch (hand-patch
precedent: `codeql.yml`, vig-os/devkit#1142).

Refs: #113
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