Skip to content

Conversation

@maxrake
Copy link
Contributor

@maxrake maxrake commented Dec 10, 2024

This change fixes a bug that is specific to Windows systems. When legacy Gradle (prior to v7.0.0) lockfiles exist (e.g.,
gradle/dependency-locks/*.lockfile) along with a manifest at a higher level, the manifest is meant to be ignored when finding dependency files to analyze. However, on Windows systems this was not the case before this change. Instead, both the manifest and the lockfiles were retained. After this change, only the lockfiles are retained when both are present.

A failing test was added first to confirm the incorrect behavior. Then, a change was made to handle paths as Path objects instead of strings. That way, the generic / path separator character will be used correctly regardless of the runtime system.

Additionally, an error message was updated to reflect the correct dependency file language for Gradle parsing errors.

This change fixes a bug that is specific to Windows systems. When legacy
Gradle (prior to v7.0.0) lockfiles exist (e.g.,
`gradle/dependency-locks/*.lockfile`) along with a manifest at a higher
level, the manifest is meant to be ignored when finding dependency files
to analyze. However, on Windows systems this was not the case before
this change. Instead, both the manifest and the lockfiles were retained.
After this change, only the lockfiles are retained when both are
present.

A failing test was added first to confirm the incorrect behavior. Then,
a change was made to handle paths as `Path` objects instead of strings.
That way, the generic `/` path separator character will be used
correctly regardless of the runtime system.

Additionally, an error message was updated to reflect the correct
dependency file language for Gradle parsing errors.
@maxrake maxrake self-assigned this Dec 10, 2024
@maxrake maxrake requested a review from a team as a code owner December 10, 2024 22:02
@maxrake maxrake requested a review from cd-work December 10, 2024 22:02
@maxrake
Copy link
Contributor Author

maxrake commented Dec 10, 2024

There may be other instances of incorrectly manipulating paths as strings but finding and fixing those will be handled separately, in an effort to get a quick fix out for a specific customer affected by this Gradle issue.

cd-work
cd-work previously approved these changes Dec 10, 2024
@maxrake maxrake merged commit e9983fa into main Dec 10, 2024
17 checks passed
@maxrake maxrake deleted the win_gradle branch December 10, 2024 22:52
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