Preserve mtime explicitly when creating tar artifacts#18091
Merged
donoghuc merged 3 commits intoelastic:mainfrom Sep 3, 2025
Merged
Preserve mtime explicitly when creating tar artifacts#18091donoghuc merged 3 commits intoelastic:mainfrom
donoghuc merged 3 commits intoelastic:mainfrom
Conversation
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
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Contributor
|
This pull request does not have a backport label. Could you fix it @donoghuc? 🙏
|
donoghuc
commented
Sep 2, 2025
If for some reason we cant get a time from a File object (very unlikely) a better default is Time.now rather than 0.
jsvd
approved these changes
Sep 3, 2025
Member
jsvd
left a comment
There was a problem hiding this comment.
minor tweak to the operator logic, otherwise LGTM
Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
|
💛 Build succeeded, but was flaky
Failed CI StepsHistory
|
Contributor
|
@Mergifyio backport 8.17 8.18 8.19 9.0 9.1 |
Contributor
✅ Backports have been createdDetails
|
mergify bot
pushed a commit
that referenced
this pull request
Sep 3, 2025
* 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
5 tasks
mergify bot
pushed a commit
that referenced
this pull request
Sep 3, 2025
* 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
5 tasks
mergify bot
pushed a commit
that referenced
this pull request
Sep 3, 2025
* 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)
5 tasks
mergify bot
pushed a commit
that referenced
this pull request
Sep 3, 2025
* 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
5 tasks
mergify bot
pushed a commit
that referenced
this pull request
Sep 3, 2025
* 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
5 tasks
donoghuc
added a commit
to donoghuc/logstash
that referenced
this pull request
Sep 3, 2025
Following up on elastic#18091, when minitar writes a directory or symlink it also needs explicit mtime. After inspecting artifacts built from elastic#18019 we see some other missing mtimes. This commit ensures that information is explicitly passed to the minitar writer.
Member
Author
|
Built a snapshot and realized that there are a couple more methods we will want to preserve mtime. Filed #18113 |
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
* 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>
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
* 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>
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
* 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>
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
* 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>
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
* 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>
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
* 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>
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
…artifacts (#18108) * Preserve mtime explicitly when creating tar artifacts (#18091) * 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 * Ensure any file object in a tar archive has an mtime (#18113) * 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> * fix merge conflicts --------- Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com> Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
…artifacts (#18109) * Preserve mtime explicitly when creating tar artifacts (#18091) * 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 * Ensure any file object in a tar archive has an mtime (#18113) * 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> * fix merge conflicts --------- Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com> Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
…rtifacts (#18111) * Preserve mtime explicitly when creating tar artifacts (#18091) * 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 * Ensure any file object in a tar archive has an mtime (#18113) * 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> * fix merge conflicts --------- Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com> Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
…rtifacts (#18112) * Preserve mtime explicitly when creating tar artifacts (#18091) * 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 * Ensure any file object in a tar archive has an mtime (#18113) * 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> * fix merge conflicts --------- Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com> Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
donoghuc
added a commit
that referenced
this pull request
Sep 4, 2025
…artifacts (#18110) * Preserve mtime explicitly when creating tar artifacts (#18091) * 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) * Ensure any file object in a tar archive has an mtime (#18113) * 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> --------- Co-authored-by: Cas Donoghue <cas.donoghue@gmail.com> Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
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