Observed problem
gstack-artifacts-url accepts malformed remotes that contain only a host, or
only a host plus owner, and treats those partial paths as valid repositories.
Current behavior on upstream main:
$ bin/gstack-artifacts-url --to ssh https://github.com
git@github.com:github.com.git
$ bin/gstack-artifacts-url --owner-repo https://github.com/owner
owner
$ bin/gstack-artifacts-url --to https ssh://git@github.com
https://github.com/github.com
Those outputs are not valid owner/repo remotes. A caller that passes a truncated
or misconfigured artifacts remote can silently derive the wrong SSH/HTTPS URL
instead of failing fast.
Expected behavior
The helper should reject remote forms whose path is empty, missing the owner, or
missing the repo. It should keep accepting valid inputs like:
https://github.com/owner/repo
https://github.com/owner/repo.git
git@github.com:owner/repo.git
ssh://git@github.com/owner/repo.git
Duplicate search
I checked open issues and PRs for:
gstack-artifacts-url
artifacts url malformed
artifacts remote URL
gstack-artifacts
Closest existing items:
Candidate fix shape
Tighten parse_url() so the parsed path must contain at least two non-empty
segments (owner/repo) after stripping .git, and add regression coverage in
test/gstack-artifacts-url.test.ts.
Observed problem
gstack-artifacts-urlaccepts malformed remotes that contain only a host, oronly a host plus owner, and treats those partial paths as valid repositories.
Current behavior on upstream
main:Those outputs are not valid owner/repo remotes. A caller that passes a truncated
or misconfigured artifacts remote can silently derive the wrong SSH/HTTPS URL
instead of failing fast.
Expected behavior
The helper should reject remote forms whose path is empty, missing the owner, or
missing the repo. It should keep accepting valid inputs like:
https://github.com/owner/repohttps://github.com/owner/repo.gitgit@github.com:owner/repo.gitssh://git@github.com/owner/repo.gitDuplicate search
I checked open issues and PRs for:
gstack-artifacts-urlartifacts url malformedartifacts remote URLgstack-artifactsClosest existing items:
gh#1348 / fix(artifacts-init): honor gh/glab git_protocol when picking push URL #1469 cover choosing SSH vs HTTPS push URLs based ongh/glabprotocol config. They do not change malformed URL validation in
bin/gstack-artifacts-url.gstack-artifactsPRs target artifacts sync, docs, migration, orbranch wiring rather than the URL parser accepting host-only/owner-only input.
Candidate fix shape
Tighten
parse_url()so the parsed path must contain at least two non-emptysegments (
owner/repo) after stripping.git, and add regression coverage intest/gstack-artifacts-url.test.ts.