Compare commits
28
Commits
9167390098
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94a219ed82 | ||
|
|
3f3650360a | ||
|
|
11a48a922c | ||
|
|
f4adb431db | ||
|
|
8f1a60cc06 | ||
|
|
fcc8114c8e | ||
|
|
c58c4cea96 | ||
|
|
7fbf499278 | ||
|
|
64fc890cb7 | ||
|
|
7199249f75 | ||
|
|
7efaf367e5 | ||
|
|
dc79ffa399 | ||
|
|
31513a3e3a | ||
|
|
c45f065e77 | ||
|
|
7f7dd7b538 | ||
|
|
adcb53156a | ||
|
|
5ca817c796 | ||
|
|
2be9b50ac4 | ||
|
|
347b8b9556 | ||
|
|
9b547bd6a9 | ||
|
|
f05582b50f | ||
|
|
a1a9a7acac | ||
|
|
190b4b8408 | ||
|
|
f9fb5a62d1 | ||
|
|
09d0de2860 | ||
|
|
f233adfd1d | ||
|
|
0cdc01291c | ||
|
|
098a4724ca |
@@ -8,7 +8,7 @@ jobs:
|
|||||||
Publish-to-PyPI:
|
Publish-to-PyPI:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository code
|
- name: Checkout
|
||||||
uses: actions/checkout@v7
|
uses: actions/checkout@v7
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|||||||
@@ -1,3 +1,76 @@
|
|||||||
|
## v1.19.0 - 2026-07-31
|
||||||
|
|
||||||
|
- **style**: format with ruff [[jteran](mailto:jteran@renatre.org.ar)] (11a48a9)
|
||||||
|
- **feature**: parse git remote url with giturlparse [[jteran](mailto:jteran@renatre.org.ar)] (f4adb43)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v1.18.0 - 2026-07-29
|
||||||
|
|
||||||
|
- **bugfix**: change checkout version to v7 [[jteran](mailto:jteran@renatre.org.ar)] (c58c4ce)
|
||||||
|
- **bugfix**: move git fetch to separate line [[jteran](mailto:jteran@renatre.org.ar)] (64fc890)
|
||||||
|
- **bugfix**: change actions/checkout to v4 and add step to fetch tags [[jteran](mailto:jteran@renatre.org.ar)] (dc79ffa)
|
||||||
|
- **bugfix**: change actions/checkout version [[jteran](mailto:jteran@renatre.org.ar)] (c45f065)
|
||||||
|
- **bugfix**: add fetch-tags: true [[jteran](mailto:jteran@renatre.org.ar)] (adcb531)
|
||||||
|
- **bugfix**: remove checkout parameters [[jteran](mailto:jteran@renatre.org.ar)] (2be9b50)
|
||||||
|
- **feature**: show commit count and list tags on workflow [[jteran](mailto:jteran@renatre.org.ar)] (f05582b)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v0.1.0-main - 2026-07-29
|
||||||
|
|
||||||
|
- **bugfix**: change actions/checkout to v4 and add step to fetch tags [[jteran](mailto:jteran@renatre.org.ar)] (dc79ffa)
|
||||||
|
- **bugfix**: change actions/checkout version [[jteran](mailto:jteran@renatre.org.ar)] (c45f065)
|
||||||
|
- **bugfix**: add fetch-tags: true [[jteran](mailto:jteran@renatre.org.ar)] (adcb531)
|
||||||
|
- **bugfix**: remove checkout parameters [[jteran](mailto:jteran@renatre.org.ar)] (2be9b50)
|
||||||
|
- **feature**: show commit count and list tags on workflow [[jteran](mailto:jteran@renatre.org.ar)] (f05582b)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v0.1.0-main - 2026-07-29
|
||||||
|
|
||||||
|
- **feature**: show commit count and list tags on workflow [[jteran](mailto:jteran@renatre.org.ar)] (f05582b)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v0.0.1-main - 2026-07-18
|
||||||
|
|
||||||
|
- **bugfix**: add fetch tags to checkout step [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (f9fb5a6)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v0.1.0-main - 2026-07-18
|
||||||
|
|
||||||
|
- **feature**: print current tag command output [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (0cdc012)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
## v0.1.0-main - 2026-07-18
|
||||||
|
|
||||||
|
- **style**: organize imports [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (a08666c)
|
||||||
|
- **style**: format and organize imports [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (726df21)
|
||||||
|
- **refactor**: use base.io_ methods [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (07d4ff9)
|
||||||
|
- **refactor**: use base.io_ methods [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (919e680)
|
||||||
|
- **refactor**: use base.io_ methods [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (add4cd2)
|
||||||
|
- **style**: run black formatter on merge.py [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (e4833c9)
|
||||||
|
- **style**: run black formatter on commit.py [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (7315681)
|
||||||
|
- **style**: run black formatter on new.py [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (ba1c9bd)
|
||||||
|
- **style**: run black formatter [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (1a7ae33)
|
||||||
|
- **refactor**: use new base.io_ methods [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (0120faa)
|
||||||
|
- **refactor**: use unsafe_ask in favor of global error catch [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (febd18c)
|
||||||
|
- **style**: run black formatter [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (069c33b)
|
||||||
|
- **refactor**: reword current branch check, move if around so it's better placed [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (1d186e1)
|
||||||
|
- **feature**: change unicode status icons [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (c0f7642)
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
## v1.17.6 - 2026-07-09
|
## v1.17.6 - 2026-07-09
|
||||||
|
|
||||||
- **bugfix**: actualizo versiones de checkout, setup-python, clonar depth completo [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (4666503)
|
- **bugfix**: actualizo versiones de checkout, setup-python, clonar depth completo [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (4666503)
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ description = "Git workflow automation to follow best practices when working wit
|
|||||||
dynamic = ["version"]
|
dynamic = ["version"]
|
||||||
requires-python = ">= 3.14"
|
requires-python = ">= 3.14"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"requests", "typer", "rich", "questionary"
|
"requests", "typer", "rich", "questionary", "giturlparse"
|
||||||
]
|
]
|
||||||
authors = [
|
authors = [
|
||||||
{name = "Alan Facundo Biglieri", email = "abiglieri@renatre.org.ar"},
|
{name = "Alan Facundo Biglieri", email = "abiglieri@renatre.org.ar"},
|
||||||
|
|||||||
@@ -43,9 +43,10 @@ COMMIT_TYPE_INCREMENT = {
|
|||||||
"test": SEMVER_SKIP,
|
"test": SEMVER_SKIP,
|
||||||
}
|
}
|
||||||
|
|
||||||
SUPPORTED_REMOTE_APIS = [
|
SUPPORTED_REMOTE_URL_SCHEMAS = [
|
||||||
"bitbucket.org",
|
"ssh",
|
||||||
"github.com",
|
"http",
|
||||||
|
"https"
|
||||||
]
|
]
|
||||||
|
|
||||||
REPOSITORY_TOKEN_FILENAME = ".repository-token"
|
REPOSITORY_TOKEN_FILENAME = ".repository-token"
|
||||||
|
|||||||
+2
-2
@@ -53,7 +53,7 @@ class Git:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_current_tag():
|
def get_current_tag():
|
||||||
return Git("describe", abbrev="0", tags=True).firstline(check=False)
|
return Git("describe", abbrev="0", tags=True).firstline(check=False, print="Obteniendo tag actual")
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_first_fork_point(branch: str, env: str):
|
def get_first_fork_point(branch: str, env: str):
|
||||||
@@ -117,7 +117,7 @@ class Git:
|
|||||||
|
|
||||||
return lines if not strip else list(map(lambda l: l.strip(), lines))
|
return lines if not strip else list(map(lambda l: l.strip(), lines))
|
||||||
|
|
||||||
def firstline(self, **kwargs: bool):
|
def firstline(self, **kwargs):
|
||||||
lines = self.lines(**kwargs)
|
lines = self.lines(**kwargs)
|
||||||
|
|
||||||
return lines[0] if lines else ""
|
return lines[0] if lines else ""
|
||||||
|
|||||||
+29
-17
@@ -1,6 +1,8 @@
|
|||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
from git_flow import SUPPORTED_REMOTE_APIS, GitFlowError
|
import giturlparse
|
||||||
|
|
||||||
|
from git_flow import SUPPORTED_REMOTE_URL_SCHEMAS, GitFlowError
|
||||||
from git_flow.git import Git
|
from git_flow.git import Git
|
||||||
|
|
||||||
|
|
||||||
@@ -11,25 +13,35 @@ class RemoteAPI(ABC):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse(remote: str):
|
def parse(remote: str):
|
||||||
|
"""Soportamos 3 tipos de URL: http, https y ssh. Si no se especifica el esquema, asumimos ssh:
|
||||||
|
Ejemplos:
|
||||||
|
- http://gitea/user/repo
|
||||||
|
- https://gitea.com/user/repo.git
|
||||||
|
- git@bitbucket.org:user/repo
|
||||||
|
- git.mygiteainstance.com:user/repo.git
|
||||||
|
- ssh://git@git.mygiteainstance.com:1234/user/repo.git
|
||||||
|
"""
|
||||||
url = Git("remote", "get-url", remote).firstline()
|
url = Git("remote", "get-url", remote).firstline()
|
||||||
|
|
||||||
if url.startswith("git@"):
|
parsed_url = giturlparse.parse(url) # Validamos que la URL sea válida
|
||||||
at_pos = url.index("@")
|
|
||||||
colon_pos = url.index(":")
|
if not parsed_url.valid:
|
||||||
schema = "ssh://"
|
|
||||||
host = url[at_pos+1:colon_pos]
|
|
||||||
repository = url[colon_pos+1:]
|
|
||||||
elif url.startswith("http://") or url.startswith("https://"):
|
|
||||||
start_pos = url.index("://") + 3
|
|
||||||
uri_start = url.index("/", start_pos)
|
|
||||||
schema = url[:start_pos]
|
|
||||||
host = url[start_pos:uri_start]
|
|
||||||
repository = url[uri_start+1:]
|
|
||||||
else:
|
|
||||||
raise GitFlowError(f"La URL del remoto {remote} es inválida: {url}")
|
raise GitFlowError(f"La URL del remoto {remote} es inválida: {url}")
|
||||||
|
|
||||||
repository = repository.removesuffix(".git")
|
if not parsed_url.protocol in SUPPORTED_REMOTE_URL_SCHEMAS:
|
||||||
return [schema, host, repository]
|
raise GitFlowError(
|
||||||
|
f"La URL del remoto {remote} no tiene un esquema soportado: {url}"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Cuando el host es seteado por pipeline puede ser "http://gitea/OWNER/REPO", en ese caso
|
||||||
|
# la libreria parsea OWNER="" y REPO="OWNER/REPO"
|
||||||
|
repository = (
|
||||||
|
"/".join(filter(None, [parsed_url.owner, parsed_url.repo]))
|
||||||
|
.removeprefix("/")
|
||||||
|
.removesuffix(".git")
|
||||||
|
)
|
||||||
|
|
||||||
|
return [parsed_url.protocol + "://", parsed_url.host, repository]
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def create_pull_request(
|
def create_pull_request(
|
||||||
@@ -38,7 +50,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
|
close_source_branch: bool = True,
|
||||||
) -> str:
|
) -> str:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ wheels = [
|
|||||||
name = "git-flow-envs"
|
name = "git-flow-envs"
|
||||||
source = { editable = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
{ name = "giturlparse" },
|
||||||
{ name = "questionary" },
|
{ name = "questionary" },
|
||||||
{ name = "requests" },
|
{ name = "requests" },
|
||||||
{ name = "rich" },
|
{ name = "rich" },
|
||||||
@@ -78,12 +79,22 @@ dependencies = [
|
|||||||
|
|
||||||
[package.metadata]
|
[package.metadata]
|
||||||
requires-dist = [
|
requires-dist = [
|
||||||
|
{ name = "giturlparse" },
|
||||||
{ name = "questionary" },
|
{ name = "questionary" },
|
||||||
{ name = "requests" },
|
{ name = "requests" },
|
||||||
{ name = "rich" },
|
{ name = "rich" },
|
||||||
{ name = "typer" },
|
{ name = "typer" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "giturlparse"
|
||||||
|
version = "0.15.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/8c/8a/b70b84cc78f9059d627f09560c81a11e8f046570d220a24e169489cad6c9/giturlparse-0.15.0.tar.gz", hash = "sha256:9af3f1fd5c4a0cac94ddb283593635005646393ee0debbe330d1bdff8866bf2c", size = 16138, upload-time = "2026-06-16T07:28:56.021Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/c7/96/147a2771ab655b9353781fb2f95c94eaf1d8576dccc991c1a61d0d355067/giturlparse-0.15.0-py2.py3-none-any.whl", hash = "sha256:76d2e6983b037356ab99b30683e533ac3db96409b68e2163a20fc3aff6446f10", size = 16683, upload-time = "2026-06-16T07:28:55.184Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "idna"
|
name = "idna"
|
||||||
version = "3.11"
|
version = "3.11"
|
||||||
|
|||||||
Reference in New Issue
Block a user