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.

Changelog links are incorrect for selfhosted gitlab (default setup) since 6.0.0

See original GitHub issue

This is not a duplicate of #204. We have standard self-hosted Gitlab server running.

With 5.0.2 we get this output on an fresh repo with npm init and adding standard-version@5.0.2 only:

./node_modules/.bin/standard-version --dry-run
✔ bumping version in package.json from 1.0.0 to 1.1.0
✔ bumping version in package-lock.json from 1.0.0 to 1.1.0
✔ created CHANGELOG.md
✔ outputting changes to CHANGELOG.md

---
# 1.1.0 (2019-06-17)


### Bug Fixes

* remove node_modules ([613feb1](https://gitlab.company.net/myusername/changelogtest/commit/613feb1))


### Features

* add inital npm setup ([9d33dfb](https://gitlab.company.net/myusername/changelogtest/commit/9d33dfb))
* add standard-version v5.0.2 ([a09dc1c](https://gitlab.company.net/myusername/changelogtest/commit/a09dc1c))
---

After installing 6.0.0 (or 6.0.1) like this:

npm i standard-version@6.0.0

We now get broken links:

./node_modules/.bin/standard-version --dry-run
✔ bumping version in package.json from 1.0.0 to 1.1.0
✔ bumping version in package-lock.json from 1.0.0 to 1.1.0
✔ created CHANGELOG.md
✔ outputting changes to CHANGELOG.md

---
## 1.1.0 (2019-06-17)


### Bug Fixes

* remove node_modules ([613feb1](https://gitlab.company.net///commit/613feb1))


### Features

* add inital npm setup ([9d33dfb](https://gitlab.company.net///commit/9d33dfb))
* add standard-version v5.0.2 ([a09dc1c](https://gitlab.company.net///commit/a09dc1c))
---

I know 6.0.0 introduced breaking changes but I couldn’t find something related to this after skimming over the commits and changes since 5.0.2.

Do you have any idea or tipps in what direction I could research?
This issue only appears with a self-hosted Gitlab instance. I tried the same with a repo from the public Github and Gitlab services and both work. I’m confused.

Update:
Another thing I noticed. Using conventional-changelog-cli the changelog is being generated correctly.

./node_modules/.bin/conventional-changelog -p angular -i CHANGELOG.md -s -r 0
cat CHANGELOG.md

CHANGELOG.md:

# 1.0.0 (2019-06-18)


### Bug Fixes

* remove node_modules ([613feb1](https://gitlab.company.net/myusername/changelogtest/commit/613feb1))


### Features

* add inital npm setup ([9d33dfb](https://gitlab.company.net/myusername/changelogtest/commit/9d33dfb))
* add standard-version v5.0.2 ([a09dc1c](https://gitlab.company.net/myusername/changelogtest/commit/a09dc1c))

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:15
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
smzelekcommented, Oct 16, 2019

I have identified the issue. It occurs in this deeply nested NPM dependency: hosted-git-info. I encountered the same issue. I opened an Issue in their repo. Maybe a maintainer of Standard Version could help by opening an MR to them, or using a different dependency?

https://github.com/npm/hosted-git-info/issues/54

Dependency chain of the issue is:

standard-version changelog.js -> conventional-changelog index.js -> conventional-changelog-core merge-config.js -> get-pkg-repo index.js -> hosted-git-info index.js

I actually have no idea where to report this issue since it goes so deep. Essentially, all along the way, a GitHub URL is being assumed. Gitlab allows subgroups and this totally breaks the repository url parsing code. This is not a user issue at all – the code doesn’t even handle the case gracefully. Instead you end up with that triple /// in your CHANGELOG url because the tooling returns a null string in the config needed by conventional-changelog-conventionalcommits package.

conventional-changelog-angular\templates\header.hbs references properties like,

which all are null because of the failure to parse.

5reactions
smutelcommented, Sep 11, 2020

As a workaround, you can create a file called .versionrc at the root of your project with:

{
  "types":[
    {
      "type":"enh",
      "section":"Enhancements"
    },
    {
      "type":"feat",
      "section":"Features"
    },
    {
      "type":"fix",
      "section":"Bug Fixes"
    },
    {
      "type":"test",
      "section":"Tests"
    },
    {
      "type":"build",
      "section":"Build System"
    },
    {
      "type":"ci",
      "hidden":true
    },
    {
      "type":"git",
      "hidden":true
    }
  ],
  "commitUrlFormat": "https://xxx/yyy/commit/{{hash}}",
  "compareUrlFormat": "https://xxx/yyy/compare/{{previousTag}}...{{currentTag}}",
  "issueUrlFormat": "https://xxx/yyy/issues/{{id}}",
  "userUrlFormat": "https://xxx/gitlab/{{user}}"
}

Where xxx is the URL to your gitlab and yyy the path to the project.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading GitLab
Depending on the installation method and your GitLab version, there are multiple official ways to update GitLab: Linux packages (Omnibus GitLab); Source ...
Read more >
jira integration not working since upgrade to 12.6.2 - GitLab
Enter URL User&Password and ensure that all checkboxes are selected at least the "Commit" trigger. Make changes to the project and push it...
Read more >
All incoming mail stopped working after update to v15.3.1 from ...
Summary Incoming mails worked perfectly fine until I received the v15.3.1 update last night. Since then service desk and ticket creation...
Read more >
Log system - GitLab Docs
application.log. Depending on your installation method, this file is located at: Omnibus GitLab: /var/log/gitlab/gitlab ...
Read more >
Account and limit settings - GitLab Docs
You can configure the default maximum number of projects new users can create in their personal namespace. This limit affects only new user...
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