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

cargo-smart-release changelog generates broken (invalid) links when using ssh remote #512

Closed
1 task done
mattcl opened this issue Aug 30, 2022 · 2 comments
Closed
1 task done

Comments

@mattcl
Copy link

mattcl commented Aug 30, 2022

Duplicates

  • I have searched the existing issues

Current behavior 😯

I've been using cargo-smart-release for months now and just noticed today that the links to commits in the generated changelog are invalid. See https://raw.githubusercontent.com/mattcl/confpiler/13c07d1003754ef0bfbccc350ffa7ac99b066d3d/confpiler_cli/CHANGELOG.md

Specifically, the generated host is https://github.comgit// note the "git" suffix and the extra slash.

That repo has the following remote configuration on my local machine:

$ git remote -v
origin	git@github.com:mattcl/confpiler.git (fetch)
origin	git@github.com:mattcl/confpiler.git (push)

I suspect this line to be the culprit, but I have to admit I've only briefly dug through the code.

.map(|user| format!("https://github.com{}/{}", user, self.cleaned_path())),

It would seem that the user in that case is going to be git.

Checking my other projects using smart release, they all exhibit this problem in their changelogs.

I can confirm that switching the remote url to use https instead of git@... generates a changelog with the correct commit links.

A quick search on github yields other repos with changelogs exhibiting the same issue. Here's an example https://raw.githubusercontent.com/saskenuba/yapay-sdk-rust/311697521ee9f7e3cdd721de13c16ff9a07a7c6d/CHANGELOG.md

Expected behavior 🤔

Expected behavior would be valid links to commits written to the changelog.

Steps to reproduce 🕹

It should be possible to reproduce this in any repository with a remote of git@github.com:<user>/<repo>.

@Byron
Copy link
Owner

Byron commented Aug 30, 2022

I've been using cargo-smart-release for months now and just noticed today that the links to commits in the generated changelog are invalid

That's awesome, and great catch, thanks for creating such a detailed report!

I couldn't resist to take a look at exactly where you pointed me and the fix was just one (previously missing) unit test away. Another cargo smart-release cargo-smart-release -e later and all was set and done.

Next time you release I would expect the changelogs in the repository to be rewritten with the correct links. The annotated tags and GitHub releases will remain like this forever though.

@Byron Byron closed this as completed Aug 30, 2022
@mattcl
Copy link
Author

mattcl commented Aug 30, 2022

Can confirm the fix works for me. Thanks for the quick turnaround.

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

No branches or pull requests

2 participants