Skip to content

docs(git-integration): multi-environment pattern and promotion guide#9953

Draft
lancamat1 wants to merge 1 commit into
stablefrom
docs/multi-environment
Draft

docs(git-integration): multi-environment pattern and promotion guide#9953
lancamat1 wants to merge 1 commit into
stablefrom
docs/multi-environment

Conversation

@lancamat1

@lancamat1 lancamat1 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What

Adds two spokes under Branches & Change Control → Git Integration documenting how to run separate development / staging / production Infrahub instances from a single Git repository, and how to promote changes between them.

  • docs/docs/git-integration/multi-environment.mdxconcept: the all-read-only, branch-per-environment model; what moves through Git (.infrahub.yml content); Git-vs-Infrahub terminology; the staged promotion model (import into an Infrahub branch, review via a proposed change); and reaching production safely.
  • docs/docs/git-integration/promote-between-environments.mdxhow-to: register a read-only repository per instance, author a change, the staged promotion flow, and an optional/experimental CI automation note.
  • docs/sidebars.ts — two entries under Git Integration.

Key points of the documented model

  • Every environment is a read-only consumer pinned to one long-lived Git branch via ref; no instance uses a read-write Repository, and nothing is pushed back to Git.
  • Read-only repositories never auto-import — imports are always triggered manually (UI) or via API.
  • Promotion is staged: import into an Infrahub branch and merge via a proposed change; importing straight to main is a caveated side-note, not recommended.
  • The environment count is an example (dev/staging/prod) — 2 or 5 work identically.
  • No clean rollback is claimed; safety comes from rehearsing on a pre-production instance restored from a current production backup.

For reviewers

  • Placement under Git Integration is provisional — flag if this should be a top-level section instead.
  • The "Automate the promotion" section is intentionally marked optional/experimental. A fully automated PC-merge gate is blocked by open behavior: a proposed-change merge currently carries a read-only repository's branch-aware ref/commit onto the destination branch, which would repoint an instance's main. That behavior is under review (internal ticket; relates to IFC-1361) — the docs deliberately keep production promotion manual until it's resolved.
  • Product framing (positioning / "who this is for") is expected to be iterated post-merge by product.
  • <repository-id> and host placeholders are intentional; the reader substitutes their own.

Verification

  • Facts verified against backend source (mutation/type names, ref vs default_branch, CoreValidator state/conclusion, CoreProposedChange.validations, .infrahub.yml importable content).
  • npm run build passes; all cross-links and anchors resolve; Vale/banned-qualifier scan clean.

🤖 Generated with Claude Code


Summary by cubic

Adds docs for running multiple Infrahub environments from one Git repo using read-only repositories and a staged promotion workflow. Includes a concepts page and a step-by-step guide that adds a Tag color attribute and promotes it from dev to prod.

  • New Features
    • Added docs/docs/git-integration/multi-environment.mdx (concepts): branch-per-environment via ref; what moves via .infrahub.yml; read-only repos import only on action (no polling); staged promotion via Infrahub branches and proposed changes; explicit schema retirement with state: absent; rehearse production on a pre-prod from backup; avoid importing directly on main.
    • Added docs/docs/git-integration/promote-between-environments.mdx (how-to): register per-instance read-only repos (CoreReadOnlyRepositoryCreate); develop on an Infrahub branch by pointing ref to a Git feature branch (CoreReadOnlyRepositoryUpdate auto-imports); merge to develop, then bring the merged result onto main via a proposed change; mirror flow to promote developmain on production; includes a production verify step; optional CI that polls CoreProposedChange.validations using X-INFRAHUB-KEY.
    • Updated docs/sidebars.ts with “Multiple environments” and “Promote between environments” under Git Integration.

Written for commit 2bdff2e. Summary will update on new commits.

Review in cubic

@github-actions github-actions Bot added the type/documentation Improvements or additions to documentation label Jul 17, 2026
@lancamat1
lancamat1 force-pushed the docs/multi-environment branch from 884ad77 to dbce6e8 Compare July 17, 2026 11:45
@lancamat1
lancamat1 changed the base branch from develop to stable July 17, 2026 11:45

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed

Confidence score: 5/5

  • Safe to merge after the addressed issues were fixed.

Shadow auto-approve: would not auto-approve because issues were found.

Re-trigger cubic

Comment thread docs/docs/git-integration/promote-between-environments.mdx Outdated
Comment thread docs/docs/git-integration/multi-environment.mdx Outdated
Comment thread docs/docs/git-integration/promote-between-environments.mdx Outdated
@lancamat1
lancamat1 force-pushed the docs/multi-environment branch 11 times, most recently from 4a8980a to d68eac6 Compare July 21, 2026 19:56
@lancamat1
lancamat1 force-pushed the docs/multi-environment branch 3 times, most recently from fa4fc56 to 8fd55ed Compare July 21, 2026 20:11
Add two spokes under Git Integration for running separate dev/staging/prod
Infrahub instances from a single repository:

- multi-environment.mdx (concept): the all-read-only, branch-per-environment
  model, what moves through Git, Git-vs-Infrahub terminology, the staged
  promotion model, and reaching production safely.
- promote-between-environments.mdx (how-to): register read-only repos per
  instance, author, the staged promotion flow (import into an Infrahub branch,
  review via proposed change), and an optional/experimental CI automation note.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lancamat1
lancamat1 force-pushed the docs/multi-environment branch from 8fd55ed to 2bdff2e Compare July 21, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant