Skip to content

fix: validate source files exist before applying patch#101

Open
rosygmiki wants to merge 4 commits into
containers:mainfrom
rosygmiki:windows-system-test
Open

fix: validate source files exist before applying patch#101
rosygmiki wants to merge 4 commits into
containers:mainfrom
rosygmiki:windows-system-test

Conversation

@rosygmiki

@rosygmiki rosygmiki commented May 27, 2026

Copy link
Copy Markdown
Collaborator

This PR fixes an issue where Windows builds would fail or produce unexpected/partial output when source files were missing. It also cleans up our CI workflow by removing unsupported platforms.

Fixes
Adds a validation function to pkg/tar-patch/apply.go to verify delta files against the source directory before applying the delta patch. This prevents unexpected or partial output.

Chores

  • Removes CI workflow support for macOS on Intel and Windows on ARM.
  • Updates go.mod and Readme badge with Go 1.26.

Closes #84

Signed-off-by: Rosy-Glorious Miki <rmiki@redhat.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a bug in pkg/tar-patch/apply.go where an error encountered while closing the current file was being ignored and nil was returned instead of the actual error. The code has been corrected to return the err. There are no review comments to address.

@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.54902% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.35%. Comparing base (e78a156) to head (486c456).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
pkg/tar-patch/apply.go 72.54% 8 Missing and 6 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #101      +/-   ##
==========================================
- Coverage   79.19%   78.35%   -0.85%     
==========================================
  Files          10       10              
  Lines        1115     1164      +49     
==========================================
+ Hits          883      912      +29     
- Misses        134      145      +11     
- Partials       98      107       +9     

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

…ion for broader compatibility

Signed-off-by: Rosy-Glorious Miki <rmiki@redhat.com>
@rosygmiki rosygmiki changed the title fix: returns error when closing call fails - resolves potential bug fix: validate source files exist before applying patch Jun 2, 2026
@rosygmiki rosygmiki force-pushed the windows-system-test branch 3 times, most recently from 39984c8 to b3fbf61 Compare June 3, 2026 19:53
…tching the delta

Signed-off-by: Rosy-Glorious Miki <rmiki@redhat.com>
@rosygmiki rosygmiki force-pushed the windows-system-test branch from b3fbf61 to 27f0279 Compare June 3, 2026 20:14
- Replace os.IsNotExist() with errors.Is(err, os.ErrNotExist) for proper
  error unwrapping on both Linux and Windows
- Ensures "The system cannot find the file specified" on Windows is
  correctly detected as file-not-found error
- Update test to strictly require failure when source file is missing

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

System tests for Window compatibility

1 participant