-
Notifications
You must be signed in to change notification settings - Fork 14
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
Adding extension support #234
Adding extension support #234
Conversation
Thanks for submitting this @pacostas We'll take a look at trying out this functionality and give you feedback on it. In the meantime, could you sign the CLA (see above)? |
@robdimsdale I've added it as a draft, as the tests are not implemented yet and also I'm not sure if this heads to the right direction. |
@pacostas to me, this PR seems like its definitely heading in the right direction! |
Successfully used this in an integration test in https://github.com/nodeshift/ubi-nodejs-extension/pull/35 |
d0bb18e
to
18f9a4a
Compare
@pacostas let us know when this PR is officially ready for review or if you need feedback on anything particular |
@sophiewigmore I dont have anything in particular to ask, so I think is ready for review :) |
Even though the cases are very similar, I'd love to see an extra test case added for the |
The final output, looks like it will end up with a lot of if statements handling the scenario "if is buildpack or extension" each time the buildpack and extension differ, something like:
I think it would be better to create a separate method that will handle only the extensions. The only drawback with that is that it ends up with a few lines of duplicate code which compared to the multiple "if statements" solution seems more manageable. |
I think this is fine. A few lines of duplicated code sounds potentially better than lots of |
Below commits is the implementation using a separate function. What is missing is that I havent added tests yet for packing the extension. |
This PR has to be merged after paketo-buildpacks/packit#490 |
For anybody looking paketo-buildpacks/packit#490 has already landed :) |
I havent finish it yet, as I havent finished with unit/integration tests. I'll submit them soon almost 90% done |
@sophiewigmore I've added the test cases, similar to those that exist for buildpack.toml |
@sophiewigmore I've finished with this PR Implementation, is ready for review. Although this PR wont pass the tests till this PR paketo-buildpacks/packit#490 has being included on the latest release version of https://github.com/paketo-buildpacks/packit due to a recent change that I had to add. |
eb6c819
to
c6ed751
Compare
I released packit v2.10.1 which includes the Also, I think you can refactor the |
@robdimsdale I've finished with the implementation of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is almost there. There's a couple of types we can make unexported, which keeps them out of the public interface of the package, and there's another minor logging change I think will improve UX. All comments inline.
@robdimsdale I've added your suggestions. I've also refactored Bunlde and ExtensionBundle for avoiding duplicate code as @sophiewigmore has suggested |
I'll take another look in the next few days, sorry about the delay |
@pacostas these changes look great. Thanks for the hard work on this PR 🔥 |
I cannot merge it in due to conflicts, if you can resolve those |
c06573e
to
c427d5a
Compare
@sophiewigmore There wasnt somewhere visible to me for resolving the conflicts, so I rebased it instead :) |
Summary
This PR adds the --extension flag option for packaging an extension.
Use Cases
With this PR is possible to package an extension by using below command.
Checklist