Graficar ejemplo completo de integrar GitFlow y GitLab MRs
- AUTHOR: Osiris Alejandro Gomez
- EMAIL: osiux@osiux.com
- DATE: 2023-05-12 09:30
#+ATTR_HTML: :title Git Flow Full Example with branch develop, master, support 0.1x, support 0.2.x and four tags include GitLab Pipeline Status, Ready and Approve MR for branchs feature, hotfix and release
[IMG]
[1]
Hace 10 aΓ±os que uso `git flow` ^1[2] en `gcoop` ^2[3] y hace 2 aΓ±os que en un proyecto grande lo usamos conjuntamente con el circuito de `MRs` ^3[4] de `GitLab` ^4[5] para clarificar un poco todo el proceso decidΓ utilizar `GraphViz`
En el diagrama de ejemplo se plantean 2 *features* (`foo` y `bar`), cada uno es para un *release* en particular (`v0.1.0` y `v0.2.0`) y posterior a cada *release* se generan 2 *hotfix* (`v0.1.1` y `v0.2.2`).
El `cΓ³digo del grafo` ^5[6] esta disponible en el *repo* `osiux-graphviz` ^6[7]
El flujo de desarrollo es idΓ©ntico tanto para `feature`, `release` y `hotfix`, es decir, todos los *branchs* requieren los siguientes pasos:
1. Crear *branch* e inmediatamente, crear *MR* en *Draft*
2. Desarrollar *feature*, *release* y/o *hotfix*
3. Verificar *Pipeline Success* de *GitLab* (caso contrario volver a 2)
4. Si el desarrollo esta listo, marcar *Ready*
5. Revisar *MR* y Aprobar solo si hay *PS* (caso contrario volver a 2)
6. Si se completaron todos los pasos anteriores, realizar *merge*
βββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββ¬ββββββββββ¬βββββββββ
β *type* β *tag/br β *Create β *PS* β *Ready* β *Review β *Approv β *Merge β
β β anch* β MR* β β β MR* β e* β * β
βββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺββββββββββͺβββββββββ‘
β β `v0.1.0 β β β β β β β
β *Tag Re β , β β *GitLab β β β β β
β leases* β v0.2.0, β *N/A* β * β *N/A* β *N/A* β *N/A* β *N/A* β
β β v0.1.1, β β β β β β β
β β v0.2.2` β β β β β β β
βββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββ€
β β `master β β β β β β β
β *Stable β , suppo β β β β β β β
β Release β rt/0.1. β *N/A* β *GitLab β *N/A* β *N/A* β *N/A* β *N/A* β
β s* β x, supp β β * β β β β β
β β ort/0.2 β β β β β β β
β β .x` β β β β β β β
βββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββ€
β β `releas β β β β β β β
β *Releas β e/0.1.0 β *Develo β *GitLab β *Develo β *Mantai β *Mantai β *Manta β
β e Branc β , relea β per* β * β per* β ner* β ner* β iner* β
β hs* β se/0.2. β β β β β β β
β β 0` β β β β β β β
βββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββ€
β *Hotfix β `hotfix β β β β β β β
β Branchs β /0.1.1, β *Develo β *GitLab β *Develo β *Mantai β *Mantai β *Manta β
β * β hotfix/ β per* β * β per* β ner* β ner* β iner* β
β β 0.2.2` β β β β β β β
βββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌββββββββββΌβββββββββ€
β *Featur β `featur β β β β β β β
β e Branc β e/foo, β *Develo β *GitLab β *Develo β *Mantai β *Mantai β *Manta β
β hs* β feature β per* β * β per* β ner* β ner* β iner* β
β β /bar` β β β β β β β
βββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄ββββββββββ΄βββββββββ
*feature*, *release* y *tag*
- β crear *issue* en `project#123`
- β crear *branch* `feature/foo` saliendo de `develop` en el *repo* que corresponda
- β crear *MR* `Draf: Resolve feature/foo "Issue Tittle"` con `Closes project#123`
- β *branch* `feature/foo` debe tener *MR* con *PS*
- β crear documentaciΓ³n en *wiki* `foo/foo_bar_vM.N.P`
- β *branch* `release/M.N.P` debe tener *PS*
- β *tag* `vM.N.P`
*hotfix*
- β crear *branch* `support/M.N.x` saliedo de *tag* `vM.M.x`
- β crear *branch* `hotfix/foobar` saliendo de `support/M.N.x`
- β *branch* `hotfix/foobar` debe tener *MR* con *PS*
Referencias
βββββββββββ¬ββββββββββββββββββββββ
β item β descripciΓ³n β
βββββββββββͺββββββββββββββββββββββ‘
β *MR* β *Merge Request* β
βββββββββββΌββββββββββββββββββββββ€
β *PS* β *Pipeline Success* β
βββββββββββΌββββββββββββββββββββββ€
β `M.N.P` β `MAJOR.MINOR.PATCH` β
βββββββββββ΄ββββββββββββββββββββββ
Tal vez te interese leer
- Automate conversion of blog from *org-mode* to *Html*, *Markdown* and *Gemini* using *Docker image* `alpine-org2blog` and *GitLab CI*[8]
- howto launch gitlab ci from other gitlab ci repo using trigger[9]
- Automatizar la implementaciΓ³n de los recursos de AWX con GitLab CI/CD y Ansible Tools[10]
- cΓ³mo usar *GitLab* desde la lΓnea de comandos[11]
ChangeLog
- `2023-05-12 10:40`[12] agregar *Graficar ejemplo completo de integrar GitFlow y GitLab MRs*
1: file:img/git-flow-full.png
2: https://nvie.com/posts/a-successful-git-branching-model/
3: https://www.gcoop.coop/
4: https://docs.gitlab.com/ee/user/project/merge_requests/
5: https://docs.gitlab.com/omnibus/installation/
6: https://gitlab.com/osiux/osiux-graphviz/-/raw/develop/dot/git-flow-full.dot
7: https://gitlab.com/osiux/osiux-graphviz/
8: 2023-02-24-automate-blog-from-org-mode-to-html-markdown-gemini-using-docker-alpine-org2blog-and-gitlab-ci.gmi
9: 2023-02-14-howto-launch-gitlab-ci-from-other-gitlab-ci-repo-using-trigger.gmi
10: 2022-10-08-automate-deployment-of-AWX-resources-with-GitLab-CI-CD-and-ansible-tools.gmi
11: 2022-08-21-howto-use-gitlab-from-command-line.gmi
12: https://gitlab.com/osiux/osiux.gitlab.io/-/commit/7b750e2424e400fd1a78e5a5e95095ba39d8fa87