-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Preserve mtime explicitly when creating tar artifacts #18091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
This pull request does not have a backport label. Could you fix it @donoghuc? 🙏
|
If for some reason we cant get a time from a File object (very unlikely) a better default is Time.now rather than 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor tweak to the operator logic, otherwise LGTM
Co-authored-by: João Duarte <[email protected]>
|
💛 Build succeeded, but was flaky
Failed CI StepsHistory
|
@Mergifyio backport 8.17 8.18 8.19 9.0 9.1 |
✅ Backports have been created
|
* 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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> (cherry picked from commit d9b95bf) # Conflicts: # rakelib/artifacts.rake
* 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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> (cherry picked from commit d9b95bf) # Conflicts: # rakelib/artifacts.rake
* 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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> (cherry picked from commit d9b95bf)
* 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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> (cherry picked from commit d9b95bf) # Conflicts: # rakelib/artifacts.rake
* 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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> (cherry picked from commit d9b95bf) # Conflicts: # rakelib/artifacts.rake
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.
Built a snapshot and realized that there are a couple more methods we will want to preserve mtime. Filed #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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]>
* 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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]>
* 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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]>
* 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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]>
* 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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]>
* 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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]>
…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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> (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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> * fix merge conflicts --------- Co-authored-by: Cas Donoghue <[email protected]> Co-authored-by: João Duarte <[email protected]>
…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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> (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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> * fix merge conflicts --------- Co-authored-by: Cas Donoghue <[email protected]> Co-authored-by: João Duarte <[email protected]>
…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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> (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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> * fix merge conflicts --------- Co-authored-by: Cas Donoghue <[email protected]> Co-authored-by: João Duarte <[email protected]>
…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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> (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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> * fix merge conflicts --------- Co-authored-by: Cas Donoghue <[email protected]> Co-authored-by: João Duarte <[email protected]>
…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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> (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 <[email protected]> --------- Co-authored-by: João Duarte <[email protected]> --------- Co-authored-by: Cas Donoghue <[email protected]> Co-authored-by: João Duarte <[email protected]>
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_simple
methodhttps://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