Create proposed changes
Proposed changes provide a structured workflow for reviewing, validating, and merging branch changes into the main branch. This guide shows you how to create, review, and merge proposed changes.Prerequisites
Before working with proposed changes, ensure you have:- An existing branch with changes to merge
- Appropriate permissions to create and merge proposed changes
- GraphQL API access or SDK installed (if using programmatic methods)
Create a proposed change
Create a proposed change to initiate the review and validation process for your branch.Using GraphQL
source_branch(required): The branch containing your changesdestination_branch(required): The target branch (typicallymain)name(required): Short, descriptive name for the proposed changedescription(optional): Detailed explanation of the changes
Using the Python SDK
View proposed change details
Retrieve information about a proposed change, including its state, checks, and diff.Query proposed change
List all proposed changes
Proposed change states
Proposed changes follow a lifecycle with specific states:- OPEN: Active and ready for review
- MERGED: Successfully merged into the destination branch
- MERGING: Currently being merged
- CLOSED: Closed without merging
- CANCELED: Canceled and cannot be reopened
backend/infrahub/proposed_change/constants.py:14.
Check validation results
Proposed changes automatically run validation checks. View check results to ensure your changes are ready to merge.Query checks
DataIntegrity: Validates referential integritySchemaIntegrity: Validates schema changesRepositoryCheck: Checks Git repository consistencyUserCheck: Custom user-defined checksArtifactGeneration: Validates artifact generationGeneratorExecution: Validates Generator execution
success: Check passedfailure: Check failed (blocks merge)unknown: Check status unknown
Review and approve changes
Add reviewers and approvals to proposed changes.Add a reviewer
Approve a proposed change
Approve the proposed change using the approval action:Reject a proposed change
Cancel approval or rejection
View the diff
Retrieve the diff between source and destination branches to understand what changes will be merged.ADDED: New object or attributeUPDATED: Modified object or attributeREMOVED: Deleted object or attributeUNCHANGED: No changes
Merge a proposed change
Merge the proposed change after it passes all checks and receives required approvals.Using the branch merge mutation
wait_until_completion(optional, default:true): Wait for merge to complete
wait_until_completion is false, the mutation returns a task ID:
Merge requirements
Before merging, ensure:- All validation checks pass (no failing checks)
- All conflicts are resolved
- Required approvals are obtained (if configured)
- Branch status is
OPEN(notNEED_REBASEorNEED_UPGRADE_REBASE)
- The branch has conflicts with the main branch
- Any validation checks have failed
- The branch status is
NEED_UPGRADE_REBASE
backend/infrahub/graphql/mutations/branch.py:270.
Close a proposed change
Close a proposed change without merging when it’s no longer needed:Common patterns
Create a draft proposed change
Create a proposed change in draft mode for early feedback:Verify all checks passed
Before merging, verify all checks have passed:conclusion: "success" before proceeding with the merge.
Verify merge completion
After merging, verify the branch status and proposed change state:Related resources
- Work with branches - Create and manage branches
- Resolve merge conflicts - Handle conflicts in proposed changes
- Proposed change topic - Understand how proposed changes work
- Checks topic - Learn about validation checks