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

Rib Robustness: Make sure Rib doesn't condsider random variables as global variables #881

Closed
afsalthaj opened this issue Sep 8, 2024 · 3 comments · Fixed by #978
Closed
Assignees
Labels
Milestone

Comments

@afsalthaj
Copy link
Contributor

afsalthaj commented Sep 8, 2024

No description provided.

@afsalthaj afsalthaj added the rib label Sep 8, 2024
@afsalthaj afsalthaj self-assigned this Sep 8, 2024
@vigoo vigoo added this to the Golem 1.1 milestone Sep 13, 2024
@afsalthaj afsalthaj changed the title Give warnings in UI when user specify a global variable that's not part of the request path or body Rib Robustness: Give warnings in UI when user specify a global variable that's not part of the request path or body Sep 18, 2024
@jdegoes
Copy link
Contributor

jdegoes commented Sep 18, 2024

Shouldn't ordinary type-checking provide this? We know that request may contain path, headers, body, so really the only thing we don't know, initially, is body. Once we learn 'body', if we back-propagate that, and combine it with the other types we know, won't we have a complete picture of the type of request?

@afsalthaj
Copy link
Contributor Author

afsalthaj commented Sep 30, 2024

@jdegoes I was more of talking about tagging any variable as global input. At golem-rib side, anything that's not declared is turning out to be a gobal variable. Example

 let my_record = request.path;
 let result = foo-function(my_record);
 match result {
    some(_) => "success"
    none => msg
 }


The global input requirement for the above script is a request record

"request" -> Record("path" -> Record ("user -> Str) )
"msg" -> Str

May be that example is an over-kill. Here is a compilable Rib,which tags some random variable as input, which our golem platfrom (that calls Rib through worker-service) can never satisfy

let x: str = msg;
x

Here we tag msg as a global input. It's a very simple 1-2 pointer fix I hope

@afsalthaj
Copy link
Contributor Author

@jdegoes Yes Rib is now providing the complete type information of a "request" and is sent back to UI. Example: After compilation Rib returns The RibInputTypeInfo (the input requirements as something like below)

"request" -> 
    Record(
     "path" -> Record ("user -> Str) , 
     "body" -> Record("employee" -> Record("id" -> Str, "name" -> Str)
   )

@afsalthaj afsalthaj changed the title Rib Robustness: Give warnings in UI when user specify a global variable that's not part of the request path or body Rib Robustness: Make sure Rib doesn't condsider random variables as global variables Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment