Fixes a bug where buildpack_dependency's Update(..)
method will update the wrong dependencies
#114
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Prior to this PR, the version number was not considered when updating the CPEs and PURL. If for example, you have two different major version branches that you are including in buildpack.toml, such as Java 11 and Java 17, prior to this PR trying to update the version of Java 11 could result in the CPE & PURL for both Java 11 and Java 17 being updated.
This PR adds tests to replicate the case where depenencies that don't match the version pattern are having their CPE/PURL updated incorrectly. It also addresses the issue by only modifying the CPE & PURL if the version pattern matches, which is the same criteria applied for updating the URL/SHA/VERSION.
Use Cases
Fixes minor bug that causes some edge case problems.
Checklist