Function Staging

What is Function Staging?

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.

How do I stage a function?

To stage a function, use the hypar publish --stage command in the
👩🏽‍💻
Hypar CLI
.
The --stage flag tells the CLI to “stage” the changes to your function, instead of releasing it immediately.
Eventually, --stage will be on by default — you will only be able to publish your function from the web UI.

What happens when a function is staged?

Hypar keeps track of two independent versions for every function:
notion image
The “Live” version, which is accessible to anyone you’ve shared your function with, and
notion image
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.

Testing a staged function

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:
notion image
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:
notion image
Within the function, you’ll also see two new options when you’re in “Test” mode:
notion image
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:
notion image

Frequently Asked Questions

Does releasing a function mean anyone can see it?

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.