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, just use the hypar publish command in the 👩🏽‍💻Hypar CLI Overview. All functions are automatically staged for you.

What happens when a function is staged?

Hypar keeps track of two independent versions for every function:
Image without caption
The “Live” version, which is accessible to anyone you’ve shared your function with, and
Image without caption
The “Test” version, which is only available to you and any collaborators you’ve added to your function’s permissions.
When you publish 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:
Image without caption
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:
Image without caption
Within the function, you’ll also see a new button when you’re in “Test” mode:
Image without caption
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.
Note: Model_Dependencies and Model_Output in functions use the latest released function, be sure to release functions prior to testing if you are inputting and outputting elements between functions.
You can return to using the live, released version by clicking the “To live” button:
Image without caption

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.