Skip to content

Conversation

@alexskr
Copy link
Member

@alexskr alexskr commented Aug 19, 2025

- Switch from shelling out to `file --mime` to checking magic bytes
  (PK for ZIP, 1F 8B for GZIP). Improves portability and removes
  external dependency.
- Add `safe_join` guard to block path traversal.
- Normalize gzip names via `resolve_gzip_name` (strip control chars,
  collapse to basename, ensure non-empty).
- Explicitly exclude .tar.gz and .tgz files (not supported yet).
- align with RubyZip v3+ semantics:
    - enforce explicit destination_directory (no implicit cwd writes),
    - block path traversal (`../` entries skipped).
- use streaming writes (`IO.copy_stream`) to reduce memory usage.
- Rename `files_from_zip` to `filenames_in_archive` for clarity
  (returns entry names, not extracted files
- add rubyzip gem as dependency to gemspec
- pin thin gem to v1 for compatibility reasons
 Refactor: improve archive handling in LinkedData::Utils::FileHelpers
@alexskr alexskr marked this pull request as ready for review August 19, 2025 22:47
@codecov
Copy link

codecov bot commented Aug 19, 2025

Codecov Report

❌ Patch coverage is 89.61039% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.23%. Comparing base (2f22b1b) to head (573a5b0).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
lib/ontologies_linked_data/utils/file.rb 89.33% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #257      +/-   ##
==========================================
+ Coverage   80.21%   80.23%   +0.01%     
==========================================
  Files          84       84              
  Lines        5843     5874      +31     
==========================================
+ Hits         4687     4713      +26     
- Misses       1156     1161       +5     
Flag Coverage Δ
unittests 80.23% <89.61%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@alexskr alexskr merged commit 5a4f4d3 into master Aug 19, 2025
6 checks passed
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.

2 participants