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

fix: improve caching for invoker and main path discovery #98

Merged
merged 1 commit into from
Jun 14, 2021

Conversation

lance
Copy link
Member

@lance lance commented Jun 11, 2021

Previously the build phase would only install the invoker once. After this,
if /workspace/.invoker directory was found, it would just assume the invoker
was already there and skip it.

A case where this could be a problem is if the invoker has been updated in
the buildpack. Functions that have previously been built will skip installation
of the new invoker.

This change modifies the behavior so that the invoker itself is always installed.
This is no problem with build time. It just copies two files. Then the
package-lock.json checksum is used to determine if there has been a change,
and if so, run npm ci again.

Signed-off-by: Lance Ball lball@redhat.com

Previously the build phase would only install the invoker once. After this,
if /workspace/.invoker directory was found, it would just assume the invoker
was already there and skip it.

A case where this could be a problem is if the invoker has been updated in
the buildpack. Functions that have previously been built will skip installation
of the new invoker.

This change modifies the behavior so that the invoker itself is always installed.
This is no problem with build time. It just copies two files. Then the
package-lock.json checksum is used to determine if there has been a change,
and if so, run npm ci again.

Signed-off-by: Lance Ball <lball@redhat.com>
@lance lance added runtime/nodejs Issues and PRs for the Node.js buildpacks artifacts/buildpacks Issues related to the runtime buildpacks labels Jun 11, 2021
@lance lance requested a review from a team June 11, 2021 20:34
@lance lance self-assigned this Jun 11, 2021
@lance lance merged commit 43b2a77 into main Jun 14, 2021
@lance lance deleted the lance/improve-node-buildpack branch June 15, 2021 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
artifacts/buildpacks Issues related to the runtime buildpacks runtime/nodejs Issues and PRs for the Node.js buildpacks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants