fix: add human_friendly_id to 4 schemas for idempotent Repository sync #29

Merged
Damien merged 1 commits from fix/human-friendly-id into main 2026-03-03 16:26:47 +00:00
Owner

Summary

  • Add local_identifier attribute + uniqueness_constraints + human_friendly_id to InfraVlanVniMapping, InfraEVPNInstance, InfraMlagInterface, and InfraUnderlayLink, following the same pattern already used for InfraBGPPeerGroup and InfraBGPSession
  • Populate local_identifier in all corresponding object YAML files with deterministic composite keys so Infrahub can upsert objects during Repository backend sync instead of creating duplicates

Schema changes

Schema file Model human_friendly_id
infrahub/schemas/vlan_vxlan.yml InfraVlanVniMapping local_identifier__value
infrahub/schemas/vlan_vxlan.yml InfraEVPNInstance local_identifier__value
infrahub/schemas/mlag.yml InfraMlagInterface local_identifier__value
infrahub/schemas/extensions.yml InfraUnderlayLink local_identifier__value

Object file changes

Object file Kind Key format Example
infrahub/objects/06-vlans-vxlan.yml InfraVlanVniMapping {device}__vlan{vlan_id}__vni{vni_id} leaf1__vlan40__vni110040
infrahub/objects/06-vlans-vxlan.yml InfraEVPNInstance {device}__vlan{vlan_id} leaf1__vlan40
infrahub/objects/12-mlag.yml InfraMlagInterface mlag{id}__{device1}-{device2} mlag1__leaf1-leaf2
infrahub/objects/14-fabric-links.yml InfraUnderlayLink {local_dev}-{local_intf}__{remote_dev}-{remote_intf} spine1-eth1__leaf1-eth11

Note: InfraMlagInterface objects (4 entries, one per MLAG pair) and InfraUnderlayLink objects (16 entries, all spine↔leaf P2P links) are new additions to their respective files.

Test plan

  • infrahubctl schema load infrahub/schemas/*.yml succeeds without errors
  • infrahubctl object load infrahub/objects/06-vlans-vxlan.yml succeeds
  • infrahubctl object load infrahub/objects/12-mlag.yml succeeds
  • infrahubctl object load infrahub/objects/14-fabric-links.yml succeeds
  • Re-running the same load is idempotent (no duplicate objects created)
  • Gitea Repository backend sync completes without import errors

🤖 Generated with Claude Code

## Summary - Add `local_identifier` attribute + `uniqueness_constraints` + `human_friendly_id` to **InfraVlanVniMapping**, **InfraEVPNInstance**, **InfraMlagInterface**, and **InfraUnderlayLink**, following the same pattern already used for `InfraBGPPeerGroup` and `InfraBGPSession` - Populate `local_identifier` in all corresponding object YAML files with deterministic composite keys so Infrahub can upsert objects during Repository backend sync instead of creating duplicates ## Schema changes | Schema file | Model | human_friendly_id | |---|---|---| | `infrahub/schemas/vlan_vxlan.yml` | `InfraVlanVniMapping` | `local_identifier__value` | | `infrahub/schemas/vlan_vxlan.yml` | `InfraEVPNInstance` | `local_identifier__value` | | `infrahub/schemas/mlag.yml` | `InfraMlagInterface` | `local_identifier__value` | | `infrahub/schemas/extensions.yml` | `InfraUnderlayLink` | `local_identifier__value` | ## Object file changes | Object file | Kind | Key format | Example | |---|---|---|---| | `infrahub/objects/06-vlans-vxlan.yml` | `InfraVlanVniMapping` | `{device}__vlan{vlan_id}__vni{vni_id}` | `leaf1__vlan40__vni110040` | | `infrahub/objects/06-vlans-vxlan.yml` | `InfraEVPNInstance` | `{device}__vlan{vlan_id}` | `leaf1__vlan40` | | `infrahub/objects/12-mlag.yml` | `InfraMlagInterface` | `mlag{id}__{device1}-{device2}` | `mlag1__leaf1-leaf2` | | `infrahub/objects/14-fabric-links.yml` | `InfraUnderlayLink` | `{local_dev}-{local_intf}__{remote_dev}-{remote_intf}` | `spine1-eth1__leaf1-eth11` | Note: `InfraMlagInterface` objects (4 entries, one per MLAG pair) and `InfraUnderlayLink` objects (16 entries, all spine↔leaf P2P links) are new additions to their respective files. ## Test plan - [x] `infrahubctl schema load infrahub/schemas/*.yml` succeeds without errors - [x] `infrahubctl object load infrahub/objects/06-vlans-vxlan.yml` succeeds - [x] `infrahubctl object load infrahub/objects/12-mlag.yml` succeeds - [x] `infrahubctl object load infrahub/objects/14-fabric-links.yml` succeeds - [x] Re-running the same load is idempotent (no duplicate objects created) - [x] Gitea Repository backend sync completes without import errors 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Damien added 1 commit 2026-03-03 16:20:12 +00:00
Add local_identifier attribute (kind: Text) + uniqueness_constraints +
human_friendly_id to InfraVlanVniMapping, InfraEVPNInstance,
InfraMlagInterface and InfraUnderlayLink so Infrahub can perform
upserts during Repository backend sync instead of duplicating objects
on every import.

Schema changes (following the InfraBGPPeerGroup/BGPSession pattern):
- infrahub/schemas/vlan_vxlan.yml: VlanVniMapping + EVPNInstance
- infrahub/schemas/mlag.yml: MlagInterface
- infrahub/schemas/extensions.yml: UnderlayLink

Object file updates:
- 06-vlans-vxlan.yml: local_identifier added to all VlanVniMapping and
  EVPNInstance entries (format: leaf1__vlan40__vni110040 / leaf1__vlan40)
- 12-mlag.yml: InfraMlagInterface section added for all 4 MLAG pairs
  (format: mlag1__leaf1-leaf2)
- 14-fabric-links.yml: InfraUnderlayLink section added for all 16
  spine↔leaf P2P links (format: spine1-eth1__leaf1-eth11)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Damien merged commit 12d927d460 into main 2026-03-03 16:26:47 +00:00
Damien deleted branch fix/human-friendly-id 2026-03-03 16:26:51 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Damien/arista-evpn-vxlan-clab#29