Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Git Workflow Sample

metaory edited this page Oct 26, 2022 · 5 revisions

mxflow v0.47.21

Sample config

sample-generated-config-file
version: 0.63.0
sleep: 1000
exit_on_error: false
workflows:
  resolve-conflict-dev:
    description: create resolve conflict branch
    steps:
      - git fetch --all
      - git checkout -b resolved-conflict/{current-branch}
      - git push --set-upstream origin resolved-conflict/{current-branch}
      - git merge origin/dev
  sync-master:
    description: sync branch with master
    steps:
      - git fetch --all
      - git merge origin/master
  create-flight:
    description: create new flight branch workflow
    args:
      - name: taskId
        type: string
      - name: description
        type: string
    steps:
      - echo running {workflow}
      - git fetch origin
      - git checkout master
      - git merge origin/master
      - git checkout -b flight/{description}
      - git status
      - confirm git push --set-upstream origin flight/{description}
      - list-logs:
          limit: 100
      - log-bugtracker:
          bugtracker: "{MXF_BUG_TRACKER_NAME}"
          tenant: "{MXF_BUG_TRACKER_TENANT}"
  create-feature:
    description: create new feature branch workflow
    args:
      - name: taskId
        type: string
      - name: description
        type: string
    steps:
      - echo running {workflow}
      - git fetch origin
      - git checkout master
      - git merge origin/master
      - checkout-branch:
          base: flight
      - git checkout -b feature/{taskId}-{description}
      - git status
      - confirm git push --set-upstream origin feature/{taskId}-{description}
      - list-logs:
          limit: 100
      - log-bugtracker:
          bugtracker: "{MXF_BUG_TRACKER_NAME}"
          tenant: "{MXF_BUG_TRACKER_TENANT}"
  create-bugfix:
    description: create new bugfix branch workflow
    args:
      - name: taskId
        type: string
      - name: description
        type: string
    steps:
      - echo running {workflow}
      - git fetch origin
      - git checkout master
      - git merge origin/master
      - checkout-branch:
          base: flight
      - git checkout -b bugfix/{taskId}-{description}
      - git status
      - confirm git push --set-upstream origin bugfix/{taskId}-{description}
      - list-logs:
          limit: 100
      - log-bugtracker:
          bugtracker: "{MXF_BUG_TRACKER_NAME}"
          tenant: "{MXF_BUG_TRACKER_TENANT}"
  create-other:
    description: create new other branch workflow
    args:
      - name: taskId
        type: string
      - name: description
        type: string
    steps:
      - echo running {workflow}
      - git fetch origin
      - git checkout master
      - git merge origin/master
      - checkout-branch:
          base: flight
      - git checkout -b other/{taskId}-{description}
      - git status
      - confirm git push --set-upstream origin other/{taskId}-{description}
      - list-logs:
          limit: 100
      - log-bugtracker:
          bugtracker: "{MXF_BUG_TRACKER_NAME}"
          tenant: "{MXF_BUG_TRACKER_TENANT}"
  create-hotfix:
    description: create new hotfix branch workflow
    args:
      - name: taskId
        type: string
      - name: description
        type: string
    steps:
      - echo running {workflow}
      - git fetch origin
      - git checkout master
      - git merge origin/master
      - git checkout -b hotfix/{taskId}-{description}
      - git status
      - confirm git push --set-upstream origin hotfix/{taskId}-{description}
      - list-logs:
          limit: 100
      - log-bugtracker:
          bugtracker: "{MXF_BUG_TRACKER_NAME}"
          tenant: "{MXF_BUG_TRACKER_TENANT}"

TL;DR

The Default configs

branch create from can sync from branch name
flight master master flight/{description}
hotfix master master hotfix/{taskId}-{description}
feature flight parent flight feature/{taskId}-{description}
bugfix flight parent flight bugfix/{taskId}-{description}
other flight parent flight other/{taskId}-{description}

Hotfix branch:

  • Can only be created from master
  • While branch in active, can sync from master
  • Cannot take pull from dev
  • Should not take pull from another feature / flight / hotfix branch

Flight branch:

  • Will only be created from master
  • Can sync from master
  • Cannot sync from dev

feature/bugfix/other in Flight (Child branch -> Flight branch):

  • Task branches (feature/bugfix/other) should be created from the Flight branch
  • Cannot take pull from any branch but Flight branch
  • Can take pull from a sibling branch of the same flight if it depends on it

Flights(trunk)

  • flight is for the features, bugs, and improvements corresponding to the flight (epic) in the BugTracking system
  • Ticket branches can be created from a flight branch.
  • There are 3 ticket branch prefixes: featurebugfix, and other. These branches require a BugTracking task ID in their names.
  1. feature is for the small packed features inside the flight.
  2. bugfix is for the fixes and issues related to the flight.
  3. other is used for non-technical issues like documentation or infrastructure improvements, etc.

Hotfix

  • hotfix is dedicated to fixes regarding critical issues in the production environment.
Clone this wiki locally