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

libcnb.LayerContributor => libpak.Contributable #282

Merged
merged 1 commit into from
Aug 16, 2023

Conversation

BarDweller
Copy link

Summary

libcnb 2.x removed libcnb.LayerContributor, a concept that was useful for libpak, and consumers of libpak.

This PR adds 'libpak.Contributable' a replacement for the old libcnb.LayerContributor interface, that has identical methods, allowing it to be used almost seamlessly where-ever the old LayerContributor was used.

"Almost" because any buildpacks previously returning an array of libcnb.LayerContributor now need to return an array of libcnb.Layer which means the Contributables must be made to Contribute before the return has the correct data. To this end, a a Function type (FlattenContributableFn), and default implementation (DefaultFlattenContributableFn) are supplied to make this easier for buildpacks to perform this conversion.

Use Cases

Allows buildpacks / libpak consumers to continue to use libcnb.LayerContributor like concepts, with minimal impact.

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).

@BarDweller BarDweller requested a review from a team as a code owner August 15, 2023 15:42
@dmikusa dmikusa added type:enhancement A general enhancement semver:minor A change requiring a minor version bump labels Aug 16, 2023
@dmikusa dmikusa merged commit 9588657 into paketo-buildpacks:release-2.x Aug 16, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:minor A change requiring a minor version bump type:enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants