When you’re building Hypar functions, it’s useful to publish frequently to test in real workflows. When you do this, it’s important to be careful not to break any version of your function that others may already be using. Function Staging is a way to ensure that you can try out new versions of your function and test to make sure they work as expected before releasing them to the general public.
To stage a function, use the
hypar publish --stagecommand in the Hypar CLI.
--stageflag tells the CLI to “stage” the changes to your function, instead of releasing it immediately.
--stagewill be on by default — you will only be able to publish your function from the web UI.
Hypar keeps track of two independent versions for every function:
The “Live” version, which is accessible to anyone you’ve shared your function with, and
The “Test” version, which is only available to you and any collaborators you’ve added to your function’s permissions.
When you stage a function, you are updating its “Test” version, and when you release, you are setting the “Live” version to be the same as the current “Test” version.
In order to try out the newly staged “Test” version of your function, go to the Hypar web UI and add the function to a workflow. You should see a “Test” button on the corner of your function:
When you click that button, you start utilizing the test version, instead of the live, published version of your function. You’ll know you’re in the test version because you’ll see this icon next to the function name:
Within the function, you’ll also see two new options when you’re in “Test” mode:
Compare with live version will cause your function to execute twice — once with the test version, and once with the current live released version. This way, you can easily compare the results of the two versions, and see if anything has changed that shouldn’t have.
Release will set the current “live” version to be the test version — so all staged changes will be made available to anyone with access to the function.
You can return to using the live, released version by clicking the “To live” button:
No. Function visibility + sharing is independent from whether a function is released or not. However, if your function is not released, no one else will be able to use it, even if you make it public.