Lokad Branches
Working with branches in Lokad
A branch is a work environment within an account. It lets you develop changes across Envision scripts, CMS pages, project sequences, and files before applying those changes to Production, the account’s standard environment. You can edit and run your work within the branch.
Branches are useful when a change involves several related updates that you want to develop and review together. Changes to scripts, pages, sequences, and files stay in the branch until you merge it into Production.
Check what you are working on. Envision scripts, CMS pages, project sequences, and files support branches. Syncers show Production in read-only mode while you are in a branch. Account management, email, and discussions always use Production directly, including for edits.
In this guide
- Create a branch
- Work in a branch
- Review and merge your changes
- Resolve script conflicts with a rebase
1. Create a branch
Open the branch selector in the back-office navigation bar. It works similarly to the account and impersonation selector. In its menu, click Create branch and give the branch a name.
The name identifies the branch throughout its lifetime:
- Use only letters and numbers, with a maximum of 16 characters.
- Choose a name that is unique within the account. Different accounts can use the same branch name.
- Choose carefully: the name cannot be changed after creation.
The branch is then visible and available to every Lokad employee. Branches are completely invisible to non-employees.
What a new branch contains
Creating a branch takes a snapshot: a copy of the state of the following items at the time of creation.
| Content | Included in the snapshot | Excluded |
|---|---|---|
| Envision scripts and CMS pages | All non-archived scripts and pages, including their settings and other project information | Runs and draft scripts |
| Project sequences | All non-archived sequences, including their settings and other project information | Runs |
| Files | Every file in the file tree | — |
This snapshot is your starting point. As you work, the branch shows that starting state together with the changes made within the branch.
Account management, email, and discussions have no branch-specific state: creating a branch does not create a separate environment for them.
2. Work in a branch
You can check your current branch in two places:
- In the back-office navigation bar.
- In the URL, near the account trigram.
What you see and what you can do depends on the type of content.
| Content | What you see | How working in a branch differs from Production |
|---|---|---|
| Envision scripts and CMS pages | The scripts and pages captured when the branch was created, together with changes made in the branch | You can work as in Production, but the normal workflow has no draft scripts. You can edit modules directly without first creating a draft. The coding assistant still creates drafts for now; it is the only way to create them in a branch. |
| Project sequences | The sequences captured when the branch was created, together with changes made in the branch | You can work as in Production, but triggers do not fire in branches. |
| Files | The files present when the branch was created, together with changes made in the branch | File changes stay within the branch until merged. |
| Syncers | Production, in read-only mode | Syncers have no separate branch environment. |
| Account management, email, and discussions | Production | These features ignore branches. Edits affect Production directly, even while a branch is selected. |
3. Review and merge your changes
When your changes are ready, merge the branch to apply them to Production.
- While in the branch, open the branch selector menu.
- Click Merge to open the Merge Branch page.
- Review the changes to Envision scripts, CMS pages, project sequences, and files, as described below.
- Resolve any conflicts, then merge the branch to apply the changes to Production.
Envision scripts and CMS pages: review changes and compilation
For Envision scripts and CMS pages, the review shows:
- A compilation check of the expected Production state after the merge.
- New scripts and pages that will be created in Production.
- Existing Production scripts and pages that will be updated, with the changes that will be applied to each one.
The compilation check looks at the result in Production. It can therefore list scripts or pages that do not exist in your branch, or ones that compile successfully in the branch but would fail after merging.
Why the merged script can differ from the branch script
Unlike Merge draft, merging a branch tries to preserve both the changes made in Production and the changes made in the branch since the branch was created. As a result, the merged script may differ from the script you see in the branch.
If the same line has been changed in both places, the merge can produce a conflict. The script preview displays conflict markers at those locations. These markers make the script fail to compile.
To resolve these conflicts, rebase the branch, then edit the affected scripts within the branch.
Project sequences: review new and modified sequences
The review lists all newly created and modified project sequences.
If the same sequence property has changed in both Production and the branch, the branch’s value is kept when merging.
Files: review changes and choose versions
The files section lists all newly created and updated files.
For a file with conflicting changes, use the available selector to choose which version to keep after the merge.
4. Resolve script conflicts with a rebase
A rebase updates the starting point for Envision scripts and CMS pages in your branch using the current state of Production. It brings the script merge results into your branch so you can resolve conflicts there before merging into Production.
- Open the Merge Branch page.
- Click the Rebase button at the bottom of the page.
- Stay in the branch and edit the scripts that no longer compile, resolving the conflicts shown by the merge.
- Return to the Merge Branch page to review the result and try merging again.
During the rebase, the system takes a new snapshot of the Envision scripts and CMS pages as they are at that time and uses it as the branch’s new starting point for that content. It merges the scripts in the same way shown on the Merge Branch page, while keeping you in the branch to make any necessary corrections.
Project sequences also receive a new Production snapshot. For sequences edited in the branch, rebasing imports Production changes to properties you have left unchanged. For example, a comment changed in Production and subtasks changed in the branch are both kept. If the same property changed in both places, the branch’s value is kept. Sequences created in the branch are preserved.
Rebase does not affect files (yet).