question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

repository url is no correct

See original GitHub issue
$ standard-version --dry-run
✔ bumping version in package.json from 0.2.2 to 0.2.3
✔ outputting changes to CHANGELOG.md

---
### [0.2.3](https://git.llsapp.com///compare/v0.2.1...v0.2.3) (2020-01-14)


### Features

* umd ([90fadf3](https://git.llsapp.com///commit/90fadf3d012a8427af65fb1582a5b7983956d2ed))
* umd ([694c577](https://git.llsapp.com///commit/694c577f9bb55277df7ee57a581756f7290abaf9))
* umd ([18644ac](https://git.llsapp.com///commit/18644ac313e935e156b67236034a364bc49c5e29))
* umd ([2dc3517](https://git.llsapp.com///commit/2dc3517bd86efcb89d4a0d1c52eebb08ba271745))


### Bug Fixes

* using idlize module and compile it ([a70c8ba](https://git.llsapp.com///commit/a70c8ba3d49f5c0298954e08cc56eaf27cb69bcd))
---

✔ committing package.json and CHANGELOG.md
✔ tagging release v0.2.3
ℹ Run `git push --follow-tags origin fix/idlize && npm publish` to publish

try to config it through standard-verison in package.json. not woking.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
NicBrightcommented, Mar 23, 2020

To put it otherwise:

Conventional changelog should provide a way to support urls where user and project can be anywhere as part of the path url (e.g. https://git.some.corporate.domain.tld/scm/b2e/b2e-rwc.git).

It seems that the package @hutson/parse-repository-url cannot cope with that use case. To be more precisely: I think @hutson/parse-repository-url splits only at the last slash (/) in the pathname, and everything before that will be considered to be the user which is not always correct.

Maybe it would help if one could specify the format of the repository like this (directly in package.json)?

"repository": {
    "url": "https://git.some.corporate.domain.tld/scm/b2e/b2e-rwc.git"
    "format": "http://{{domain}}/scm/{{user}}/{{project}}.git"
  }

or (taking precedence over “format” property):

"repository": {
    "url": "https://git.some.corporate.domain.tld/scm/b2e/b2e-rwc.git"
    "domain": "git.some.corporate.domain.tdl",
    "user": "b2e",
    "project": "b2e-rwc"
  }

In any of these cases, where either format, or any of domain, user, project are present in the repository field of package.json, the standard logic from @hutson/parse-repository-url should be ignored.

What do you think?

0reactions
hutsoncommented, Sep 20, 2020

Howdy, I am the maintainer of @hutson/parse-repository-url.

@lili21 reported an issue with the https://git.llsapp.com/client-infra/thanos/thanos-web.git URL.

Using @hutson/parse-repository-url I get:

> parser('https://git.llsapp.com/client-infra/thanos/thanos-web.git')
{
  browse: [Function (anonymous)],
  domain: 'git.llsapp.com',
  project: 'thanos-web',
  type: null,
  user: 'client-infra/thanos'
}

This appears correct to me. The client-infra/thanos segment of the URL is treated as the user.

I do not know why this would cause standard-version to generate URLs like https://git.llsapp.com///commit/90fadf3d012a8427af65fb1582a5b7983956d2ed.

@alaingiller reported a similar issue with a repository URL containing multiple segments before the project name (http://git.xxxx.com/xxx/yyy/zzz.gi).

@xtutu reported an issue with the http://git.xxxx.com:3000/yyy/zzz.git URL.

Using @hutson/parse-repository-url I get:

> parser('http://git.xxxx.com:3000/yyy/zzz.git')
{
  browse: [Function (anonymous)],
  domain: 'git.xxxx.com:3000',
  project: 'zzz',
  type: null,
  user: 'yyy'
}

The port number is included as part of the domain property.

Also, as pointed out by @xtutu, this appears to work as expected when using get-pkg-repo and conventional-changelog.

I do not know why this would cause standard-version to generate invalid URLs.

Can someone please help me understand what standard-version is expecting from get-pkg-repo and @hutson/parse-repository-url that has caused invalid URLs to be generated?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Repository not found.' when URL is correct and SSH key is used
I was having no issue cloning a remote repository a number of times in the morning while debugging a Jenkins build job that...
Read more >
Repository import by URL throws "There is not a valid Git ...
Attempting to import a repository from a Git 3rd party vendor such as GitHub or BitBucket Cloud via import by URL throws the...
Read more >
How to Fix Your Git Repository URL - YouTube
This video shows you how to fix your Git repository URL when you accidentally use the wrong clone URL. There is no need...
Read more >
Issue with SourceTree while cloning a GitHub repository
This is not a valid source path / URL ... Enabling Mercurial (or Git in your case) allowed the clone dialogue to correctly...
Read more >
Fix Git's 'fatal: repository not found' error quickly | TheServerSide
If the repository was deleted or renamed, you'll obviously hit a Git repository not found error when you attempt to clone or fetch...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found