capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

Inconsistencies on git repos URL

Open rubenandre opened this issue 10 months ago • 1 comments

In first place thanks by this amazing project.

I found some inconsistencies on "Sync" section. Since the source spec that comes from the API already includes https:// including it on Kustomization.jsx:143 generates an invalid URL (https://https//gitlab.com) when clicking the link.

image

image

I did a local modification on the line 143 to remove the prefix https://, but it also fails (in my case) because the git repository URL ends on a .git.

I'll open a PR to fix this specific case, but this might need an extra evaluation and string manipulation logic to handle this in another way because I foresee that this will also break for the following scenarios:

  • source spec url already contains https:// and is not ssh type (does not contain '@' used on Kustomization.jsx:107)
  • repo url ends on .git - for example GitLab does not allow https://gitlab.com/{OWNER}/{REPO_NAME}.git/commit/{COMMIT_HASH} it only supports https://gitlab.com/{OWNER}/{REPO_NAME}/commit/{COMMIT_HASH}

The PR will target Kustomization.jsx:107 because targeting Kustomization.jsx:143 would break it for ssh type git repository source

rubenandre avatar Apr 15 '24 22:04 rubenandre

Appreciate the issue and the PR. Looks like I am messing up with the support of the many source kinds. Especially I don't use half of them in my day-to-day work.

I need to recollect myself and sit down to focus, quickfixes just generate more issues. That said, please allow me a few days to evaluate your PR.

laszlocph avatar Apr 16 '24 07:04 laszlocph

We have a similar issue with github as well, there https://github.com/{OWNER}/{REPO_NAME}.git/commit/{COMMIT_HASH} doesnt work, but https://github.com/{OWNER}/{REPO_NAME}/commit/{COMMIT_HASH} works. So it should strip the .git if it has either with SSH or HTTP(S)

@laszlocph any idea when this PR would be merged and fixed, and also roll out a new version?

yashwanth-l avatar Aug 30 '24 15:08 yashwanth-l