Skip to content

fix(assemble): cleanup temporary directory on error - #5407

Merged
brandtkeller merged 1 commit into
mainfrom
hotfix_orphaned_tempdir
Sep 28, 2026
Merged

brandtkeller merged 1 commit into
mainfrom
hotfix_orphaned_tempdir

Conversation

@brandtkeller

Copy link
Copy Markdown
Member

Description

This change adds cleaning up the temporary directory during assembly, given an error, which previously would have orphaned the current state of the contents of that build directory.

Noticed this when toying with the implications of errors on actions. A successful AssemblePackage caller owns pkgLayout and must call Cleanup() after final use. Failed AssemblePackage calls return no usable layout, so AssemblePackage itself must remove buildPath.

Related Issue

No associated issue.

Checklist before merging

Signed-off-by: Brandt Keller <brandt.keller@defenseunicorns.com>
@brandtkeller brandtkeller self-assigned this Sep 28, 2026
@brandtkeller
brandtkeller requested review from a team as code owners September 28, 2026 20:17
@netlify

netlify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

βœ… Deploy Preview for zarf-docs canceled.

Name Link
πŸ”¨ Latest commit 9b6c9f1
πŸ” Latest deploy log https://app.netlify.com/projects/zarf-docs/deploys/6abacb59e414e20008b57e2e

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

βœ… All modified and coverable lines are covered by tests.

Files with missing lines Coverage Ξ”
src/pkg/packager/assemble/assemble.go 51.76% <100.00%> (+0.22%) ⬆️

... and 2 files with indirect coverage changes

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@brandtkeller
brandtkeller added this pull request to the merge queue Sep 28, 2026
Merged via the queue into main with commit d07690e Sep 28, 2026
31 checks passed
@brandtkeller
brandtkeller deleted the hotfix_orphaned_tempdir branch September 28, 2026 21:47
sei-pearl pushed a commit to sei-pearl/zarf that referenced this pull request Oct 1, 2026
Signed-off-by: Brandt Keller <brandt.keller@defenseunicorns.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants