Skip to content

chore: sync dev with main - #39

Merged
vig-os-release-app[bot] merged 2 commits into
devfrom
chore/sync-main-to-dev-3-1
Jul 14, 2026
Merged

vig-os-release-app[bot] merged 2 commits into
devfrom
chore/sync-main-to-dev-3-1

Conversation

@vig-os-release-app

Copy link
Copy Markdown
Contributor

Syncs dev with main (sync-main-to-dev workflow).

c-vigo and others added 2 commits July 14, 2026 09:48
Wrap each Octokit REST call inside createTree, createTreeChained, and
createBlob in withRetry via an optional RetryOptions parameter, instead
of wrapping the whole multi-call createTree operation in commitViaAPI.

A transient mid-batch failure now retries only the failing call rather
than re-running the entire tree build and re-uploading already-succeeded
blobs and tree chunks, saving API budget and easing rate-limit pressure.

The new RetryOptions parameter is optional and defaults to no retries,
keeping the public signatures of createBlob and createTree backward
compatible.

Refs: #24
## Summary

Retries are now applied at **individual Octokit REST call sites** inside
`createTree` / `createTreeChained` / `createBlob`, replacing the coarse
`withRetry` wrap around the *entire* `createTree` in `commitViaAPI`. A
transient mid-batch failure now retries only the failing call instead of
re-running the whole multi-call operation and re-uploading
already-created blobs/trees.

Closes #24.

## How
- New exported `RetryOptions { config: RetryConfig; logger? }` + private
`callWithRetry(fn, retry?)` helper — calls `fn()` once when `retry` is
undefined, else `withRetry(fn, config, logger)`.
- `retry?: RetryOptions` threaded (optional, defaults to **no retries**
→ backward-compatible signatures) through `createBlob`,
`createTreeChained`, `createTree`.
- `commitViaAPI` drops the `withRetry(() => createTree(...))` wrap and
passes `{ config: retryConfig, logger: log }` into `createTree`. The
other single-call coarse wraps
(getCommit/getBranchInfo/createCommit/updateBranch) are unchanged
(already one call each).

## Tests (both fail against the old coarse wrap)
1. **Chunked tree retry**: 101 files → 2 chunks; chunk-2 fails 503 once
then succeeds → `createTree` called exactly 3× (not 4), retried call
still carries `base_tree = tree-chunk-1` (chunk-1 not re-uploaded).
2. **Blob retry**: blob-2 fails 503 once → `createBlob` called 3×
(blob-1 once), single `createTree` carries both resolved SHAs.

## Verification
- `npm run build` (tsc), `npm run bundle` (ncc, `dist/` committed): ok
- `npm test`: **82 passed** (3 suites)
- Pre-commit suite green (devkit dev-shell)

## Reviewer note
Overlaps **PR for #22** (payload-size chunking) on the same
`createTree`/`createTreeChained` path — recommend merging this first,
then rebasing #22 to re-thread `retry` through any new chunking helper.

Refs: #24
@vig-os-release-app
vig-os-release-app Bot merged commit 5ba8436 into dev Jul 14, 2026
8 checks passed
@vig-os-release-app
vig-os-release-app Bot deleted the chore/sync-main-to-dev-3-1 branch July 14, 2026 08:23
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