Skip to content

Conversation

@osdemah
Copy link
Contributor

@osdemah osdemah commented Jan 2, 2025

Preserve file permissions in the zip archive, fix bugs in gitignore matching and keep mvm and gradle files

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

  • Traditional ZipOutputStream doesn't include file permission when archiving. Switching to ZipFS to be able to preserve the permissions on the archives
  • Partial matching of gitignore rules would create some false-positive matches. e.g. settings.gradle file being ignored due to .gradle rule in gitignore. Changed the logic to fix it.
  • Many of the files for mvn and gradle build systems would be dropped with the current extension+blocklist+gitignore heuristic. Added some explicit pattern matching to keep them unless matched by gitignore rules.

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
    • some are covered. still need more test coverage.
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • [N/A] I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

…ore mattern matching and keep mvm and gradle files
@osdemah osdemah requested review from a team as code owners January 2, 2025 19:37
@osdemah osdemah requested a review from a team as a code owner January 3, 2025 18:30
@@ -0,0 +1,4 @@
{
"type" : "bugfix",
"description" : "Preserve file permissions in the zip archive, fix bugs in gitignore matching and keep mvm and gradle files"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the change user facing, ie is a changelog required here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, it does have a user facing change. updated the messaging.

val file = Files.createTempFile(null, ".zip")
ZipOutputStream(file.outputStream()).use { zipOutput -> block(zipOutput) }
file
private suspend fun createTemporaryZipFileAsync(block: suspend (FileSystem) -> Unit): Path = withContext(EDT) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be on the background thread?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, changed it to run on background

@osdemah osdemah closed this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants