bijection branch or from the
Branch page of the Bijection console. This page walks
through a branch’s life from the command line.
Choosing the parent
bijection branch acts on the deployment you select, the same way other
commands do: your dev deployment by default, --prod for production, or
--deployment <deployment> for another one. That deployment is the branch’s
parent. Every lifecycle command, including those for an existing branch,
runs against the parent.
Branch commands refuse a branch URL as the selected deployment. A branch’s own
admin key only works on the branch, and the parent always refuses it.
Creating a branch
Output
Fork of:. That
revision is the branch’s basis, and it never moves.
- A branch key is 1 to 40 lowercase letters, digits or hyphens, starting with a letter or digit.
- Pass
--emptyto start from an empty deployment instead of live data. - Pass
--ttl-hours <n>to choose when the branch expires. The default is 3 days, and the longest is 30 days (720 hours). - Running
createagain with the same key, parent and owner returns the existing branch. It does not create a new one with a later basis.
Opening a branch
A branch has its own URL,https://<your deployment>/branch/<key>/<token>.
Use it wherever you would use a deployment URL: in a client, in the
console, or with the CLI.
A branch link is personal. It admits only the person it was issued to,
and it is valid for 12 hours, never past the branch’s expiry. Every request
checks it again. Print a fresh link at any time with
bijection branch status <key>.Deploying code to a branch
To deploy to a branch, you need its admin key. Only administrators receive one.Output
Running functions and operations on a branch
bijection run works against the branch URL too.
Operations run as a user, so pass the user’s identity with --identity:
Open and closed branches
A branch loads the first time it receives a request. A branch with no requests and no connected clients for 10 minutes is closed. Its data is kept, and the next request loads it again. A closed branch runs nothing. Its scheduled functions run late, when it next opens. A cron job whose runs were due while the branch was closed runs once, and the other missed runs are skipped.Sharing a branch
A branch is visible only to its owner and to administrators until you share it. Share it with users by their token identifier (issuer|subject, see
auth in functions), not a JWT:
Comparing with live
compare runs one query on the branch and on live at the branch’s basis,
so any difference is the branch’s doing, not live moving on.
Output
compare matches them by _id and
lists the documents added, removed and changed, field by field. Any other
result is compared as one value and reported as identical or different.
The query runs as you. Pass --identity to run it as a user, and --json for
the full results.
Listing and inspecting branches
list shows every branch you can open. status shows one branch, how far
you have applied it to live, and a fresh link.
Extending a branch
extend sets the expiry to the given number of hours from now, up to 30
days. The basis does not move. A branch whose expiry has passed can no longer
be extended.
A branch that expires stops serving requests, and the deployment discards it
within about a minute.