Code branches are not environments. A branch isolates the code of a service. An environment holds your data and configuration, and it is where deployed code runs.
Find the branch of a service
Open the service in Backend > Logic. Under the service header, above the tabs, you see:- The branch chip. It shows the branch you are on, with a lock when the branch is protected. Select it to switch branches, create one with New branch from branch, open Pull requests, or open Manage branches.
- The branch count. For example “2 branches”. It opens Manage branches for the service.
- An information icon. Its tooltip explains that Code, Functions, and History show what is on this branch, and that Deploy sends a commit from a branch to an environment.
- The pull request count. For example “1 pull request”. It opens the pull requests of the service.
Each service has its own branches
A service does not share anything with the Frontend or with other services. Each one has:- Its own branches. Creating a branch in one service does not create one in another service or in the Frontend.
- Its own default branch. Changing it does not affect other services or the Frontend.
- Its own protected branches and protection rules.
- Its own pull requests.
main in the Frontend and on fix-prices in one service at the same time.
In a service, Manage branches is a page named Branches · Service, with Back to service at the top. It has the same table as the Frontend panel, with Branch, Last commit, Protection, and the row actions, and these settings:
- Default branch: with Change, for Owners and Admins.
- Who can publish, a project-wide setting.
- Code review, a project-wide setting that controls whether Archie Reviewer reviews a pull request when it is opened.
Branches vs. environments
A branch holds the code of the service. An environment holds your data and configuration, and it is where deployed code runs.
Your data does not belong to a branch:
- Tables, rows, and schema live in environments. Every branch that is connected to an environment sees the same tables and the same rows.
- Variables belong to the environment. The variables of an environment are shared by every service deployed there. See Environment variables.
Deploy a service from a branch
A service is deployed from a branch and a commit to an environment. Nothing deploys on its own: not when you save, and not when you merge.- Select Deploy in the service header. The Deploy service dialog opens: “Choose the code and the environment. Nothing deploys on its own.”
- Choose the Branch to deploy.
- Choose the Commit. It defaults to the latest commit of the branch, and the exact commit you choose is what Archie deploys.
- Choose the environment in To.
- Confirm with the deploy button.
- Environment today: shows what is live in that environment now.
- It compares this deploy with the live one, for example “+2 commits over live” or “Same commit as live”.
- It tells you that the deploy replaces what is live in the environment.
- It lists the variables of the environment, with a link to view them.
- If you are working in one environment but the deploy goes to another, it says “You’re on current, but this deploys to target.”
- If a deploy is already running to that environment, it shows its progress.
Each environment exposes its own services
You can deploy the same service to several environments, for examplemaster and staging. Each environment exposes the services deployed to it in its own GraphQL API. When you deploy a service to staging, its operations become available in the staging GraphQL API. Until you deploy there, they do not exist in that environment, even if they work in another one.
If an operation of a service works in one environment and is missing in another, check where you deployed the service. See GraphQL API Explorer.