You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: keep file modification times in tar archives - #149
zip.compressDir keeps the time. The tar headers (in lib/tar/stream.js and lib/tar/file_stream.js) are built with name, size and mode only, and tar-stream uses the current time when mtime is missing. Both now pass mtime: stat.mtime.
Added tests for compressDir and compressFile that read the header back with tar-stream; they fail without the change. npm run test:js passes apart from tgz.uncompress(sourceFile, destDir), which fails the same way without the change here.
Summary by CodeRabbit
Bug Fixes
TAR archives now preserve source files’ modification times for both file and directory compression.
No actionable comments were generated in the recent review.
Walkthrough
TAR entries created from files now include the source file’s modification time. Tests check the time for file and directory compression.
Changes: TAR modification time
Layer / File(s)
Summary
Propagate and verify modification time lib/tar/file_stream.js, lib/tar/stream.js, test/tar/index.test.js
Both TAR entry creation paths include the source file’s modification time. Tests verify that file and directory compression preserve the time in TAR headers.
Tar archives now keep the source files' modification times instead of the compression time. The change is small and covered by tests, so merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix: keep file modification times in tar archives" matches the main change. The summary says both lib/tar/stream.js and lib/tar/file_stream.js now pass stat.mtime into tar entry metadata, a…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix: keep file modification times in tar archives" matches the main change. The summary says both lib/tar/stream.js and lib/tar/file_stream.js now pass stat.mtime into tar entry metadata, and tests verify that the extracted entries keep the set modification time. The title is concise, specific, and free of noise.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
lib/tar/file_stream.js
ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.
lib/tar/stream.js
ESLint skipped: the matched ESLint configuration already failed (missing-dependency).
test/tar/index.test.js
ESLint skipped: the matched ESLint configuration already failed (missing-dependency).
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: b0ea23d4-da9c-4ef0-a175-c565fe4d8849
Commits
Reviewing files that changed from the base of the PR and between 806be7f and dff7132.
Files selected for processing: 3
lib/tar/file_stream.js
lib/tar/stream.js
test/tar/index.test.js
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
tar.compressDir,tar.compressFileand their tgz versions write every file with the time of the run instead of its modification time:zip.compressDirkeeps the time. The tar headers (inlib/tar/stream.jsandlib/tar/file_stream.js) are built with name, size and mode only, and tar-stream uses the current time whenmtimeis missing. Both now passmtime: stat.mtime.Added tests for
compressDirandcompressFilethat read the header back with tar-stream; they fail without the change.npm run test:jspasses apart fromtgz.uncompress(sourceFile, destDir), which fails the same way without the change here.Summary by CodeRabbit