Skip to main content

Plan changes on a branch

Use a branch to draft IP prefix and address changes, review exactly what will change, and merge once you're confident — the same version-control workflow Infrahub applies to the rest of your infrastructure data.

The workflow​

Create a branch, then create, update, or delete IP namespaces, prefixes, and addresses on it through the web interface, GraphQL, or the Python SDK — the same way you would on the default branch. See Create a branch if you haven't created one before.

Once your changes are ready, open a Proposed Change to review them. The Data tab shows exactly which prefixes, addresses, and namespaces were added, modified, or deleted, and which attributes changed on each. Merge once the review is complete — see Merge a branch for what happens at merge time.

What reconciles on merge​

IPAM hierarchy reconciliation runs immediately after each mutation on a branch, so the branch's own prefix and address tree stays consistent while you work. When the branch merges or is rebased, Infrahub reads the diff between the two branches, identifies which prefixes and addresses changed, and reconciles only those, reassigning parent prefixes, child prefixes, and address-to-prefix associations as needed on the branch being merged into, or on the rebased branch.

Concurrency​

Infrahub handles one allocation request at a time for each resource pool, on any branch and across every Infrahub worker. Two clients requesting the next address or prefix from the same pool at the same time get different values. See Concurrent requests on the Resource Manager page.

Creating or updating a prefix with an explicit value is locked on any branch as well, so two clients cannot create the same prefix concurrently. Creating or updating an address with an explicit value is locked per namespace only on the default branch, so on other branches concurrent clients creating different addresses do not wait for each other. When the address schema declares a uniqueness constraint, creates of the same address value are locked on any branch: one create succeeds and the others are rejected with the uniqueness error.

Worked example: redesign a subnet on a branch​

Continuing the ISP example from Use namespaces: Customer A's network team needs to split their 10.0.0.0/16 supernet into two /17 subnets ahead of a datacenter migration.

  1. Create a branch: customer-a-subnet-redesign.
  2. On the branch, create the two 10.0.0.0/17 and 10.0.128.0/17 prefixes in the customer-a namespace, both with 10.0.0.0/16 as their parent.
  3. Move the existing /24 and /26 prefixes under whichever new /17 contains them — Infrahub re-parents each one automatically based on its network containment.
  4. Open a Proposed Change and review the Data tab: the new /17 prefixes appear as additions, and each moved prefix shows its parent relationship changing from 10.0.0.0/16 to the matching /17.
  5. Merge. Infrahub reconciles the hierarchy of the customer-a namespace on the default branch to match.