Skip to content

fix: stage release downloads outside target folder so failures don't leave empty dirs#534

Merged
jaredfholgate merged 2 commits intomainfrom
fix/stage-downloads-outside-target
Apr 30, 2026
Merged

fix: stage release downloads outside target folder so failures don't leave empty dirs#534
jaredfholgate merged 2 commits intomainfrom
fix/stage-downloads-outside-target

Conversation

@jaredfholgate
Copy link
Copy Markdown
Member

Summary

If a bootstrap or starter release download/extract fails partway through, Get-GithubRelease previously left behind empty release/version folders inside the outputs directory. On a subsequent run, the folder existed (but was empty), which could confuse the Test-Path + content checks downstream.

Changes

  • src/ALZ/Private/Shared/Get-GithubRelease.ps1: download + extract now happen in a per-invocation guid folder under <outputs>/temp/downloads/<guid>. The release and per-version folders are only created after both the download and Expand-Archive succeed, immediately before copying content in. The staging folder is always cleaned up via finally.
  • src/ALZ/Public/Deploy-Accelerator.ps1: adds a configurable terraform_version parameter (default 1.14.9) instead of always pulling latest.

Behaviour

  • Successful run: identical to before, plus the staging folder is removed.
  • Failed download / failed extract: no release folder is created in the outputs directory; staging folder is cleaned up. Re-running will retry cleanly.

Get-GithubRelease now downloads and extracts release artifacts into a per-invocation guid folder under <outputs>/temp/downloads, and only creates the release/version target folders after the download and extract succeed. The staging folder is always cleaned up via finally, so a failed bootstrap or starter download no longer leaves empty release folders behind.

Also adds a configurable terraform_version parameter to Deploy-Accelerator (default 1.14.9) instead of always using latest.
jtracey93
jtracey93 previously approved these changes Apr 30, 2026
…version

The specific-version branch of Get-TerraformTool assigned the raw JSON string to $release instead of parsing it, causing the builds lookup to return an empty download URL.
@jaredfholgate jaredfholgate merged commit 7791a3f into main Apr 30, 2026
7 checks passed
@jaredfholgate jaredfholgate deleted the fix/stage-downloads-outside-target branch April 30, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Triage 🔍 Needs triaging by the team

Projects

Development

Successfully merging this pull request may close these issues.

2 participants