-
Notifications
You must be signed in to change notification settings - Fork 308
fix: toggle DENO_NO_PACKAGE_JSON conditionally
#4372
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
base: develop
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 19086331832Details
💛 - Coveralls |
| [functions.{{ . }}] | ||
| enabled = true | ||
| verify_jwt = true | ||
| use_package_json = false |
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'm not sure if this is the right fix. Based on their example, the error seems to be caused by health function failing to import package.json on Windows.
Most likely we have a bug in path resolution that's preventing package.json at root repo directory from being volume mounted into the edge runtime container.
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.
@sweatybridge Hello qiao 😄
Well.... I think their reproduction code in that link you mentioned is definitely a bug, but I believe what they reproduce is actually a different bug that seems similar to the issue they're having.
Apparently, the cli is parsing the script directly and passing it a list of the paths that should be bound from the host to pass to Docker.
That link is reproducing a bug that occurred there, but the issue that originally caused that issue was that it was automatically reading the package.json and subtly changing the way the Deno codebase resolves modules.
This is a PR for that.
840f37d to
13e2832
Compare
DENO_NO_PACKAGE_JSONDENO_NO_PACKAGE_JSON conditionally
8c43045 to
d5a211c
Compare
f135c39 to
27988b5
Compare
| } | ||
|
|
||
| func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, output io.Writer) (function.FunctionDeployMetadata, error) { | ||
| func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap string, staticFiles []string, usePackageJson bool, output io.Writer) (function.FunctionDeployMetadata, error) { |
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.
Is it possible to avoid changing the Bundle method signature? This interface is part of our public package so I'd rather not break it.
If we need to pass in additional args, we can use variadic editor args for backwards compatibility.
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.
Hey @sweatybridge
I also dislike the lengthening iface signature, but I can't think of a suitable way to pass usePackageJson.
Should I define it directly as a field in the dockerBundler struct (and any struct that implements the Bundle interface)?
|
Could you guide me on how to correctly reference I just need to be able to reference it within the Bundle, and I'd appreciate it if you could let me know any way to do that. 🥹 |
Yea kinda of. Because adding variadic args is backwards compatible. Let me think about it a bit more too. |
What kind of change does this PR introduce?
Enhancement
Description
Make CLI conditionally toggle
DENO_NO_PACKAGE_JSONbased on what files are in each function folder.This only applies when deploying functions locally/Docker and not using the deploy api.
Related supabase/supabase#38402
Towards FUNC-304