[8.17] (backport #18091) Preserve mtime explicitly when creating tar artifacts#18108
Merged
[8.17] (backport #18091) Preserve mtime explicitly when creating tar artifacts#18108
Conversation
* Preserve mtime explicitly when creating tar artifacts When building tar archives, explicitly set mtime. This avoids losing that information in the minitar `Writer.add_file_simple` method https://github.com/halostatue/minitar/blob/a531136b17b9efdddf0a0f39537845b454c2371e/lib/minitar/writer.rb#L139 * Better default for mtime If for some reason we cant get a time from a File object (very unlikely) a better default is Time.now rather than 0. * Update rakelib/artifacts.rake Co-authored-by: João Duarte <jsvd@users.noreply.github.com> --------- Co-authored-by: João Duarte <jsvd@users.noreply.github.com> (cherry picked from commit d9b95bf) # Conflicts: # rakelib/artifacts.rake
Contributor
Author
|
Cherry-pick of d9b95bf has failed: To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally |
5 tasks
* Ensure any file object in a tar archive has an mtime Following up on #18091, when minitar writes a directory or symlink it also needs explicit mtime. After inspecting artifacts built from #18019 we see some other missing mtimes. This commit ensures that information is explicitly passed to the minitar writer. * Update rakelib/artifacts.rake Co-authored-by: João Duarte <jsvd@users.noreply.github.com> --------- Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
|
💚 Build Succeeded
History
cc @donoghuc |
donoghuc
approved these changes
Sep 4, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.





Release notes
Improvement to logstash release artifacts file metadata: mtime is preserved when buiilding tar archives
What does this PR do?
When building tar archives, explicitly set mtime. This avoids losing that information in the minitar
Writer.add_file_simplemethodhttps://github.com/halostatue/minitar/blob/a531136b17b9efdddf0a0f39537845b454c2371e/lib/minitar/writer.rb#L139
Why is it important/What is the impact to the user?
Files containing mtime 0 lead to undesireable behavior in some use cases #17925 and do not show any clues to modification time. Avoiding setting mtime to 0 in many cases will help provide artifacts with the least amount of surprise to users.
Checklist
Related issues
This is an automatic backport of pull request #18091 done by [Mergify](https://mergify.com).