Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c93833769b | ||
|
|
c536deb54d | ||
|
|
3ff9f76a6c | ||
|
|
1c319beff4 | ||
|
|
f885c27e08 | ||
|
|
094bc1a698 | ||
|
|
9b0d7d6166 | ||
|
|
f52edf03e0 | ||
|
|
8ee01290ef | ||
|
|
9c89f4d638 | ||
|
|
8d35610c00 | ||
|
|
de124baf1a | ||
|
|
2676f41def | ||
|
|
22fd68c5b6 | ||
|
|
04c9a4b449 | ||
|
|
417021b36e | ||
|
|
be245114d5 | ||
|
|
184b135886 | ||
|
|
acc0e8666a | ||
|
|
5806aeab27 |
@@ -1,3 +1,45 @@
|
|||||||
|
## v1.17.5 - 2026-06-03
|
||||||
|
|
||||||
|
- **bugfix**: allow commits not compliant with conventional commits in changelog generation [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (3ff9f76)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v1.17.4 - 2026-05-24
|
||||||
|
|
||||||
|
- **bugfix**: use rest of branch name instead of ticket for pr title generation [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (094bc1a)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v1.17.3 - 2026-05-22
|
||||||
|
|
||||||
|
- **bugfix**: dont close branches on merges between environments [[jteran](mailto:jteran@renatre.org.ar)] (8ee0129)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v1.17.2 - 2026-05-22
|
||||||
|
|
||||||
|
- **bugfix**: change pr title on merges between environments [[jteran](mailto:jteran@renatre.org.ar)] (de124ba)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v1.17.1 - 2026-05-20
|
||||||
|
|
||||||
|
- **bugfix**: dont push environment branches since they are already created on remote [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (04c9a4b)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v1.17.0 - 2026-05-20
|
||||||
|
|
||||||
|
- **feature**: allow merges between environments [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (5806aea)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
## v1.16.1 - 2026-05-20
|
## v1.16.1 - 2026-05-20
|
||||||
|
|
||||||
- **bugfix**: arreglo split de branch para armar correctamente el titulo del PR [[jteran](mailto:jteran@renatre.org.ar)] (a0d3028)
|
- **bugfix**: arreglo split de branch para armar correctamente el titulo del PR [[jteran](mailto:jteran@renatre.org.ar)] (a0d3028)
|
||||||
|
|||||||
@@ -28,11 +28,15 @@ class Changelog:
|
|||||||
message = Git("show", commit, patch=False, format="%s").firstline()
|
message = Git("show", commit, patch=False, format="%s").firstline()
|
||||||
email = Git("show", commit, patch=False, format="%ae").firstline()
|
email = Git("show", commit, patch=False, format="%ae").firstline()
|
||||||
username = email[: email.index("@")]
|
username = email[: email.index("@")]
|
||||||
index = message.index(":")
|
description = message
|
||||||
commit_type = message[:index]
|
|
||||||
commit_message = message[index + 1 :]
|
|
||||||
|
|
||||||
content += f"- **{commit_type}**: {commit_message} [[{username}](mailto:{email})] ({commit})\n"
|
if ":" in message:
|
||||||
|
index = message.index(":")
|
||||||
|
commit_type = message[:index]
|
||||||
|
commit_message = message[index + 1 :]
|
||||||
|
description = f"**{commit_type}**: {commit_message}"
|
||||||
|
|
||||||
|
content += f"- {description} [[{username}](mailto:{email})] ({commit})\n"
|
||||||
|
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ TYPE_INFO = 3
|
|||||||
|
|
||||||
|
|
||||||
flowconfig = Git.get_config(FLOWCONFIG_FILENAME) if isfile(FLOWCONFIG_FILENAME) else {}
|
flowconfig = Git.get_config(FLOWCONFIG_FILENAME) if isfile(FLOWCONFIG_FILENAME) else {}
|
||||||
|
environments = flowconfig["flow.branches"].split(",") if "flow.branches" in flowconfig else []
|
||||||
|
|
||||||
def ensure_initialized():
|
def ensure_initialized():
|
||||||
initialized = flowconfig["flow.initialized"] if flowconfig else None
|
initialized = flowconfig["flow.initialized"] if flowconfig else None
|
||||||
@@ -46,7 +46,6 @@ def ensure_right_branch():
|
|||||||
|
|
||||||
def get_branch_env_and_type(branch: str) -> tuple[str, str]:
|
def get_branch_env_and_type(branch: str) -> tuple[str, str]:
|
||||||
components = branch.split("/")
|
components = branch.split("/")
|
||||||
target_branches = flowconfig["flow.branches"].split(",")
|
|
||||||
|
|
||||||
if len(components) == 2:
|
if len(components) == 2:
|
||||||
if components[0] not in BRANCH_TYPES:
|
if components[0] not in BRANCH_TYPES:
|
||||||
@@ -54,13 +53,13 @@ def get_branch_env_and_type(branch: str) -> tuple[str, str]:
|
|||||||
f"Branch inválida, el tipo '{components[0]}' no es válido."
|
f"Branch inválida, el tipo '{components[0]}' no es válido."
|
||||||
)
|
)
|
||||||
|
|
||||||
return (target_branches[0], components[0])
|
return (environments[0], components[0])
|
||||||
elif len(components) == 4:
|
elif len(components) == 4:
|
||||||
target_branches = target_branches[1:]
|
valid_environments = environments[1:]
|
||||||
|
|
||||||
if (
|
if (
|
||||||
components[0] != "release"
|
components[0] != "release"
|
||||||
or components[1] not in target_branches
|
or components[1] not in valid_environments
|
||||||
or components[2] not in BRANCH_TYPES
|
or components[2] not in BRANCH_TYPES
|
||||||
):
|
):
|
||||||
raise GitFlowError(
|
raise GitFlowError(
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ def branch(
|
|||||||
ensure_initialized()
|
ensure_initialized()
|
||||||
|
|
||||||
current_branch = Git.get_current_branch()
|
current_branch = Git.get_current_branch()
|
||||||
environments = flowconfig["flow.branches"].split(",")
|
|
||||||
|
|
||||||
if current_branch in environments:
|
if current_branch in environments:
|
||||||
current_environment = current_branch
|
current_environment = current_branch
|
||||||
|
|||||||
@@ -13,7 +13,22 @@ def merge():
|
|||||||
ensure_initialized()
|
ensure_initialized()
|
||||||
|
|
||||||
branch = ensure_right_branch()
|
branch = ensure_right_branch()
|
||||||
target, _ = get_branch_env_and_type(branch)
|
|
||||||
|
if branch in environments:
|
||||||
|
if branch == environments[-1]:
|
||||||
|
raise GitFlowError("No se puede hacer un merge del último entorno.")
|
||||||
|
|
||||||
|
panel(
|
||||||
|
"Merge de entornos",
|
||||||
|
"""Está por hacer un merge de 2 entornos que puede implicar muchos cambios en el proyecto.""",
|
||||||
|
)
|
||||||
|
|
||||||
|
if not confirm("¿Desea continuar?"):
|
||||||
|
raise GitFlowError("Ejecución abortada")
|
||||||
|
|
||||||
|
target = environments[environments.index(branch) + 1]
|
||||||
|
else:
|
||||||
|
target, _ = get_branch_env_and_type(branch)
|
||||||
|
|
||||||
if "flow.remote" in flowconfig:
|
if "flow.remote" in flowconfig:
|
||||||
remote = flowconfig["flow.remote"]
|
remote = flowconfig["flow.remote"]
|
||||||
@@ -34,9 +49,10 @@ def run_remote(remote: str, token: str, branch: str, target: str):
|
|||||||
show_commits_to_merge(target)
|
show_commits_to_merge(target)
|
||||||
|
|
||||||
if confirm(f"¿Crear PR de '{branch}' a '{target}'?"):
|
if confirm(f"¿Crear PR de '{branch}' a '{target}'?"):
|
||||||
Git("push", remote, branch, set_upstream=True).exec(
|
if branch not in environments:
|
||||||
print="Subiendo rama al remoto para crear PR"
|
Git("push", remote, branch, set_upstream=True).exec(
|
||||||
)
|
print="Subiendo rama al remoto para crear PR"
|
||||||
|
)
|
||||||
|
|
||||||
create_pull_request(token, branch, target)
|
create_pull_request(token, branch, target)
|
||||||
|
|
||||||
@@ -95,6 +111,7 @@ def create_pull_request(token: str, branch: str, target: str):
|
|||||||
target,
|
target,
|
||||||
title,
|
title,
|
||||||
changelog.generate_content(target, branch),
|
changelog.generate_content(target, branch),
|
||||||
|
branch not in environments
|
||||||
)
|
)
|
||||||
|
|
||||||
success(message)
|
success(message)
|
||||||
@@ -104,6 +121,10 @@ def create_pull_request(token: str, branch: str, target: str):
|
|||||||
Git("pull").exec(print="Obteniendo cambios")
|
Git("pull").exec(print="Obteniendo cambios")
|
||||||
|
|
||||||
def _get_pr_title_from_branch(branch: str) -> str:
|
def _get_pr_title_from_branch(branch: str) -> str:
|
||||||
|
if branch in environments:
|
||||||
|
target = environments[environments.index(branch) + 1]
|
||||||
|
return f"Sincronización de entorno {branch} a {target}"
|
||||||
|
|
||||||
components = branch.split("/") # <type>/<desc> or release/<env>/<type>/<desc>
|
components = branch.split("/") # <type>/<desc> or release/<env>/<type>/<desc>
|
||||||
branch_type = components[-2]
|
branch_type = components[-2]
|
||||||
branch_desc = components[-1]
|
branch_desc = components[-1]
|
||||||
@@ -117,11 +138,11 @@ def _get_pr_title_from_branch(branch: str) -> str:
|
|||||||
maybe_ticket = branch_desc[:second_dash]
|
maybe_ticket = branch_desc[:second_dash]
|
||||||
if is_valid_ticket(maybe_ticket):
|
if is_valid_ticket(maybe_ticket):
|
||||||
branch_ticket = maybe_ticket
|
branch_ticket = maybe_ticket
|
||||||
branch_desc = branch_desc[:second_dash+1]
|
branch_desc = branch_desc[second_dash+1:]
|
||||||
|
|
||||||
return " ".join(filter(None, [
|
return " ".join(filter(None, [
|
||||||
f"[Pasaje a {components[1]}]" if len(components) == 4 else None,
|
f"[Pasaje a {components[1]}]" if len(components) == 4 else None,
|
||||||
branch_type + ":",
|
branch_type + ":",
|
||||||
branch_ticket,
|
branch_ticket,
|
||||||
branch_desc.replace("-", " ")
|
branch_desc.replace("-", " ")
|
||||||
]))
|
]))
|
||||||
|
|||||||
@@ -13,9 +13,8 @@ def new():
|
|||||||
|
|
||||||
ensure_initialized()
|
ensure_initialized()
|
||||||
branch = ensure_right_branch()
|
branch = ensure_right_branch()
|
||||||
envs = flowconfig["flow.branches"].split(",")
|
|
||||||
|
|
||||||
if branch not in envs:
|
if branch not in environments:
|
||||||
warning("La rama actual no corresponde a un entorno configurado.")
|
warning("La rama actual no corresponde a un entorno configurado.")
|
||||||
|
|
||||||
info("Se creará una nueva rama de trabajo sobre la rama actual.")
|
info("Se creará una nueva rama de trabajo sobre la rama actual.")
|
||||||
|
|||||||
@@ -13,10 +13,9 @@ def release(group: Optional[str] = None):
|
|||||||
ensure_initialized()
|
ensure_initialized()
|
||||||
|
|
||||||
branch = ensure_right_branch()
|
branch = ensure_right_branch()
|
||||||
envs = flowconfig["flow.branches"].split(",")
|
|
||||||
env, _ = get_branch_env_and_type(branch)
|
env, _ = get_branch_env_and_type(branch)
|
||||||
|
|
||||||
if env == envs[-1]:
|
if env == environments[-1]:
|
||||||
raise GitFlowError(
|
raise GitFlowError(
|
||||||
"No se puede hacer release de una rama en el ultimo entorno."
|
"No se puede hacer release de una rama en el ultimo entorno."
|
||||||
)
|
)
|
||||||
@@ -25,7 +24,7 @@ def release(group: Optional[str] = None):
|
|||||||
|
|
||||||
ensure_clean_worktree(has_remote)
|
ensure_clean_worktree(has_remote)
|
||||||
|
|
||||||
next_env = envs[envs.index(env) + 1]
|
next_env = environments[environments.index(env) + 1]
|
||||||
next_branch = (
|
next_branch = (
|
||||||
branch.replace(f"/{env}/", f"/{next_env}/")
|
branch.replace(f"/{env}/", f"/{next_env}/")
|
||||||
if branch.startswith("release/")
|
if branch.startswith("release/")
|
||||||
|
|||||||
@@ -20,10 +20,9 @@ def tag(token: Optional[str] = None):
|
|||||||
"""Crea un nuevo tag para el último merge."""
|
"""Crea un nuevo tag para el último merge."""
|
||||||
ensure_initialized()
|
ensure_initialized()
|
||||||
|
|
||||||
envs = flowconfig["flow.branches"].split(",")
|
|
||||||
target = Git.get_current_branch()
|
target = Git.get_current_branch()
|
||||||
|
|
||||||
if target not in envs:
|
if target not in environments:
|
||||||
raise GitFlowError("Solo se pueden taggear commits en ramas principales.")
|
raise GitFlowError("Solo se pueden taggear commits en ramas principales.")
|
||||||
|
|
||||||
branch = Git(
|
branch = Git(
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ class RemoteAPI(ABC):
|
|||||||
destination: str,
|
destination: str,
|
||||||
title: str | None = None,
|
title: str | None = None,
|
||||||
description: str | None = None,
|
description: str | None = None,
|
||||||
|
close_source_branch: bool = True
|
||||||
) -> str:
|
) -> str:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class BitbucketRemoteAPI(RemoteAPI):
|
|||||||
destination: str,
|
destination: str,
|
||||||
title: str | None = None,
|
title: str | None = None,
|
||||||
description: str | None = None,
|
description: str | None = None,
|
||||||
|
close_source_branch: bool = True
|
||||||
):
|
):
|
||||||
request = requests.post(
|
request = requests.post(
|
||||||
self.get_endpoint("/pullrequests"),
|
self.get_endpoint("/pullrequests"),
|
||||||
@@ -21,7 +22,7 @@ class BitbucketRemoteAPI(RemoteAPI):
|
|||||||
"description": description,
|
"description": description,
|
||||||
"source": {"branch": {"name": source}},
|
"source": {"branch": {"name": source}},
|
||||||
"destination": {"branch": {"name": destination}},
|
"destination": {"branch": {"name": destination}},
|
||||||
"close_source_branch": True,
|
"close_source_branch": close_source_branch,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class GithubRemoteAPI(RemoteAPI):
|
|||||||
destination: str,
|
destination: str,
|
||||||
title: str | None = None,
|
title: str | None = None,
|
||||||
description: str | None = None,
|
description: str | None = None,
|
||||||
|
close_source_branch: bool = True
|
||||||
) -> str:
|
) -> str:
|
||||||
raise GitFlowError("not implemented yet!")
|
raise GitFlowError("not implemented yet!")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user