Skip to content

Instantly share code, notes, and snippets.

@dijikul
Last active October 23, 2023 05:35
Show Gist options
  • Save dijikul/afe3fe81088fde9f69f8dbaa7a42e51a to your computer and use it in GitHub Desktop.
Save dijikul/afe3fe81088fde9f69f8dbaa7a42e51a to your computer and use it in GitHub Desktop.
Branching Strategy for Satellite Environments

Click here to see this graph rendered

gitGraph TB:
    # Future State Branching Model that enables Trunk-Based Development
    commit id: "..."
    commit id: "Current Prod v1.39" tag: "Fork current codebase to environment-specific branches"
    # Environment-specific Branching permits Automatic Merge-deploys with Pull Request Checkpoints
    # Q: Who should control what can be deployed to Prod and When?
    # Q: Do Pull Requests add value over current approvals?
    branch prod
    # Staging environment allows Testing of Pre-Prod Release Candidates
    branch staging
    # each Environments are created from Main (trunk) codebase
    branch develop
    # Satellite Environments Branch from Development to Integration to main pipelines
    checkout develop
    branch DF2
    checkout DF2
    commit tag: "Configuration & Setup"
    commit tag: "Config Change"
    branch DF2Feature1
    checkout DF2Feature1
    commit tag: "New Features"
    commit tag: "Fix bugs"
    commit tag: "Unit Tests"
    commit tag: "Document Code" id: "Completed Feature v1.0"
    checkout DF2
    merge DF2Feature1 tag: "Deployment to Sandbox" id: "DF2 v1.0"
    commit tag: "Parameterization" id: "DF2 v1.0.1"
    checkout DF2Feature1
    merge DF2 tag: "fetch parameterization DF2 v1.0.1"
    checkout DF2
    commit tag: "DF2 team experiment"
    checkout DF2
    commit tag: "DF2 Doing Whatever"
    # Lower Environments must Cherry-Pick into DE Dev for to selectively integrate features
    # This permits lower environment sandbox environments to remain open for experimentation
    checkout develop
    merge DF2Feature1 tag: "Cherry-Pick Sandbox DF2 v1.0.1"
    commit tag: "Deployment integration & code cleanup"
    checkout staging
    merge develop tag: "Deploy to Staging for pre-prod testing" id: "RC v1.40"
    checkout main
    merge staging tag: "Successful Staging Testing" id: "New Platform Version v1.40"
    checkout staging
    checkout prod
    merge main tag: "Deploy to Prod" id: "v1.40"
    checkout DF2
    commit
    commit
    checkout develop
    commit tag: "Data Engineer Changes"
    commit tag: "More DE Changes"
    commit tag: "DE Stuff" id: "New DE Features"
    checkout staging
    merge develop tag: "RC v1.41"
    checkout main
    merge staging id: "Platform v1.41"
    checkout prod
    merge main tag: "deploy to Prod" id: "Prod v1.41"
    branch DF2Feature2
    merge develop tag: "fork from Dev for new feature, or Main?"
    commit tag: "New feature" id: "DF2 v1.1"
    checkout DF2
    merge DF2Feature2 tag: "Deploy New Feature 2 to Sandbox"
    checkout develop
    merge DF2Feature2 tag: "Cherry-Pick DF2 Feature 2"
    checkout develop
    commit
    commit
    commit
    checkout staging
    merge develop tag: "pre release testing" id: "RC v1.42"
    checkout main
    merge staging tag: "successful teting in staging" id: "Platform v1.42"
    checkout prod
    merge main tag: "deploy to Prod" id: "Prod v1.42"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment