Skip to content

gstack-artifacts-url accepts host-only and owner-only remotes as repositories #1597

Closed

Description

@jbetala7

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.

Activity

  1. jbetala7 commented on May 19, 2026

    @jbetala7
    ContributorAuthor

    Opened PR #1598 with the fix: #1598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions