Automated repetitive setup actions and git actions
Developer can skip this section, this CLI is just for setup auto Gitflow for new project
-
build & run CLI
-
Choose project (list with maintainers permission)
- Delete all protected branch options
- Select old default branch (usually it's
develop
ormaster
)
- Create
main
branch - Set
main
branch as default - Delete old default branch
- Update project settings
DefaultBranch: main
RemoveSourceBranchAfterMerge: true
MergeMethod: FastForwardMerge
OnlyAllowMergeIfPipelineSucceeds: false
OnlyAllowMergeIfAllDiscussionsAreResolved: true
Will prompt to setup the squash setting vie GUI. Gitlab API doesn't allow setting this via API yet https://gitlab.com/gitlab-org/gitlab/-/issues/333945
- create
env/*
branches (enter twice to skip creating)
- Branch Name
- Branch Ref
- Protect branch
- protectBranch
main
withNoPermissions
for push andDeveloperPermissions
for merge - protectBranch
env/*
withNoPermissions
for push andMaintainerPermissions
for merge
- Setup webhook
-
Enter Webhook URL
-
[DANGER] Delete all other hooks
-
Add new webhook
-
To merge
PR
- Go to
PR
on Gitlab - Press
rebase
to perform FastForward merge without creating merge commit- If
rebase
failed when merge frommain
orenv/<envname>
toenv/<env_name>
- Comment
!force_merge
- Comment
- If
rebase
failed on other source and target branches, something is wrong
- If
- Update
squash
message (for changelog) - Press
merge
- Go to
-
New feature
- Create branch named
feature/<feature_name>
frommain
- When done, merge
PR
fromfeature/<feature_name>
tomain
- Create branch named
-
Hotfix
- Create branch named
hotfix/<fix_name>
frommain
- When done, merge
PR
fromhotfix/<fix_name>
tomain
- Merge
PR
fromcherryflow/hotfix/<fix_name>/env/<env_name>
toenv/<env_name>
- Create branch named
-
Deploy to environments
env/*
- Create
PR
from anything toenv/*
- Merge
PR
to deploy
- Create
RFC
means not finalize, need ideaTODO
not implemented
kubectl create ns gitflow
helm upgrade --install --namespace=gitflow devns ./helm --values values-override.yaml
Removed due to inability to change squash commit author/committer
- Create
PR
Title: "Draft: Merge 'feature/<feature_name> or hotfix/<fix_name>' into main",
Description: "TODO",
SourceBranch: "feature/<feature_name> or hotfix/<fix_name>",
TargetBranch: "main",
AssigneeID: "pusher id",
RemoveSourceBranch: true,
- [RFC]****[TODO] auto create
PR
frommain
to ???
-
For each
env/<env_name>
branch-
Auto create
cherryflow/hotfix/<fix_name>/env/<env_name>
branch fromenv/<env_name>
branch -
Cherry-pick all commits from
hotfix/<fix_name>
tocherryflow/hotfix/<fix_name>/env/<env_name>
branch -
Create
PR
-
Title: "Draft: Merge 'cherryflow/feature/<fix_name>/env/<env_name>' into env/<env_name>",
Description: "TODO",
SourceBranch: "cherryflow/feature/<fix_name>/env/<env_name>",
TargetBranch: "env/<env_name>",
AssigneeID: "pusher id",
RemoveSourceBranch: true,
- Handle
!force_merge
comment- Delete target branch
- Recreate target branch from source branch
- Close PR
- [RFC]****[TODO] Send notification with commits list
docker run -it -v $PWD:/data --rm --name markdown-toc-generator evkalinin/gh-md-toc:0.7.0 --insert /data/README.md