Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternate changelog links for gitlab? #257

Closed
flyinbutrs opened this issue Dec 3, 2017 · 12 comments
Closed

Alternate changelog links for gitlab? #257

flyinbutrs opened this issue Dec 3, 2017 · 12 comments

Comments

@flyinbutrs
Copy link
Contributor

flyinbutrs commented Dec 3, 2017

The compiled markdown file puts links to the commits in the changelog as:

{{repo_url}}/commits/{{commit_hash}}

However, gitlab uses:

{{repo_url}}/commit/{{commit_hash}}

Is there any ability to modify this?

@stevemao
Copy link
Member

stevemao commented Dec 3, 2017

@flyinbutrs
Copy link
Contributor Author

No, how do I do that? I don't see it in the documentation anywhere.

@flyinbutrs
Copy link
Contributor Author

Yeah, I found that in the docs, but I don't quite understand how to change that parameter. I assume by the docs there that it will default to the hostname of your repo, but in my case it's a private hosted gitlab, so it can't determine it from that hostname. Should I just add "host": "gitlab" to my package.json?

@flyinbutrs
Copy link
Contributor Author

Figured it out...

in case anyone googles and is looking for the answer:

"repository": "gitlab:<repo_url_here>"

@flyinbutrs
Copy link
Contributor Author

Actually, strike that... I just noticed, when you do gitlab:<url>, it assumes you want gitlab.com, and prefixes your repo URL with https://www.gitlab.com/. Is there any way to use gitlab style issues/commit links but with a privately hosted gitlab?

@stevemao
Copy link
Member

stevemao commented Dec 5, 2017

For now, you could overwrite any context value.

conventionalChangelogCore(options, {
    host: 'gitlab'
})

@flyinbutrs
Copy link
Contributor Author

Interesting. I'm trying to use standard-version / commitizen / standard-changelog with a variety of non-NPM packages (python, ruby, puppet), because I find it much friendlier out of the box than the other tools I've used for this type of build activity.

That being said, I'm not really NPM "aware" in terms of what might be conventional in the JS world, and the docs are not really friendly to my use case (possibly for a reason).

So... where would I put that? Is there a guide I'm missing for how to "configure" this suite and where to put tweaks like this?

@hutson
Copy link
Contributor

hutson commented Dec 6, 2017

@flyinbutrs the use of standard-version and commitizen is fine, and, by download count, used quite extensively within the JavaScript community.

I believe standard-changelog is just conventional-changelog, but setup to use the angular preset by default.

@flyinbutrs can you re-post this issue on the standard-version project?

I believe the issue will be that standard-version does not allow you to forward options like host to the underlying conventional-changelog library.

Long-term I believe the goal is to allow configuration through an RC file at the root of a project - #195

@flyinbutrs
Copy link
Contributor Author

@hbetts I will repost there. I think this can also be fixed to allow package.json's .repository.type to be allowed in cases where autodetection fails pretty easily. I laid out the steps in this PR.

@muuvmuuv
Copy link

I do have the same issue with a self-hosted version of GitLab, see my issue #616. IMO the best solution is a custom config (#195) for this to exactly specify the host to gitlab and a repoUrl to separate it. Fallback to package.json is still an option then.

@baby-gnu
Copy link

baby-gnu commented Jun 1, 2023

As I had the same issue using semantic-release, I override 3 url format option as described in the documentation

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

No branches or pull requests

5 participants