Skip to main content

Branches and environments

A Karizma One project is a Git repository hosted on GitLab. Each branch of that repository has a type that decides whether it has a running Odoo environment. This page explains how to move your code from a development branch all the way to production, by dragging branches from one section to another in the left column of the project page.

Access

Project page, left column. Creating, deploying, destroying or deleting a branch is limited to the Super Admin, Admin and Developer roles. Creating a merge request and managing submodules is limited to Super Admin and Admin. A Tester can view branches but not change them.

Branch types​

SectionTypeEnvironmentPurpose
PRODUCTIONProductionYesYour real Odoo instance, used by your teams. One per project, created with the project and named after the Odoo version (for example 17.0).
STAGINGStagingYesA complete test environment, deployed from a branch, to validate work before production. Their number is limited.
MIGRATIONMigrationNoA branch created during an Odoo version upgrade. The section only appears when at least one migration branch exists.
DEVELOPMENT (n)DevelopmentNoA Git branch only, for coding. The counter shows how many there are.

Development and migration branches have no Odoo environment: they only show the HISTORY and CONFIG tabs.

The diagram below sums up the moves allowed between sections.

Only these moves are accepted. Any other drag is refused with the message Cannot move a … branch to …. You can also drag a branch within its own section to change the display order; the order is saved.

Create a development branch​

A development branch can start from any branch of the project.

  1. In the DEVELOPMENT header, click +.
  2. In Source branch, pick the branch to start from.
  3. In Target branch, type the new branch name (letters, digits, _, . and -).
  4. Press Enter.

The branch is created in GitLab and in Karizma One, then its HISTORY tab opens. If the name is already taken, the message A branch with this name already exists appears.

Keep it tidy

Beyond 20 development branches, a yellow warning icon appears in the section header (There are too many branches, consider cleaning unused branches). Delete the branches you no longer use.

Deploy a staging​

Deploying a staging creates a complete Odoo environment from the code of an existing branch. There are two ways to do it:

  • Drag and drop: drag a branch from the DEVELOPMENT section onto the STAGING section, then confirm with Deploy in the Deploy to staging dialog.
  • By name: click + in the STAGING header, type the branch name (Enter staging branch name) and press Enter. The deployment starts without confirmation and the branch's HISTORY tab opens.

The deployment runs in the background:

  1. Karizma One checks that the branch has a successful GitLab pipeline. If not, the deployment is refused (for example No successful pipeline found for branch '…'). See Deployments and pipelines.
  2. The environment is prepared. The branch row shows a spinner and the tabs show Deployment in Progress. Allow a few minutes.
  3. The branch dot turns green: the staging is ready. The Connect button on the project page opens its Odoo instance.

If the deployment fails, the branch goes back to the DEVELOPMENT section.

Limits and refusal messages​

MessageCause
Staging environments are disabled for this project.The project is not entitled to any staging. Contact your Karizma representative.
Maximum number of staging environments reached for this project.The allowed number of stagings is reached. Destroy an unused staging, buy more with the Stagings resource or contact your Karizma representative.
This branch is already in a staging environment.The branch is already deployed as a staging.
Another deployment is in progress. Please wait. / A branch is already deploying…Another deployment is running on the project; wait for it to finish.
Invalid branch nameThe branch name must start with a letter or a digit.
Cannot deploy to stagingThe branch is on an older Odoo version than the project.

Destroy a staging​

Destroying a staging removes its Odoo environment but keeps the Git branch, which goes back to the DEVELOPMENT section.

  1. Drag the branch from the STAGING section onto the DEVELOPMENT section.
  2. In the Destroy staging environment dialog, confirm with Destroy.

A staging marked with a lock is locked: it cannot be destroyed (Locked staging environments cannot be destroyed). To unlock it, contact your Karizma representative.

Ship a staging to production​

Dragging a staging onto the PRODUCTION section does not change production directly: it creates a merge request from the staging to the production branch.

  1. Drag the branch from the STAGING section onto the PRODUCTION section.
  2. In the Merge to production dialog, optionally type a title (Enter a merge request title).
  3. Click Create merge request. The message Merge request created successfully! confirms it.

The merge request must then be merged. Once it is, the production branch's pipeline deploys the code to production. See Merge requests and Deployments and pipelines.

Promote a migration branch to staging​

A migration branch, created from the production UPGRADE tab, must be deployed as a staging to be tested.

  1. Drag the branch from the MIGRATION section onto the STAGING section.
  2. In the Promote to staging dialog, confirm with Promote.

The resulting staging runs on the new Odoo version and carries the matching cyan icon. The rest of the upgrade (getting the migrated database, moving to production) happens in its UPGRADE tab.

Delete a development branch​

  1. Open the development branch.
  2. In the action bar, click Delete.
  3. Confirm with Delete Branch.

The branch is deleted in GitLab too; this cannot be undone. You are then taken to the production branch.

note

A branch deployed as a staging cannot be deleted. First destroy its staging (the branch goes back to DEVELOPMENT), wait for the operation to finish, then delete it. The production branch cannot be deleted.

Manage submodules​

The Submodules button in the action bar adds or removes Git submodules on a production or staging branch. The Add/Update Submodule dialog offers two sources:

TabSource
Karizma SubmodulesModules provided by Karizma. Type the submodule name (for example kzm_odoo).
Custom SubmodulesYour own repositories, from the GitHub, GitLab or Bitbucket account linked to your profile. Pick the repository and then the branch, or type the repository URL. The token needs the repo scope (GitHub) or read_api (GitLab).

While a submodule is being added, the action bar shows Adding Submodule.

Requests that need approval​

Some submodule operations must be approved by the project manager:

  • adding a Karizma submodule: if you are not the project manager, enter a Motif (the reason for the request). The message Submodule request sent to project manager. confirms it was sent;
  • removing a submodule: the project manager sees Delete submodule; other collaborators see Request Deletion and must enter a reason.

The project manager is notified of the request; to get it handled, contact your Karizma representative. Once the request is approved, a pipeline runs on the branch.

See also​