Repository navigation
fix: harden network retries in CI and release workflows - #359
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a bounded retry CLI in vig-utils and updates CI/release/sync workflows (including workspace + smoke-test templates) to use it for network-sensitive operations, with additional idempotency guards around GitHub/Git operations to make reruns safer.
Changes:
- Added
vig-utilsretryCLI (with pytest coverage) and wired it as a console script. - Replaced ad-hoc shell retry loops with
uv run retry/retryacross CI, release, and sync workflows (plus templates). - Updated downstream templates and smoke-test dispatch flows to resolve container image tags from
.vig-osand harden API operations.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/vig-utils/src/vig_utils/retry.py | New Python retry CLI implementing bounded exponential backoff for command execution. |
| packages/vig-utils/tests/test_retry.py | Pytest coverage for retry behavior, parsing/validation, and module invocation. |
| packages/vig-utils/pyproject.toml | Registers retry as a vig-utils console script. |
| .github/actions/setup-env/action.yml | Wraps network curl calls (hadolint/taplo install) with uv run retry and adds taplo-version sanity check. |
| .github/actions/test-image/action.yml | Replaces manual pull retry loop with uv run retry for podman pull. |
| .github/workflows/ci.yml | Uses uv run retry for installing Safety to reduce transient failure flakiness. |
| .github/workflows/release.yml | Replaces multiple manual retry loops with uv run retry and adds some idempotency guards for tag/release/dispatch steps. |
| .github/workflows/prepare-release.yml | Wraps gh api calls with uv run retry to harden release preparation. |
| .github/workflows/sync-issues.yml | Adds uv run retry around cache deletion API calls. |
| .github/workflows/sync-main-to-dev.yml | Adds uv run retry around networked git fetch and gh API operations for the sync PR automation. |
| assets/workspace/.github/actions/resolve-image/action.yml | Makes image resolution strict: requires .vig-os or explicit override (no silent latest). |
| assets/workspace/.github/workflows/release-core.yml | Adds image-tag resolution job and uses retry inside containerized jobs (plus retries around network checks). |
| assets/workspace/.github/workflows/release-publish.yml | Adds image-tag resolution job; uses containerized execution and adds retry/idempotency around tagging and release creation. |
| assets/workspace/.github/workflows/release.yml | Runs rollback job inside the resolved devcontainer image and uses retry for network-sensitive rollback ops. |
| assets/workspace/.github/workflows/prepare-release.yml | Wraps GitHub API calls with retry and adds idempotency guards for branch/PR creation. |
| assets/workspace/.github/workflows/sync-issues.yml | Adds uv run retry around cache deletion API calls in the workspace template. |
| assets/workspace/.github/workflows/sync-main-to-dev.yml | Adds uv run retry around fetch/API operations in the workspace template sync workflow. |
| assets/smoke-test/.github/workflows/repository-dispatch.yml | Adds image-tag resolution from .vig-os, runs jobs in the resolved devcontainer image, and applies retry to network/API operations. |
| CHANGELOG.md | Adds the #357 “bounded retry” entry to Unreleased. |
| assets/workspace/.devcontainer/CHANGELOG.md | Syncs the same changelog entry into the workspace devcontainer changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR introduces a Python-based bounded retry CLI in vig-utils and updates CI/release automation (including workspace templates and smoke-test dispatch) to use it for network-sensitive operations while adding idempotency guards for retried GitHub/Git operations.
Changes:
- Added
vig-utilsretryCLI (bounded exponential backoff) plus pytest coverage. - Replaced several workflow shell retry loops with
uv run retry ...(bare runners) orretry ...(containerized jobs), and added rerun-safe idempotency checks for branch/PR/tag/release creation. - Synced the same retry/idempotency patterns into workspace workflow templates and updated image-tag resolution behavior.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/vig-utils/src/vig_utils/retry.py | Implements the retry CLI and core retry loop with bounded exponential backoff. |
| packages/vig-utils/tests/test_retry.py | Adds unit tests for retry behavior, backoff capping, and CLI validation. |
| packages/vig-utils/pyproject.toml | Registers retry as a console script entrypoint. |
| .github/actions/setup-env/action.yml | Wraps network curl calls with uv run retry during tool installation. |
| .github/actions/test-image/action.yml | Replaces podman pull retry loop with uv run retry. |
| .github/workflows/ci.yml | Uses uv run retry around uv pip install for network resilience. |
| .github/workflows/prepare-release.yml | Wraps gh api/PR creation paths with uv run retry. |
| .github/workflows/release.yml | Replaces ad-hoc retries with uv run retry and adds idempotency checks for tag/release operations. |
| .github/workflows/sync-issues.yml | Adds a resolve-image job and runs sync work in the devcontainer image, using retry. |
| .github/workflows/sync-main-to-dev.yml | Adds a resolve-image job and runs merge automation in the devcontainer image, using retry. |
| assets/workspace/.github/actions/resolve-image/action.yml | Changes workspace image-tag resolution to fail fast if .vig-os/override is missing. |
| assets/workspace/.github/workflows/release-core.yml | Adds resolve-image job and switches validation to run in the resolved devcontainer image; adds retries for network calls. |
| assets/workspace/.github/workflows/release-publish.yml | Adds resolve-image job, runs publish steps in container, and adds idempotent tag/release creation with retry. |
| assets/workspace/.github/workflows/release.yml | Runs rollback job in container and wraps network git/gh operations with retry. |
| assets/workspace/.github/workflows/prepare-release.yml | Wraps gh api calls with retry and adds idempotent branch/PR creation behavior. |
| assets/workspace/.github/workflows/sync-issues.yml | Adds resolve-image job, runs containerized, and wraps gh api calls with retry. |
| assets/workspace/.github/workflows/sync-main-to-dev.yml | Adds resolve-image job, runs containerized, and wraps git/gh operations with retry + rerun-safety. |
| assets/smoke-test/.github/workflows/repository-dispatch.yml | Adds resolve-image job, runs in container, and wraps gh/curl operations with retry + rerun-safety. |
| CHANGELOG.md | Adds the #357 “bounded retry” changelog entry. |
| assets/workspace/.devcontainer/CHANGELOG.md | Syncs the same #357 changelog entry into the workspace devcontainer changelog. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR hardens CI/release automation against transient network/API failures by introducing a shared vig-utils retry CLI and wiring it into upstream workflows, workspace templates, and the smoke-test dispatch pipeline, while also making retried operations (branch/tag/release/PR creation) safer to rerun.
Changes:
- Added a new
vig_utils.retryCLI (bounded exponential backoff) plus pytest coverage. - Replaced ad-hoc shell retry loops with
uv run retry(host runners) orretry(containerized jobs) across CI/release/sync workflows. - Introduced
.vig-os-based image-tag resolution and synced the resolver pattern into downstream templates and smoke-test workflows.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/vig-utils/src/vig_utils/retry.py |
New bounded retry CLI implementation used by workflows. |
packages/vig-utils/tests/test_retry.py |
Pytest coverage for retry behavior, validation, and module invocation. |
packages/vig-utils/pyproject.toml |
Exposes retry as a console script entrypoint. |
.github/actions/resolve-image/action.yml |
New composite action to resolve/validate devcontainer image tag from .vig-os. |
.github/actions/setup-env/action.yml |
Wraps network-sensitive downloads (hadolint/taplo) with uv run retry. |
.github/actions/test-image/action.yml |
Uses uv run retry for network-sensitive podman pull. |
.github/workflows/ci.yml |
Uses uv run retry for network-sensitive installs (e.g., safety). |
.github/workflows/release.yml |
Replaces custom retry loops with uv run retry and adds idempotency guards for tag/release creation. |
.github/workflows/prepare-release.yml |
Wraps gh api calls in uv run retry and adds safe rerun behavior for branch/PR creation. |
.github/workflows/sync-issues.yml |
Runs job in resolved devcontainer image and wraps API calls with retry. |
.github/workflows/sync-main-to-dev.yml |
Runs jobs in resolved devcontainer image and wraps network/API calls with retry plus idempotency guards. |
assets/workspace/.github/actions/resolve-image/action.yml |
Tightens template resolver to require .vig-os (no latest fallback). |
assets/workspace/.github/workflows/release-core.yml |
Adds resolve-image job; runs validate steps in the resolved devcontainer; wraps network calls with retry. |
assets/workspace/.github/workflows/release-publish.yml |
Adds resolve-image job; runs publish in container; hardens tag/release operations with retry + idempotency. |
assets/workspace/.github/workflows/release.yml |
Ensures rollback job runs in resolved container; wraps git/gh network calls with retry. |
assets/workspace/.github/workflows/prepare-release.yml |
Wraps gh api calls with retry and adds safe rerun behavior for branch/PR creation. |
assets/workspace/.github/workflows/sync-issues.yml |
Adds resolve-image job; runs sync job in container; wraps API calls with retry. |
assets/workspace/.github/workflows/sync-main-to-dev.yml |
Adds resolve-image job; runs jobs in container; wraps fetch/API calls with retry + idempotency. |
assets/smoke-test/.github/workflows/repository-dispatch.yml |
Adds image resolution and wraps curl/gh operations with retry and idempotency guards. |
assets/smoke-test/.vig-os |
Provides smoke-test template image tag source for resolution. |
.vig-os |
Adds repo-level image tag source for workflow container resolution. |
CHANGELOG.md |
Records the retry hardening change under Fixed. |
assets/workspace/.devcontainer/CHANGELOG.md |
Syncs the same changelog entry into the workspace template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| result = subprocess.run( | ||
| command, | ||
| stdin=sys.stdin, | ||
| stdout=sys.stdout, | ||
| stderr=sys.stderr, | ||
| check=False, | ||
| ) |
Catch OS-level subprocess launch errors so `retry` exits with stable shell-compatible codes instead of crashing with a traceback. Refs: #357
Description
This PR hardens network-sensitive release and CI paths by replacing shell retries with the
vig-utilsPythonretryCLI and making retry-safe workflow operations idempotent. It also syncs the same behavior into workspace templates and smoke-test dispatch logic to keep upstream and downstream workflows aligned.Type of Change
feat-- New featurefix-- Bug fixdocs-- Documentation onlychore-- Maintenance task (deps, config, etc.)refactor-- Code restructuring (no behavior change)test-- Adding or updating testsci-- CI/CD pipeline changesbuild-- Build system or dependency changesrevert-- Reverts a previous commitstyle-- Code style (formatting, whitespace)Modifiers
!) -- This change breaks backward compatibilityChanges Made
packages/vig-utils/src/vig_utils/retry.pypackages/vig-utils/tests/test_retry.py.github/actions/setup-env/action.yml,.github/actions/test-image/action.yml.github/workflows/release.yml,.github/workflows/prepare-release.yml,.github/workflows/ci.yml,.github/workflows/sync-issues.yml,.github/workflows/sync-main-to-dev.ymlassets/smoke-test/.github/workflows/repository-dispatch.ymlassets/workspace/.github/workflows/release-core.yml,assets/workspace/.github/workflows/release-publish.yml,assets/workspace/.github/workflows/release.yml,assets/workspace/.github/workflows/prepare-release.yml,assets/workspace/.github/workflows/sync-issues.yml,assets/workspace/.github/workflows/sync-main-to-dev.yml,assets/workspace/.github/actions/resolve-image/action.ymlCHANGELOG.md,assets/workspace/.devcontainer/CHANGELOG.md,packages/vig-utils/pyproject.tomlChangelog Entry
Fixed
retryCLI invig-utils(packages/vig-utils/src/vig_utils/retry.py)uv run retryaftersetup-envdependency syncretrydirectly in devcontainer jobs and removesourcelines.vig-osinstead of hardcodedlatestretry.shartifacts and BATS retry tests in favor ofvig-utilspytest coverageTesting
just test)Manual Testing Details
N/A
Checklist
docs/templates/, then runjust docs)CHANGELOG.mdin the[Unreleased]section (and pasted the entry above)Additional Notes
N/A
Refs: #357