From 04d06ed64d5776bffd4bd883f8f28e2074878ced Mon Sep 17 00:00:00 2001 From: lbrealdev Date: Wed, 28 May 2025 17:40:05 +0200 Subject: [PATCH 1/2] fix(api): success_msg when org repositories --- justfile | 15 +++++++++------ src/github_rest_cli/api.py | 8 ++++---- uv.lock | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/justfile b/justfile index c63710f..7b5181e 100644 --- a/justfile +++ b/justfile @@ -13,18 +13,18 @@ alias dv := dynaconf-validate @setup-ruff: uv tool install ruff -test: - @echo {{ justfile_directory() }} - -@cc: +@cache: uv clean cache -@build: +@build-local: uv build -@publish: +@publish-local: uv publish --token $PYPI_TOKEN +@sync: + uv sync + @lint: ruff check . @@ -36,3 +36,6 @@ test: @dynaconf-validate: dynaconf -i github_rest_cli.config.settings validate + +test: + @echo {{ justfile_directory() }} diff --git a/src/github_rest_cli/api.py b/src/github_rest_cli/api.py index bbf3b50..4afa139 100644 --- a/src/github_rest_cli/api.py +++ b/src/github_rest_cli/api.py @@ -89,7 +89,7 @@ def create_repository(name: str, visibility: str, org: str = None): url, headers=headers, json=data, - success_msg=f"Repository successfully created in {owner or org }/{name}", + success_msg=f"Repository successfully created in {org or owner}/{name}.", error_msg={ 401: "Unauthorized access. Please check your token or credentials.", 422: "Repository name already exists on this account or organization.", @@ -106,7 +106,7 @@ def delete_repository(name: str, org: str = None): "DELETE", url, headers=headers, - success_msg=f"Repository sucessfully deleted in {owner or org}/{name}", + success_msg=f"Repository sucessfully deleted in {org or owner}/{name}.", error_msg={ 403: "The authenticated user does not have sufficient permissions to delete this repository.", 404: "The requested repository does not exist.", @@ -162,7 +162,7 @@ def dependabot_security(name: str, enabled: bool, org: str = None): "DELETE", url=full_url, headers=headers, - success_msg=f"Dependabot has been disabled on repository {owner or org}/{name}.", + success_msg=f"Dependabot has been disabled on repository {org or owner}/{name}.", error_msg={401: "Unauthorized. Please check your credentials."}, ) @@ -180,7 +180,7 @@ def deployment_environment(name: str, env: str, org: str = None): "PUT", url, headers=headers, - success_msg=f"Environment {env} has been created successfully in {owner or org}/{name}.", + success_msg=f"Environment {env} has been created successfully in {org or owner}/{name}.", error_msg={ 422: f"Failed to create repository enviroment {owner or org}/{name}" }, diff --git a/uv.lock b/uv.lock index cdcd1cf..84e7060 100644 --- a/uv.lock +++ b/uv.lock @@ -61,7 +61,7 @@ wheels = [ [[package]] name = "github-rest-cli" -version = "1.0.1" +version = "1.0.2" source = { editable = "." } dependencies = [ { name = "dynaconf" }, From 5ed0f5dacaec5da7473fe3355a99e3d4c505d63c Mon Sep 17 00:00:00 2001 From: lbrealdev Date: Fri, 13 Jun 2025 00:51:35 +0200 Subject: [PATCH 2/2] fix: deployment_environment error message --- src/github_rest_cli/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/github_rest_cli/api.py b/src/github_rest_cli/api.py index 4afa139..4e16de8 100644 --- a/src/github_rest_cli/api.py +++ b/src/github_rest_cli/api.py @@ -182,6 +182,6 @@ def deployment_environment(name: str, env: str, org: str = None): headers=headers, success_msg=f"Environment {env} has been created successfully in {org or owner}/{name}.", error_msg={ - 422: f"Failed to create repository enviroment {owner or org}/{name}" + 422: f"Failed to create repository enviroment {owner or org}/{name}." }, )