Malformed clone_url generated when repo URL is in ssh:// format (regex isn't anchored)
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start in client/src/components/apps/form.vue, in updateApp() around lines 2307-2312, and inspect how ssh_url is transformed into clone_url. Reproduce with an ssh://user@host/path.git repository, save the app, and inspect the resulting clone_url on the KuberoApp CR. Done means the value is a valid https://host/path.git URL without the ssh:// prefix.
Written by the indexing model from the issue text.
Description
Which component(s) is affected?
Kubero CLI
Describe the bug
In client/src/components/apps/form.vue (updateApp(), around line 2307-2312), clone_url is derived from ssh_url using this regex:
js
const regex = /(git@|ssh:|http[s]?://)([\w.]+)(:|/)([\w/-~]+)(.git)?/;
this.gitrepo.clone_url = this.gitrepo.ssh_url.replace(regex, "https://$2/$4$5");
This works for the scp-style git@host:path format, but not for ssh://user@host/path format. Since the regex isn't anchored to the start of the string, when matching against ssh://git@github.com/foo/bar.git, the ssh: alternative fails to match at position 0 (the next character is /, not a word character), so the engine slides forward and matches starting at git@ instead. .replace() only swaps out the matched substring, leaving the ssh:// prefix untouched.
Steps to reproduce
- Edit an app's git repository field in the Kubero UI with a URL in ssh://user@host/path.git format
- Save
- Inspect the resulting clone_url on the KuberoApp CR
Expected behavior
Expected behavior: clone_url should be a valid https://host/path.git URL.
Actual behavior: clone_url becomes ssh://https://host/path.git — malformed and unusable for cloning.
Suggested fix: Anchor the regex (^) or use a proper URL-parsing approach instead of a permissive unanchored match.
Screenshots
No response
Additional information
No response
Debug information
No response
- Dominant language
- TypeScript
- Stars
- 4.4k
- Forks
- 212
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from kubero-dev/kubero
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
kubero-dev/kubero#798 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
kubero-dev/kubero#744 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
kubero-dev/kubero#738 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
kubero-dev/kubero#737 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
kubero-dev/kubero#735 · 1 comment · 3 reactions ·
All issues in kubero-dev/kubero
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100