git-flow-envs 1.14.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. git_flow_envs-1.14.0/.flowconfig +4 -0
  2. git_flow_envs-1.14.0/.gitignore +11 -0
  3. git_flow_envs-1.14.0/.python-version +1 -0
  4. git_flow_envs-1.14.0/CHANGELOG.md +299 -0
  5. git_flow_envs-1.14.0/PKG-INFO +101 -0
  6. git_flow_envs-1.14.0/README.md +92 -0
  7. git_flow_envs-1.14.0/bitbucket-pipelines.yml +16 -0
  8. git_flow_envs-1.14.0/pyproject.toml +20 -0
  9. git_flow_envs-1.14.0/pyrightconfig.json +6 -0
  10. git_flow_envs-1.14.0/setup.cfg +4 -0
  11. git_flow_envs-1.14.0/src/git_flow/__init__.py +63 -0
  12. git_flow_envs-1.14.0/src/git_flow/changelog.py +59 -0
  13. git_flow_envs-1.14.0/src/git_flow/command/__init__.py +0 -0
  14. git_flow_envs-1.14.0/src/git_flow/command/base.py +236 -0
  15. git_flow_envs-1.14.0/src/git_flow/command/branch.py +117 -0
  16. git_flow_envs-1.14.0/src/git_flow/command/commit.py +62 -0
  17. git_flow_envs-1.14.0/src/git_flow/command/init.py +115 -0
  18. git_flow_envs-1.14.0/src/git_flow/command/merge.py +111 -0
  19. git_flow_envs-1.14.0/src/git_flow/command/new.py +56 -0
  20. git_flow_envs-1.14.0/src/git_flow/command/release.py +105 -0
  21. git_flow_envs-1.14.0/src/git_flow/command/tag.py +107 -0
  22. git_flow_envs-1.14.0/src/git_flow/git.py +179 -0
  23. git_flow_envs-1.14.0/src/git_flow/io.py +56 -0
  24. git_flow_envs-1.14.0/src/git_flow/main.py +90 -0
  25. git_flow_envs-1.14.0/src/git_flow/remote/base.py +75 -0
  26. git_flow_envs-1.14.0/src/git_flow/remote/bitbucket.py +47 -0
  27. git_flow_envs-1.14.0/src/git_flow/remote/github.py +21 -0
  28. git_flow_envs-1.14.0/src/git_flow_envs.egg-info/PKG-INFO +101 -0
  29. git_flow_envs-1.14.0/src/git_flow_envs.egg-info/SOURCES.txt +32 -0
  30. git_flow_envs-1.14.0/src/git_flow_envs.egg-info/dependency_links.txt +1 -0
  31. git_flow_envs-1.14.0/src/git_flow_envs.egg-info/entry_points.txt +2 -0
  32. git_flow_envs-1.14.0/src/git_flow_envs.egg-info/requires.txt +1 -0
  33. git_flow_envs-1.14.0/src/git_flow_envs.egg-info/top_level.txt +1 -0
  34. git_flow_envs-1.14.0/uv.lock +144 -0
@@ -0,0 +1,4 @@
1
+ [flow]
2
+ remote = origin
3
+ branches = main
4
+ initialized = true
@@ -0,0 +1,11 @@
1
+ # Bitbucket token
2
+ .repository-token
3
+
4
+ # Virtual environment
5
+ venv/
6
+
7
+ # Build folders and artifacts
8
+ dist/
9
+ build/
10
+ **/__pycache__/
11
+ **/*.egg-info/
@@ -0,0 +1 @@
1
+ 3.10
@@ -0,0 +1,299 @@
1
+ ## v1.14.0 - 2026-02-11
2
+
3
+ - **feature**: actualizar nombre de proyecto en uv.lock [[jteran](mailto:jteran@renatre.org.ar)] (9cd0b25)
4
+
5
+ ---
6
+
7
+
8
+ ## v1.13.1 - 2026-02-11
9
+
10
+ - **bugfix**: test pipeline change [[jteran](mailto:jteran@renatre.org.ar)] (f2eb5af)
11
+
12
+ ---
13
+
14
+
15
+ ## v1.13.0 - 2026-02-11
16
+
17
+ - **feature**: actualizo nombre y descripcion del proyecto [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (41d6957)
18
+
19
+ ---
20
+
21
+
22
+ ## v1.12.3 - 2026-02-11
23
+
24
+ - **bugfix**: taggeo todos los commits localmente, incluso en ci [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (5d23bb6)
25
+
26
+ ---
27
+
28
+
29
+ ## v1.12.2 - 2026-02-10
30
+
31
+ - **bugfix**: test pipeline change [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (98bf7e7)
32
+
33
+ ---
34
+
35
+
36
+ ## v1.12.1 - 2026-02-10
37
+
38
+ - **bugfix**: agrego paso de build al pipeline [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (ade86f1)
39
+
40
+ ---
41
+
42
+
43
+ ## v1.12.0 - 2026-02-10
44
+
45
+ - **feature**: cambio pipelines para usar uv package manager [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (0f700b0)
46
+
47
+ ---
48
+
49
+
50
+ ## v1.11.0 - 2025-12-22
51
+
52
+ - **feature**: al agrupar release, mergear cambios en rama group [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (726c73a)
53
+ - **feature**: usar commit message cuando el pr solo tiene un commit [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (057b32a)
54
+ - **feature**: eliminar prompt de ticket en creacion de rama [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (c0e2e59)
55
+ - **feature**: deshacer rebase cuando este falla en el pasaje de cambios [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (77e338d)
56
+ - **bugfix**: uso titulo personalizado de PR [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (1aa2263)
57
+
58
+ ---
59
+
60
+
61
+ ## v1.10.0 - 2025-12-15
62
+
63
+ - **feature**: agrego opcion para cambiar a rama objetivo y obtener cambios [[jteran](mailto:jteran@renatre.org.ar)] (df8998a)
64
+ - **feature**: agrego opcion para personalizar nombre de PR [[jteran](mailto:jteran@renatre.org.ar)] (c87b141)
65
+
66
+ ---
67
+
68
+
69
+ ## v1.9.1 - 2025-12-15
70
+
71
+ - **bugfix**: uso rama actual cuando esta es un entorno [[jteran](mailto:jteran@renatre.org.ar)] (c54cb95)
72
+
73
+ ---
74
+
75
+
76
+ ## v1.9.0 - 2025-12-15
77
+
78
+ - **bugfix**: uso env actual en vez de rama actual para listar ramas [[jteran](mailto:jteran@renatre.org.ar)] (5d33b29)
79
+ - **feature**: listar ramas de todos los entornos con flag --all, y del entorno actual por defecto [[jteran](mailto:jteran@renatre.org.ar)] (104b321)
80
+ - **feature**: agrego opcion para listar ramas wip [[jteran](mailto:jteran@renatre.org.ar)] (774cf9a)
81
+ - **refactor**: cambio opcion para listar ramas trash [[jteran](mailto:jteran@renatre.org.ar)] (74c333a)
82
+ - **bugfix**: elimino : extra de comando new [[jteran](mailto:jteran@renatre.org.ar)] (499babc)
83
+
84
+ ---
85
+
86
+
87
+ ## v1.8.0 - 2025-12-15
88
+
89
+ - **feature**: agrego opcion para incluir ticket en nombre de rama [[jteran](mailto:jteran@renatre.org.ar)] (01e938e)
90
+ - **feature**: mostrar warning si la rama actual no es un entorno configurado [[jteran](mailto:jteran@renatre.org.ar)] (97b4a56)
91
+ - **feature**: hacer pull en rama actual antes de crear nueva rama [[jteran](mailto:jteran@renatre.org.ar)] (24be501)
92
+
93
+ ---
94
+
95
+
96
+ ## v1.7.5 - 2025-12-14
97
+
98
+ - **bugfix**: verificar si la rama grupo trackea una rama remota antes de hacer pull [[jteran](mailto:jteran@renatre.org.ar)] (0d95a97)
99
+ - **bugfix**: capturo interrupion por teclado para no mostrar stack trace [[jteran](mailto:jteran@renatre.org.ar)] (0af5102)
100
+
101
+ ---
102
+
103
+
104
+ ## v1.7.4 - 2025-12-14
105
+
106
+ - **bugfix**: generación de PR de ramas release [[jteran](mailto:jteran@renatre.org.ar)] (b24b22a)
107
+
108
+ ---
109
+
110
+
111
+ ## v1.7.3 - 2025-12-14
112
+
113
+ - **bugfix**: listado de ramas para elegir grupo release no devolvia resultados [[jteran](mailto:jteran@renatre.org.ar)] (5600e5e)
114
+
115
+ ---
116
+
117
+
118
+ ## v1.7.2 - 2025-12-11
119
+
120
+ - **bugfix**: al hacer un release, cambio a la rama grupo si esta disponible [[jteran](mailto:jteran@renatre.org.ar)] (44b8efd)
121
+
122
+ ---
123
+
124
+
125
+ ## v1.7.1 - 2025-12-11
126
+
127
+ - **bugfix**: cambio la forma en la que se obtiene el first fork point entre 2 ramas [[jteran](mailto:jteran@renatre.org.ar)] (7b4fb34)
128
+
129
+ ---
130
+
131
+
132
+ ## v1.7.0 - 2025-12-11
133
+
134
+ - **feature**: muestro el listado de commits a pasar al siguiente entorno en release [[jteran](mailto:jteran@renatre.org.ar)] (2e65cb7)
135
+
136
+ ---
137
+
138
+
139
+ ## v1.6.4 - 2025-12-10
140
+
141
+ - **bugfix**: cambio la lista de commits a mostrar en el merge [[jteran](mailto:jteran@renatre.org.ar)] (4e089dc)
142
+
143
+ ---
144
+
145
+
146
+ ## v1.6.3 - 2025-12-04
147
+
148
+ - **bugfix**: revertir guion entre version y entorno, agregar guion a sufijo [[jteran](mailto:jteran@renatre.org.ar)] (7ce6add)
149
+ - **bugfix**: agrego guion entre version y nombre de entorno [[jteran](mailto:jteran@renatre.org.ar)] (053b8b1)
150
+
151
+ ---
152
+
153
+
154
+ ## v1.6.3- - 2025-12-04
155
+
156
+ - **bugfix**: agrego guion entre version y nombre de entorno [[jteran](mailto:jteran@renatre.org.ar)] (053b8b1)
157
+
158
+ ---
159
+
160
+
161
+ ## v1.6.2 - 2025-12-04
162
+
163
+ - **bugfix**: crear changelog cuando no existe [[jteran](mailto:jteran@renatre.org.ar)] (0c8e7bb)
164
+
165
+ ---
166
+
167
+
168
+ ## v1.6.1 - 2025-11-29
169
+
170
+ ### Commits
171
+
172
+ - **bugfix**: arreglo mensaje de confirmacion de squash, muevo prompt de commit message antes del squash [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (f1f6e67)
173
+ - **bugfix**: cambio default en confirmacion para agrupar release [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (83df7e9)
174
+
175
+ ---
176
+
177
+
178
+ ## v1.6.0 - 2025-11-29
179
+
180
+ ### Commits
181
+
182
+ - **feature**: agrego opcion para agrupar ramas release [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (c47afff)
183
+
184
+ ---
185
+
186
+
187
+ ## v1.5.2 - 2025-11-28
188
+
189
+ ### Commits
190
+
191
+ - **bugfix**: arreglo split de ramas de flow.branches [[jteran](mailto:jteran@renatre.org.ar)] (2ad7471)
192
+ - **bugfix**: arreglo iteracion de items de flowconfig en set_config [[jteran](mailto:jteran@renatre.org.ar)] (5c3a317)
193
+ - **docs**: agrego venv a lista de carpetas ignoradas [[jteran](mailto:jteran@renatre.org.ar)] (50979e2)
194
+
195
+ ---
196
+
197
+
198
+ ## v1.5.1 - 2025-11-27
199
+
200
+ ### Commits
201
+
202
+ - **refactor**: muevo constantes a modulo git_flow para centralizar uso [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (29757cc)
203
+ - **bugfix**: ignorar carpetas generadas en build de lsp [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (7f857fd)
204
+
205
+ ---
206
+
207
+
208
+ ## v1.5.0 - 2025-11-27
209
+
210
+ ### Commits
211
+
212
+ - **feature**: modifico formato de listado de ramas [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (7177084)
213
+
214
+ ---
215
+
216
+
217
+ ## v1.4.0 - 2025-11-23
218
+
219
+ ### Commits
220
+
221
+ - **feature**: agrego comando branch para listar ramas [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (c74f1a3)
222
+ - **feature**: agrego soporte para parametros repetidos en llamadas a Git [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (eafb3f1)
223
+
224
+ ---
225
+
226
+
227
+ ## v1.3.0 - 2025-11-23
228
+
229
+ ### Commits
230
+
231
+ - **feature**: agrego comando release, elimino codigo no utilizado [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (43d7e5a)
232
+
233
+ ---
234
+
235
+
236
+ ## v1.2.0 - 2025-11-22
237
+
238
+ ### Commits
239
+
240
+ - **bugfix**: deshabilito check en merge --abort al buscar conflictos [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (34aba71)
241
+ - **feature**: agregando descripcion a ejecucion de comandos importantes en new, tag y merge [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (4135a78)
242
+ - **feature**: agregando descripcion a ejecucion de comandos importantes en init y commit [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (faea8c2)
243
+ - **bugfix**: cambiando tipo de print para agregar soporte de titulos [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (11e2a9d)
244
+ - **bugfix**: descartar output cuando el comando git se ejecuta con _run [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (d133c48)
245
+ - **feature**: muevo opciones para check y print a metodos para ejecutar git [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (7346cfd)
246
+
247
+ ---
248
+
249
+
250
+ ## v1.1.5 - 2025-11-21
251
+
252
+ ### Commits
253
+
254
+ - **bugfix**: creo tag en el commit que actualiza el changelog [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (222c819)
255
+ - **style**: ignorar carpeta dist/ [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (0e75a8e)
256
+
257
+ ---
258
+
259
+
260
+ ## v1.1.4 - 2025-11-21
261
+
262
+ ### Commits
263
+
264
+ - **bugfix**: separar etapa de lectura y escritura de changelog [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (bf829a1)
265
+ - **bugfix**: agrego http:// como protocolo soportado para pipelines [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (8f79a6a)
266
+
267
+ ---
268
+
269
+
270
+ ## Saturday, 8 de November de 2025, 00:28
271
+
272
+ - Autor: [bitbucket-pipelines](mailto:commits-noreply@bitbucket.org)
273
+ - Rama: `14beea150de16e06f7b4e54361584dae5d5ae713`
274
+
275
+ ### Commits
276
+
277
+ - **bugfix**: cambio el commit que se usa para generar las entradas del changelog [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (14beea1)
278
+
279
+ ---
280
+
281
+ ## Viernes, 7 de Noviembre de 2025, 11:42
282
+
283
+ - Autor: [Jonathan Teran](mailto:jteran@renatre.org.ar)
284
+ - Rama: `bugfix/generate-changelog-on-version-bump`
285
+
286
+ ### Commits
287
+
288
+ - **bugfix**: muevo generacion de CHANGELOG.md a comando tag (4bccd20)
289
+ - src/git_flow/git.py (M)
290
+ - src/git_flow/main.py (M)
291
+ - **refactor**: elimino seccion dev de bitbucket-pipelines.yml (71a5643)
292
+ - bitbucket-pipelines.yml (M)
293
+ - **docs**: elimino CHANGELOG.md (17eb6c2)
294
+ - CHANGELOG.md (D)
295
+ - **ignore**: ignoro archivos de build (90b420f)
296
+ - .gitignore (M)
297
+
298
+ ---
299
+
@@ -0,0 +1,101 @@
1
+ Metadata-Version: 2.4
2
+ Name: git-flow-envs
3
+ Version: 1.14.0
4
+ Summary: Git workflow automation to follow best practices when working with multiple environments
5
+ Author-email: Alan Facundo Biglieri <abiglieri@renatre.org.ar>, Jonathan Teran Carballo <jteran@renatre.org.ar>
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: requests
9
+
10
+ # Git Flow
11
+
12
+ Herramienta para establecer un workflow siguiendo [Conventional Commits
13
+ (CC)](https://www.conventionalcommits.org), [Conventional Branch
14
+ (CB)](https://conventional-branch.github.io/), y [SemVer](https://semver.org/).
15
+
16
+ Esta diseñada para facilitar la creación de commits y branches en un formato estandar, que permite
17
+ derivar versiones automaticamente de los merges sobre ramas principales.
18
+
19
+ ## Instalación
20
+
21
+ Para instalar Git Flow, se sugiere utilizar [pipx](https://github.com/pypa/pipx) (seguir la
22
+ documentación para instalarlo). Una vez instalado `pipx`, simplemente clonamos el repositorio en una
23
+ carpeta local, y lo instalamos:
24
+
25
+ ```sh
26
+ cd ~/Downloads
27
+ git clone git@bitbucket.org:sushi2717/git-flow.git
28
+ cd git-flow
29
+ pipx install .
30
+ ```
31
+
32
+ Luego podemos verificar que se haya instalado correctamente ejecutando: `git-flow -h`
33
+
34
+ Para actualizarlo, hacemos un pull de los cambios recientes del repositorio, y hacemos el upgrade
35
+ mediante `pipx`:
36
+
37
+ ```sh
38
+ cd ~/Downloads/git-flow
39
+ git pull
40
+ pipx upgrade git-flow
41
+ ```
42
+
43
+ ## Configuración
44
+
45
+ Para poder usar la herramienta en un repositorio, necesitamos inicializarlo:
46
+
47
+ ```sh
48
+ git-flow init
49
+ ```
50
+
51
+ El comando solicitará 2 opciones:
52
+
53
+ - **Ramas principales**: Ramas que representan los entornos principales del proyecto. Por ejemplo:
54
+ `dev,test,prod`.
55
+ - **Remoto** (opcional): Nombre del remoto que se usará para crear PRs, y taggear merges
56
+ automáticamente. Por el momento, se soportan los siguientes remotos:
57
+
58
+ - [x] Bitbucket
59
+ - [ ] Github: planeado
60
+
61
+ La configuración del remoto requiere tener un Access Token para poder crear los PRs automáticamente.
62
+ El mismo se puede crear desde el repositorio al que se quiere dar acceso: *"Repository settings" >
63
+ "Access Tokens" > "Create access token"*. El token necesita permiso para *Write* en *Pull Requests*.
64
+
65
+ Luego se debe guardar el token dentro del repositorio a configurar, en el archivo
66
+ `.repository-token`. De no especificarse, los merges y tags se harán de forma local.
67
+
68
+ ## Utilización
69
+
70
+ Git Flow cuenta con 5 comandos principales para guiar el workflow (ver `git-flow <command> -h` para
71
+ más información):
72
+
73
+ - `new`: Crea una nueva rama siguiendo CB.
74
+ - `commit`: Crea un commit siguiendo CC.
75
+ - `merge`: Mergea la rama actual a una de las ramas principales.
76
+ - `tag`: Crea un tag sobre el ultimo merge siguiendo SemVer.
77
+ - `release`: Prepara la rama actual para pasarse al siguiente entorno configurado
78
+
79
+ El workflow para el cual se penso la herramienta es el siguiente:
80
+
81
+ 1. Sobre la primer rama principal configurada (por ejemplo, `dev`), se crea una nueva rama con
82
+ `git-flow new`
83
+ 2. Se realizan cambios y se commitean los mismos con `git-flow commit` (se repite hasta que se
84
+ considere que la rama esté lista para mergear)
85
+ 3. Se ejecuta `git-flow merge` para mergear la rama al entorno que corresponda (en este caso,
86
+ `dev`). En caso de tener un remoto configurado, el comando crea un PR para integrar el cambio. Si
87
+ no, simplemente se ejecuta un `git merge` simple.
88
+ 4. Para versionar este último merge, se ejecuta `git-flow tag`, ya sea localmente o desde un
89
+ pipeline para que se ejecute en cada merge.
90
+ 5. Una vez que la rama fue correctamente integrada a un entorno (por ejemplo, `dev`), se usa
91
+ `git-flow release` para crear una nueva rama para integrar unicamente los cambios de esa rama
92
+ sobre el siguiente entorno (por ejemplo, `test`). Si la rama original era
93
+ `feature/my-new-feature`, se crea la rama `release/test/feature/my-new-feature` sobre `test` que
94
+ tiene los cambios de la rama original.
95
+
96
+ ## Taggeo automático por pipeline
97
+
98
+ Éste repositorio utiliza Git Flow para el taggeo automático usando pipelines, se puede ver el
99
+ archivo `bitbucket-pipelines.yml` como ejemplo. El comando `git-flow tag` soporta el pasaje del
100
+ token mediante la opción `--token=<TOKEN>`. Ver la sección [Configuración](#configuracion) para las
101
+ instrucciones de como generar este token. El mismo necesita scope `write:repository:bitbucket`.
@@ -0,0 +1,92 @@
1
+ # Git Flow
2
+
3
+ Herramienta para establecer un workflow siguiendo [Conventional Commits
4
+ (CC)](https://www.conventionalcommits.org), [Conventional Branch
5
+ (CB)](https://conventional-branch.github.io/), y [SemVer](https://semver.org/).
6
+
7
+ Esta diseñada para facilitar la creación de commits y branches en un formato estandar, que permite
8
+ derivar versiones automaticamente de los merges sobre ramas principales.
9
+
10
+ ## Instalación
11
+
12
+ Para instalar Git Flow, se sugiere utilizar [pipx](https://github.com/pypa/pipx) (seguir la
13
+ documentación para instalarlo). Una vez instalado `pipx`, simplemente clonamos el repositorio en una
14
+ carpeta local, y lo instalamos:
15
+
16
+ ```sh
17
+ cd ~/Downloads
18
+ git clone git@bitbucket.org:sushi2717/git-flow.git
19
+ cd git-flow
20
+ pipx install .
21
+ ```
22
+
23
+ Luego podemos verificar que se haya instalado correctamente ejecutando: `git-flow -h`
24
+
25
+ Para actualizarlo, hacemos un pull de los cambios recientes del repositorio, y hacemos el upgrade
26
+ mediante `pipx`:
27
+
28
+ ```sh
29
+ cd ~/Downloads/git-flow
30
+ git pull
31
+ pipx upgrade git-flow
32
+ ```
33
+
34
+ ## Configuración
35
+
36
+ Para poder usar la herramienta en un repositorio, necesitamos inicializarlo:
37
+
38
+ ```sh
39
+ git-flow init
40
+ ```
41
+
42
+ El comando solicitará 2 opciones:
43
+
44
+ - **Ramas principales**: Ramas que representan los entornos principales del proyecto. Por ejemplo:
45
+ `dev,test,prod`.
46
+ - **Remoto** (opcional): Nombre del remoto que se usará para crear PRs, y taggear merges
47
+ automáticamente. Por el momento, se soportan los siguientes remotos:
48
+
49
+ - [x] Bitbucket
50
+ - [ ] Github: planeado
51
+
52
+ La configuración del remoto requiere tener un Access Token para poder crear los PRs automáticamente.
53
+ El mismo se puede crear desde el repositorio al que se quiere dar acceso: *"Repository settings" >
54
+ "Access Tokens" > "Create access token"*. El token necesita permiso para *Write* en *Pull Requests*.
55
+
56
+ Luego se debe guardar el token dentro del repositorio a configurar, en el archivo
57
+ `.repository-token`. De no especificarse, los merges y tags se harán de forma local.
58
+
59
+ ## Utilización
60
+
61
+ Git Flow cuenta con 5 comandos principales para guiar el workflow (ver `git-flow <command> -h` para
62
+ más información):
63
+
64
+ - `new`: Crea una nueva rama siguiendo CB.
65
+ - `commit`: Crea un commit siguiendo CC.
66
+ - `merge`: Mergea la rama actual a una de las ramas principales.
67
+ - `tag`: Crea un tag sobre el ultimo merge siguiendo SemVer.
68
+ - `release`: Prepara la rama actual para pasarse al siguiente entorno configurado
69
+
70
+ El workflow para el cual se penso la herramienta es el siguiente:
71
+
72
+ 1. Sobre la primer rama principal configurada (por ejemplo, `dev`), se crea una nueva rama con
73
+ `git-flow new`
74
+ 2. Se realizan cambios y se commitean los mismos con `git-flow commit` (se repite hasta que se
75
+ considere que la rama esté lista para mergear)
76
+ 3. Se ejecuta `git-flow merge` para mergear la rama al entorno que corresponda (en este caso,
77
+ `dev`). En caso de tener un remoto configurado, el comando crea un PR para integrar el cambio. Si
78
+ no, simplemente se ejecuta un `git merge` simple.
79
+ 4. Para versionar este último merge, se ejecuta `git-flow tag`, ya sea localmente o desde un
80
+ pipeline para que se ejecute en cada merge.
81
+ 5. Una vez que la rama fue correctamente integrada a un entorno (por ejemplo, `dev`), se usa
82
+ `git-flow release` para crear una nueva rama para integrar unicamente los cambios de esa rama
83
+ sobre el siguiente entorno (por ejemplo, `test`). Si la rama original era
84
+ `feature/my-new-feature`, se crea la rama `release/test/feature/my-new-feature` sobre `test` que
85
+ tiene los cambios de la rama original.
86
+
87
+ ## Taggeo automático por pipeline
88
+
89
+ Éste repositorio utiliza Git Flow para el taggeo automático usando pipelines, se puede ver el
90
+ archivo `bitbucket-pipelines.yml` como ejemplo. El comando `git-flow tag` soporta el pasaje del
91
+ token mediante la opción `--token=<TOKEN>`. Ver la sección [Configuración](#configuracion) para las
92
+ instrucciones de como generar este token. El mismo necesita scope `write:repository:bitbucket`.
@@ -0,0 +1,16 @@
1
+ image: python:3.10
2
+
3
+ pipelines:
4
+ branches:
5
+ 'main':
6
+ - step:
7
+ name: "Tag and publish package"
8
+ caches:
9
+ - pip
10
+ script:
11
+ - pip install uv
12
+ - uv run git-flow tag --token=$BEARER
13
+ - git status
14
+ - git log --oneline -5
15
+ - uv build
16
+ - uv publish --token=$PYPI_TOKEN
@@ -0,0 +1,20 @@
1
+ [build-system]
2
+ requires = ["setuptools >= 80", "setuptools-scm[simple] >= 8" ]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "git-flow-envs"
7
+ description = "Git workflow automation to follow best practices when working with multiple environments"
8
+ dynamic = ["version"]
9
+ requires-python = ">= 3.10"
10
+ dependencies = [
11
+ "requests"
12
+ ]
13
+ authors = [
14
+ {name = "Alan Facundo Biglieri", email = "abiglieri@renatre.org.ar"},
15
+ {name = "Jonathan Teran Carballo", email = "jteran@renatre.org.ar"},
16
+ ]
17
+ readme = "README.md"
18
+
19
+ [project.scripts]
20
+ git-flow = "git_flow.main:main"
@@ -0,0 +1,6 @@
1
+ {
2
+ "exclude": [
3
+ "build",
4
+ "**/*.egg-info"
5
+ ]
6
+ }
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,63 @@
1
+ GitFlowError = ValueError
2
+
3
+ BRANCH_TYPES = [
4
+ "feature",
5
+ "refactor",
6
+ "bugfix",
7
+ "hotfix",
8
+ "chore",
9
+ "docs",
10
+ ]
11
+
12
+ COMMIT_TYPES = [
13
+ "feature",
14
+ "bugfix",
15
+ "hotfix",
16
+ "refactor",
17
+ "perf",
18
+ "docs",
19
+ "style",
20
+ "test",
21
+ "wip",
22
+ ]
23
+
24
+ WIP_BRANCH_PREFIX = "wip/"
25
+ TRASH_BRANCH_PREFIX = "trash/"
26
+
27
+ # Commits con estos valores incrementan el componente correspondiente
28
+ SEMVER_MAJOR = 3
29
+ SEMVER_MINOR = 2
30
+ SEMVER_PATCH = 1
31
+
32
+ # Commits con estos tipos no alteran la versión
33
+ SEMVER_SKIP = 0
34
+
35
+ COMMIT_TYPE_INCREMENT = {
36
+ "feature": SEMVER_MINOR,
37
+ "bugfix": SEMVER_PATCH,
38
+ "hotfix": SEMVER_PATCH,
39
+ "refactor": SEMVER_SKIP,
40
+ "perf": SEMVER_SKIP,
41
+ "docs": SEMVER_SKIP,
42
+ "style": SEMVER_SKIP,
43
+ "test": SEMVER_SKIP,
44
+ }
45
+
46
+ SUPPORTED_REMOTE_APIS = [
47
+ "bitbucket.org",
48
+ "github.com",
49
+ ]
50
+
51
+ REPOSITORY_TOKEN_FILENAME = ".repository-token"
52
+
53
+ COLOR_BLACK = "\033[30m"
54
+ COLOR_RED = "\033[31m"
55
+ COLOR_GREEN = "\033[32m"
56
+ COLOR_YELLOW = "\033[33m"
57
+ COLOR_BLUE = "\033[34m"
58
+ COLOR_5 = "\033[35m"
59
+ COLOR_6 = "\033[36m"
60
+ COLOR_7 = "\033[37m"
61
+ COLOR_BLACK_BOLD = "\033[1;30m"
62
+ COLOR_WHITE_BOLD = "\033[1;37m"
63
+ COLOR_RESET = "\033[0m"
@@ -0,0 +1,59 @@
1
+ from datetime import datetime
2
+ from os.path import isfile
3
+
4
+ from git_flow.git import Git
5
+
6
+
7
+ class Changelog:
8
+ FILENAME = "CHANGELOG.md"
9
+ COMMIT_MESSAGE = "chore: bump version and update CHANGELOG.md [skip ci]"
10
+
11
+ def update(self, title: str, base: str, branch: str):
12
+ self._prepend(self.generate_entry(title, base, branch))
13
+
14
+ def generate_header(self, title):
15
+ now = datetime.now()
16
+
17
+ return f"""## {title} - {now.strftime("%F")}
18
+
19
+ """
20
+
21
+ def generate_content(self, base: str, branch: str):
22
+ commits = Git(
23
+ "log", base + ".." + branch, first_parent=True, format="%h", merges=False
24
+ ).lines()
25
+ content = ""
26
+
27
+ for commit in commits:
28
+ message = Git("show", commit, patch=False, format="%s").firstline()
29
+ email = Git("show", commit, patch=False, format="%ae").firstline()
30
+ username = email[: email.index("@")]
31
+ index = message.index(":")
32
+ commit_type = message[:index]
33
+ commit_message = message[index + 1 :]
34
+
35
+ content += f"- **{commit_type}**: {commit_message} [[{username}](mailto:{email})] ({commit})\n"
36
+
37
+ return content
38
+
39
+ def generate_footer(self):
40
+ return """
41
+ ---
42
+
43
+
44
+ """
45
+
46
+ def generate_entry(self, title: str, base: str, branch: str):
47
+ return (
48
+ self.generate_header(title)
49
+ + self.generate_content(base, branch)
50
+ + self.generate_footer()
51
+ )
52
+
53
+ def _prepend(self, content: str):
54
+ if isfile(self.FILENAME):
55
+ with open(self.FILENAME, "r") as f:
56
+ content += f.read()
57
+
58
+ with open(self.FILENAME, "w") as f:
59
+ f.write(content)
File without changes