Skip to content

fix(extension): stop deleting unrelated zip files from the working directory#1250

Merged
Soner (shyim) merged 1 commit into
mainfrom
fix/extension-zip-unrelated-file-deletion
Jul 24, 2026
Merged

fix(extension): stop deleting unrelated zip files from the working directory#1250
Soner (shyim) merged 1 commit into
mainfrom
fix/extension-zip-unrelated-file-deletion

Conversation

@moshimorschi

Copy link
Copy Markdown
Contributor

What changed?

Removed the "Clear previous zips" block from extension zip. It globbed <Name>-*.zip in the process working directory and deleted every match before packing, ignoring --filename and --output-directory. No replacement is needed: the resolved output file is still overwritten on rebuild because the zip writer truncates it on create.

Before: running extension zip --output-directory dist --filename custom-name.zip <path> from a directory containing FroshTest-backup-2024.zip silently deleted that file.
After: user files in the working directory are never removed; only the resolved output file is written.

Why?

Any user file matching the pattern (backups, old release artifacts) was destroyed without a prompt or log line, even when the new zip was written to a completely different location. See #1225 for the full analysis.

How was this tested?

  • New regression test TestZipDoesNotDeleteUnrelatedZipsInWorkingDirectory runs the command end-to-end with decoy files in the working directory. It fails on the previous code (both decoys deleted) and passes with the fix.
  • Full go test ./... passes.
  • Manual check that repeated builds still replace their own artifact in place.

Related issue or discussion

Fixes #1225

…rectory

extension zip globbed <Name>-*.zip in the process working directory and
removed every match before packing, regardless of --filename and
--output-directory. Any user file matching the pattern (backups, old
release artifacts) was silently destroyed. The cleanup is removed
entirely: the resolved output file is still replaced on rebuild because
the zip writer truncates it on create. Adds a regression test running
the command end-to-end with decoy files in the working directory.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 53.65%. Comparing base (3eaa8af) to head (10fb32c).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1250      +/-   ##
==========================================
+ Coverage   53.46%   53.65%   +0.18%     
==========================================
  Files         303      303              
  Lines       23322    23325       +3     
==========================================
+ Hits        12470    12515      +45     
+ Misses      10848    10783      -65     
- Partials        4       27      +23     
Flag Coverage Δ
go-test 53.65% <ø> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@shyim
Soner (shyim) merged commit 3340b47 into main Jul 24, 2026
3 checks passed
@shyim
Soner (shyim) deleted the fix/extension-zip-unrelated-file-deletion branch July 24, 2026 11:34
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.

extension zip silently deletes unrelated <Name>-*.zip files from the current working directory

4 participants