Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 3, 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


This is an automatic backport of pull request #18091 done by [Mergify](https://mergify.com).

* 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 mergify bot added backport conflicts Detected git conflicts labels Sep 3, 2025
Copy link
Contributor Author

mergify bot commented Sep 3, 2025

Cherry-pick of d9b95bf has failed:

On branch mergify/bp/9.1/pr-18091
Your branch is up to date with 'origin/9.1'.

You are currently cherry-picking commit d9b95bfd.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   rakelib/artifacts.rake

no changes added to commit (use "git add" and/or "git commit -a")

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

Copy link
Contributor

github-actions bot commented Sep 3, 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!)

donoghuc and others added 2 commits September 4, 2025 10:36
* 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]>
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

History

cc @donoghuc

@donoghuc donoghuc merged commit 9d8ab4c into 9.1 Sep 4, 2025
13 checks passed
@donoghuc donoghuc deleted the mergify/bp/9.1/pr-18091 branch September 4, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport conflicts Detected git conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants