Skip to content
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

Fixes a bug where buildpack_dependency's Update(..) method will update the wrong dependencies #114

Merged
merged 1 commit into from
Dec 7, 2021

Conversation

dmikusa
Copy link
Contributor

@dmikusa dmikusa commented Dec 6, 2021

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

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@dmikusa dmikusa added type:bug A general bug semver:patch A change requiring a patch version bump labels Dec 6, 2021
@dmikusa dmikusa requested a review from a team December 6, 2021 20:37
…ate the wrong dependencies

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.

Signed-off-by: Daniel Mikusa <dmikusa@vmware.com>
@dmikusa dmikusa force-pushed the fix-purl-cpe-order branch from 8b1792d to 113368b Compare December 7, 2021 15:33
@dmikusa dmikusa merged commit bef1d87 into main Dec 7, 2021
@dmikusa dmikusa deleted the fix-purl-cpe-order branch December 7, 2021 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants