Jump into notebook with environment variables set
I just discovered Runme today and would like to know how/if it could be used to make the following use case work:
In an alert about an anomaly in some cluster, we provide a runbook URL. With that URL we give some important context information, e. g. as URL parameters, like the cluster name, namespace, application name etc. When following the link, a user sees the runbook with these parameters applied to environment variables already.
E. g. the runbook that has the block
export CLUSTER=examplecluster
when following a URL like https://myrunbooks/my-runbook/?CLUSTER=mycluster, the code would adapt like this:
export CLUSTER=mycluster
Basically the idea is to skip the manual setting of environment variables.
Alternatively, for a CLI, I think the equivalent would be to present with the alert a CLI command that is copy-paste ready like this:
CLUSTER=mycluster mycli myrunbooks/my-runbook.md
But I haven't found any command in the runme CLI to open a notebook.
If any of that makes sense, I'd like to known whether some of this is achievable today, and how. Thank you!
Hi @marians,
Yes, there is indeed an API called URI Handler (https://code.visualstudio.com/api/references/vscode-api#window.registerUriHandler) which lets you develop features to pass information into Runme via the URL.
Runme is already using a URI handler for authentication, bootstrapping Git repos, etc. It should be possible to bootstrap an environment. I'll try to prototype something in the next 1-2 weeks and report back here.