Skip to content

Conversation

donoghuc
Copy link
Member

@donoghuc donoghuc commented Sep 2, 2025

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 method
https://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

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Related issues

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
Copy link
Contributor

github-actions bot commented Sep 2, 2025

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

mergify bot commented Sep 2, 2025

This pull request does not have a backport label. Could you fix it @donoghuc? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

If for some reason we cant get a time from a File object (very unlikely)
a better default is Time.now rather than 0.
@donoghuc donoghuc requested a review from jsvd September 3, 2025 17:41
@donoghuc donoghuc added the backport-active-all Automated backport with mergify to all the active branches label Sep 3, 2025
Copy link
Member

@jsvd jsvd left a 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

Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@elasticmachine
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

History

@donoghuc donoghuc merged commit d9b95bf into elastic:main Sep 3, 2025
13 checks passed
Copy link
Contributor

github-actions bot commented Sep 3, 2025

@Mergifyio backport 8.17 8.18 8.19 9.0 9.1

Copy link
Contributor

mergify bot commented Sep 3, 2025

backport 8.17 8.18 8.19 9.0 9.1

✅ Backports have been created

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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
(cherry picked from commit d9b95bf)

# Conflicts:
#	rakelib/artifacts.rake
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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
(cherry picked from commit d9b95bf)

# Conflicts:
#	rakelib/artifacts.rake
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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
(cherry picked from commit d9b95bf)
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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
(cherry picked from commit d9b95bf)

# Conflicts:
#	rakelib/artifacts.rake
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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
(cherry picked from commit d9b95bf)

# Conflicts:
#	rakelib/artifacts.rake
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.
@donoghuc
Copy link
Member Author

donoghuc commented Sep 3, 2025

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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
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 <[email protected]>

---------

Co-authored-by: João Duarte <[email protected]>
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 <[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]>
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 <[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]>
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 <[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]>
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 <[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]>
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 <[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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants