-
Notifications
You must be signed in to change notification settings - Fork 529
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
fix (jkube-kit) : lastModified timestamps should be preserved while preparing assembly #2405
fix (jkube-kit) : lastModified timestamps should be preserved while preparing assembly #2405
Conversation
Eclipse JKube CI ReportStarted new GH workflow run for #2405 (2023-09-29T10:40:29Z) ⚙️ JKube E2E Tests (6349775425)
|
Codecov Report
@@ Coverage Diff @@
## master #2405 +/- ##
============================================
+ Coverage 59.36% 61.11% +1.74%
- Complexity 4586 4786 +200
============================================
Files 500 518 +18
Lines 21211 21394 +183
Branches 2830 2827 -3
============================================
+ Hits 12591 13074 +483
+ Misses 7370 7099 -271
+ Partials 1250 1221 -29
... and 67 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
c77ce8d
to
1874fd2
Compare
@@ -169,8 +169,10 @@ private static List<AssemblyFileEntry> copy(Path sourceDirectory, File source, F | |||
for (File sourceChild : Optional.ofNullable(source.listFiles()).orElse(new File[0])) { | |||
copy(sourceDirectory, sourceChild, new File(target, sourceChild.getName()), assemblyFileSet); | |||
} | |||
FileUtil.updateLastModifiedTimestamp(target, source.lastModified()); |
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.
I think it'd be better if this was done as part of the copy.
Instead of adding an extra-function, just modify FileUtil.copy to preserve the original metadata
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.
OK, in this case target refers to the directoy.
Likewise, whatever process was used to create the directory should be used to preserve that timestamp.
I don't see the logic (besides for this current use-case) in updating the timestamp of an existent directory.
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.
Umm, you mean FileUtil.copy?
I noticed that whenever a new file gets added to directory, it's lastModified timestamp gets updated. This is done to revert directory's lastModified to original source's lastModified
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.
1874fd2
to
4702740
Compare
…reparing assembly We don't seem to be preserving lastModified timestamps of files that are being copied while preparing the assembly for image. Make sure we're copying all the metadata of files/directories as well while copying them. Signed-off-by: Rohan Kumar <[email protected]>
4702740
to
3a26d30
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs 100.0% Coverage The version of Java (11.0.18) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
Description
We don't seem to be preserving lastModified timestamps of files that are being copied while preparing the assembly for image. Make sure we're copying all the metadata of files/directories as well while copying them.
Type of change
test, version modification, documentation, etc.)
Checklist