← Back to issue list

fix: add retry logic for snap installs across CI workflows

View original Github issue

Metadata

Project
starflow
Number
#186
Type
pull request
State
open
Author
lengau
Labels
—
Created
Updated
Closed
—

Current evaluation

Maintainer-authored CI-only PR adding retry/backoff around snap installs (astral-uv, osv-scanner, codespell, ruff, shellcheck) in lint-python/scan-python/scan-golang, plus actionlint/prettier/shellcheck fixes. All checks green except macos-14.

Suggested action: needs review

Reason: All 22 relevant checks pass (lint-python, python/golang OSV-scanner, zizmor, actionlint, prettier, files, contributors, CLA) and there are zero review comments or unresolved feedback on this maintainer-authored PR; the single failure, 'Default inputs (macos-14)', is an unrelated deprecated-runner issue already fixed by merged starflow#187 ('chore: replace deprecated macos-14 runner with macos-26'). Diff is +100/-40 across CI YAML and a shellcheck helper script only, so it is low-risk but still needs a maintainer to review the inline retry functions and the newly broadened skip logic in .github/shellcheck-actions.sh, which could mask real shellcheck findings. Confidence is moderate rather than high because the underlying diff files could not be inspected directly (repo tool calls returned 'no pinned SHA'), so the exact retry implementation and the macos-14 failure cause are inferred from the PR body and CI metadata.

Evaluated by: mr-cal-bot

Impact: 42 Quick Win: 21 Complexity: 33 Confidence: 78 Actionability: 76

Issue body

## Summary Add resilient retry logic with exponential backoff to handle transient snap store errors during the scan-python workflow and related workflows. This addresses intermittent 502 errors that cause job failures when downloading snap packages like `astral-uv`, `osv-scanner`, `codespell`, `ruff`, and `shellcheck`. ## Changes - **`lint-python.yaml`** (uses apt-get): - Install `retry` package at the start of the job - Wrap all snap install commands with `retry` command - Applies to: `codespell`, `ruff`, `shellcheck` - Fix line-length violations (Prettier print-width: 99) - Fix shellcheck SC2086: unquoted variables - **`scan-golang.yaml`** (no apt): - Add inline `retry()` function with exponential backoff - Function retries up to 5 times with delays: 2s, 4s, 8s, 16s, 32s - Applied to: `osv-scanner` - Fix line-length violations in input descriptions - **`scan-python.yaml`** (no apt): - Keep existing inline retry function - Applied to: `astral-uv`, `osv-scanner` - Fix shellcheck SC2086: unquoted variables - Add newline at end of file - **`setup-python-runner/action.yaml`**: - Fix line-length violation by breaking long cache-hash calculation line - Remove `type` fields from composite action inputs (actionlint requirement) - Fix comments indentation and formatting - Fix Homebrew `uses` line-length with multiline string - **`.github/shellcheck-actions.sh`**: - Update script to skip files containing GitHub Actions expressions (`${{ toJSON(matrix['platform']) }}`) - Prevents false-positive shellcheck warnings (SC2086, SC1083, SC1012) - **`.github/workflows/self-test-setup.yaml`**: - Update ubuntu version from 26.04 to 24.04 - Remove deprecated macos-15-large matrix entry - Clear logging shows which attempt is failing - Final failure is logged with attempt count ## Implementation Strategy - **apt-based workflows**: Use the `retry` package (installed via apt-get) for simplicity and consistency with other apt operations - **non-apt workflows**: Use inline bash `retry()` function to avoid package installation overhead ## Testing The retry logic mimics common patterns used in GitHub Actions workflows for handling transient API/service failures. It will automatically recover from temporary snap store issues without manual intervention. ## Related Issues Fixes transient failures observed in: - [craft-parts PR #1728](https://github.com/canonical/craft-parts/actions/runs/35743271767/job/106798234329?pr=1728) ## Copilot Issues (Resolved) - ✅ Line-length violations in workflow files - ✅ Shellcheck SC2086 unquoted variables in workflow files - ✅ Shellcheck handling of GitHub Actions expressions - ✅ Actionlint issues with `type` fields in composite action - ✅ Line-length violation in Homebrew `uses` field

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 42
Quick Win: 21
Complexity: 33
Confidence: 78
Actionability: 76
needs review Maintainer-authored CI-only PR adding retry/backoff around snap installs (astral-uv, osv-scanner, codespell, ruff, shellcheck) in lint-python/scan-python/scan-golang, plus actionlint/prettier/shellcheck fixes. All checks green except macos-14.
stealth/space-bunny-alpha
Impact: 40
Quick Win: 15
Complexity: 42
Confidence: 58
Actionability: 65
needs review Adds retry-with-backoff for snap installs in lint-python/scan-python/scan-golang workflows, plus actionlint/prettier/shellcheck lint fixes in the shellcheck script and setup-python-runner action. Maintainer-authored, all checks green except macos-14, awaiting review.
stealth/space-bunny-alpha
Impact: 38
Quick Win: 12
Complexity: 32
Confidence: 84
Actionability: 45
needs review Adds exponential-backoff retries for snap installs in Python/Go lint and scan workflows, plus lint cleanup and runner matrix changes. Relevant scans pass, but 16 integration jobs fail and 3 checks remain pending.
qwen/qwen3.6-35b-a3b
Impact: 35
Quick Win: 20
Complexity: 10
Confidence: 75
Actionability: 65
needs review Adds retry logic with exponential backoff to snap install commands in scan-python workflow to handle transient 502 errors from the snap store. CI passing, awaiting review with 2 unresolved comments.

Update history

Date Change
updated
updated
updated
updated
updated
updated
created

Related work

  • Likely Fixed By: starflow#187 (confidence 82%)

    Merged PR replacing the deprecated macos-14 runner with macos-26 in self-test-setup, the same matrix job that is the only red check on this PR.

  • Related To: canonical/craft-parts#1728 (confidence 55%)

    PR body cites this craft-parts run as the source of the transient snap-store 502 failures motivating the retry logic.

Related issues

No related issues found above the similarity threshold.