From 1fd75e11c1a0698009af3c4a9be08a49dd02880a Mon Sep 17 00:00:00 2001 From: Tiara Rodney Date: Sat, 6 Jun 2026 16:08:31 +0200 Subject: [PATCH] todo(21): in-progress parse_base_url and parse_repo_name accept SCP-style URLs for any host (e.g. git@git.code.tiararodney.com:h5p-mirror/foo.git) instead of rejecting everything but bitbucket.org. Non-SCP-style URLs (scheme://, missing colon) are still rejected with ValueError. Behavior for bitbucket.org URLs is unchanged. Unit tests cover Bitbucket- and Forgejo-shaped URLs plus the rejection cases, and pass via tox with no new mypy errors beyond the repo baseline. --- TODO | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/TODO b/TODO index 068e47b..82a0626 100644 --- a/TODO +++ b/TODO @@ -284,7 +284,7 @@ Content-Type: application/issue ID: 21 Type: feature Title: relax host restriction in vcs.git parse_base_url and parse_repo_name -Status: open +Status: in-progress Priority: high Created: 2026-06-06 Relationships: @@ -297,17 +297,3 @@ Description: Both byteb4rb1e.utils.vcs.git.parse_base_url and parse_repo_name #105) now feed Forgejo-shaped URLs like 'git@git.code.tiararodney.com:h5p-mirror/foo.git' through these helpers and hit the restriction. - - The helpers' actual job is purely SCP-style parsing: extract the - owner/workspace segment, or the repo basename. Neither requires - knowing the host. The fix is to drop the host check while keeping - the SCP-style structural validation (must contain ':', must not - contain '//'). Update the docstrings to reflect that the host is - now arbitrary, and update the doctests if they assert on the - host-specific path. - - Acceptance: both functions accept Forgejo and Bitbucket SCP URLs - and return the correct owner / repo name; the SCP-style format - check still rejects malformed inputs (no colon, contains '//' for - ssh:// or https://); existing call sites in any current consumer - continue to work; tests cover at least the Forgejo URL path.