-
Notifications
You must be signed in to change notification settings - Fork 305
feat: functions download foo --use-api
#4381
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 18971217678Details
💛 - Coveralls |
Co-authored-by: Han Qiao <[email protected]>
Co-authored-by: Han Qiao <[email protected]>
Co-authored-by: Han Qiao <[email protected]>
Co-authored-by: Han Qiao <[email protected]>
Co-authored-by: Han Qiao <[email protected]>
| } | ||
|
|
||
| // Create the full path for the file | ||
| filePath := filepath.Join(funcDir, relPath) |
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.
There seems to be an edge case that results in double nested download directory.
- Create a single
supabase/functions/demo/index.tsfile.
// Setup type definitions for built-in Supabase Runtime APIs
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
console.info('server started');
Deno.serve(async (req)=>{
const { name } = await req.json();
const data = {
message: `Hello ${name}!`
};
return new Response(JSON.stringify(data), {
headers: {
'Content-Type': 'application/json',
'Connection': 'keep-alive'
}
});
});- Deploy using docker
go run . functions deploy demo- Download using api
go run . functions download --use-api demo- Observe that we have the following file created.
supabase/functions/hello-world/functions/hello-world/index.tsThis is not reproducible if we include supabase/functions/demo/deno.json file together with index.ts
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've noticed this behavior even in the current Docker-based downloads. This may be related to https://linear.app/supabase/issue/FUNC-304/auto-packagejson-detection-is-causing-confusion-for-users cc: @nyannyacha
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 able to reproduce this by following the steps provided 🤔
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.
still no repro for me but I've made this PR more robust now anyway, should we try to track this bug separately?
What kind of change does this PR introduce?
Feature DEVWF-756
What is the current behavior?
supabase functions download foospins up an edge-runtime container to download the eszip bundle and writes it to the filesystemWhat is the new behavior?
supabase functions download foo --use-apicalls the mgmt-api to unbundle the eszip on the server, then returns it as a multipart response and writes it to the filesystemParity
We expect that whether you choose to
--use-apior not you should end up with the same files on disk.Additional context
Add any other context or screenshots.