metacall / faas

Reimplementation of MetaCall FaaS platform written in TypeScript.
https://dashboard.metacall.io
Apache License 2.0
13 stars 20 forks source link

blank id on package creation #19

Closed durgesh077 closed 1 month ago

durgesh077 commented 1 year ago

image image

Creatoon commented 1 year ago

@durgesh077 You are sending half data and its not expected, also you are sending the wrong key for zip file, it should be blob.

but the correct way is

{
    id: string;
    type?: string;
    jsons: MetaCallJSON[];
    runners?: string[];
    path: string;
}

Although thanks for reporting this, I am already working on the way to verify data coming from user request, it will be patched soon.

Creatoon commented 1 year ago

@ashutosh887 how will you proceed?

durgesh077 commented 1 year ago

@Creatoon I have a view point. I had already pushed a PR related to it. It was based on random id generation and then checking if the randomly generated has already been assigned. If not then fine, else I was adding a stub. We can add an optional parameter into formdata which provides id from user end. If user provides it, then we'll try to assign it else randomly generated id will work fine.

durgesh077 commented 1 year ago

https://github.com/metacall/faas/pull/17 this my PR

durgesh077 commented 1 year ago

or we can make ID by adding some required stub at the end of zip file name:- Like it file name is Func.zip we can try Func-stub1 , Func-stub2 so on where stub is randomly generated

Creatoon commented 1 year ago

@durgesh077 At the end, users will be using with @metacall/deploy CLI to interact with this FAAS, and It will auto generate the id for you, if user did not provided it.

See how it generated multipart data - https://github.com/metacall/protocol/blob/master/src/protocol.ts#L160

And we should validate the incoming form data, if it consists or fields or not, if not, we will simply notify user by throwing an error, instead of generating names randomly.

durgesh077 commented 1 year ago

Yes , but finding new id that has not been used may find user but annoying. That's why

Creatoon commented 1 year ago

Thanks @durgesh077, we will be needing unique name and will surely tell you how to proceed with this, for now we have to implement few endpoints that will support your issue.

durgesh077 commented 1 year ago

Sure, You can assign me some of the task which you like .I'll be happy to work with you. I have good experience at backend.

viferga commented 1 month ago

The id is a required field, we are trying to mimic the behavior of the FaaS. We obtain the name of the deployment from the current directory name or from the repository url when deploying from repo.

@durgesh077 if you are interested in keep working on the project, maybe we can find other issues which are more interesting than this one.