Branch awareness
Every schema element β nodes, attributes, and relationships β can be configured to control how changes to its data behave across branches.
By default, user defined schema elements are branch-aware: changes are local to the branch and do not affect other branches, the same way Git works.
An element can also be configured as:
- branch agnostic: changes are immediately propagated to all branches.
- branch local: changes stay local to the branch and are excluded from Diff and Merge operations.
Summaryβ
| Branch Support | Description | Diff | Merge | Rebase |
|---|---|---|---|---|
| Aware | All changes will be local to the branch and can be merged back into the main branch. | Yes | Yes | Yes |
| Agnostic | All changes will automatically be available in all branches | No | No | No |
| Local | All changes will be local to the branch and will not be merged to other branches. | No | No | Yes |
Branch agnosticβ
In the frontend, the API, or the GraphQL endpoint branch-agnostic objects can be modified on any branchβno restrictions apply.
To configure a model as branch-agnostic you need to set the option branch to agnostic in the schema
nodes:
- name: Fruit
namespace: Example
branch: agnostic
attributes:
- kind: Text
name: name
branch: agnostic
Attributes and relationshipsβ
Attributes and relationships can be configured as branch-aware, branch-agnostic, or branch-local too, independently of the configuration of the model itself using the parameter branch.
nodes:
- name: Fruit
namespace: Example
branch: agnostic
attributes:
- kind: Text
name: name
branch: aware
By default, if a specific value is not defined:
- attributes will inherit the configuration of their parent model.
- relationships will become:
- branch-agnostic only if both models on each end of the relationship are branch-agnostic. If either model is branch-aware the relationship will be set as branch-aware.
- branch-local if either model, on each end of the relationship, is branch-local.
Restrictionsβ
The branch property cannot be updated on a Node, Generic, Attribute, or Relationship after the schema is first loaded. Plan your branch support strategy before the initial schema load.
Related conceptsβ
- Schema migration β Restrictions on properties that can be changed after initial load
- Branches β How branching works in Infrahub