Merged in feature/2025-12-21 (pull request #55)
feature: 2025 12 21 Approved-by: Jonathan Teran
This commit is contained in:
@@ -80,16 +80,27 @@ class MergeCommand(Command):
|
|||||||
|
|
||||||
def create_pull_request(self, token: str, branch: str, target: str):
|
def create_pull_request(self, token: str, branch: str, target: str):
|
||||||
changelog = Changelog()
|
changelog = Changelog()
|
||||||
title = self.prompt("[Opcional] Ingrese un titulo para el PR")
|
commits = Git("log", target + "..", format="%s").lines()
|
||||||
title = title or branch.replace("/", ": ").replace("-", " ")
|
|
||||||
|
|
||||||
if title.startswith("release: "):
|
if len(commits) == 1:
|
||||||
title = title[title.index(' ', title.index(' ') + 1) + 1:]
|
title = commits[0]
|
||||||
|
else:
|
||||||
|
title = branch.replace("/", ": ").replace("-", " ")
|
||||||
|
|
||||||
|
if title.startswith("release: "):
|
||||||
|
title = title[title.index(' ', title.index(' ') + 1) + 1:]
|
||||||
|
|
||||||
|
self.info("Título del PR por defecto: " + title)
|
||||||
|
|
||||||
|
opt_title = self.prompt("[Opcional] Ingrese otro titulo para el PR")
|
||||||
|
|
||||||
|
if opt_title:
|
||||||
|
title = opt_title
|
||||||
|
|
||||||
message = self.get_remote_api(token).create_pull_request(
|
message = self.get_remote_api(token).create_pull_request(
|
||||||
branch,
|
branch,
|
||||||
target,
|
target,
|
||||||
branch.replace("/", ": ").replace("-", " "),
|
title,
|
||||||
changelog.generate_content(target, branch),
|
changelog.generate_content(target, branch),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -44,9 +44,6 @@ class NewCommand(Command):
|
|||||||
persistent=True,
|
persistent=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
ticket = self.prompt("[Opcional] Ingrese el ID del ticket (por ejemplo ABC-123 o #123)")
|
|
||||||
ticket = ticket[1:] if ticket.startswith("#") else ticket
|
|
||||||
keywords = ticket + ' ' + keywords
|
|
||||||
keywords = filter(lambda k: len(k) > 0, keywords.split(" "))
|
keywords = filter(lambda k: len(k) > 0, keywords.split(" "))
|
||||||
branch = branch_type + "/" + "-".join(keywords)
|
branch = branch_type + "/" + "-".join(keywords)
|
||||||
|
|
||||||
|
|||||||
@@ -55,9 +55,11 @@ class ReleaseCommand(Command):
|
|||||||
print("- " + commit)
|
print("- " + commit)
|
||||||
|
|
||||||
group = args.group
|
group = args.group
|
||||||
|
grouping = group is not None
|
||||||
|
|
||||||
if not group:
|
if not grouping:
|
||||||
if self.confirm("¿Desea agrupar este release con otra rama?", False):
|
if self.confirm("¿Desea agrupar este release con otra rama?", False):
|
||||||
|
grouping = True
|
||||||
group = self.choice("Grupo release: ", Git.get_branches("release/" + next_env + "/"))
|
group = self.choice("Grupo release: ", Git.get_branches("release/" + next_env + "/"))
|
||||||
else:
|
else:
|
||||||
group = next_env
|
group = next_env
|
||||||
@@ -89,6 +91,15 @@ class ReleaseCommand(Command):
|
|||||||
else:
|
else:
|
||||||
Git("switch", next_branch, create=True).exec(print="Creando rama release")
|
Git("switch", next_branch, create=True).exec(print="Creando rama release")
|
||||||
|
|
||||||
Git("rebase", base, next_branch, onto=group).exec(
|
status = Git("rebase", base, next_branch, onto=group).code(
|
||||||
print="Moviendo cambios hacia el siguiente ambiente"
|
print="Moviendo cambios hacia el siguiente ambiente"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if status:
|
||||||
|
Git("rebase", abort=True).exec(
|
||||||
|
print="Deshaciendo cambios por conflictos"
|
||||||
|
)
|
||||||
|
raise GitFlowError("Error al realizar pasaje de cambios a rama objetivo")
|
||||||
|
elif grouping:
|
||||||
|
Git("switch", group).exec(print="Cambiando a rama objetivo")
|
||||||
|
Git("merge", next_branch, ff_only=True).exec(print="Mergeando cambios de la nueva rama")
|
||||||
|
|||||||
Reference in New Issue
Block a user