diff --git a/TODO b/TODO index db556b7..068e47b 100644 --- a/TODO +++ b/TODO @@ -278,3 +278,36 @@ Description: Extend byteb4rb1e.utils.http.client with an HttpSession class that header merging, and HTTPError-to-response conversion. Also refactor HttpResponse into a frozen dataclass with text as a derived property. + +--ISSUE +Content-Type: application/issue +ID: 21 +Type: feature +Title: relax host restriction in vcs.git parse_base_url and parse_repo_name +Status: open +Priority: high +Created: 2026-06-06 +Relationships: +Description: Both byteb4rb1e.utils.vcs.git.parse_base_url and parse_repo_name + currently hard-reject any URL whose host is not exactly + 'bitbucket.org' with a ValueError. The check predates the + multi-SaaS world (it dates back to when bootstrapping required the + Bitbucket API). With the new forgejo saas wrapper (#18) in place, + downstream consumers (specifically sphinxcontrib.h5p.utils.pkg + #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.