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

Fix broken links by removing module name from github links #171

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

willie-yao
Copy link
Contributor

There is an issue with some of the links generated using the -l flag. Some dependencies erroneously include the module name in the GitHub link. This PR adds some logic to trim the end of the link if it includes the module name.

How to reproduce bug:

go-modiff -r github.com/kubernetes-sigs/cluster-api -f v1.3.9 -t v1.3.10 -l

Notice how some links look like this https://github.com/cespare/xxhash/v2/compare/v2.1.2...v2.2.0 and lead to a 404 page when it should be this https://github.com/cespare/xxhash/compare/v2.1.2...v2.2.0.

Copy link

codecov bot commented Feb 1, 2024

Codecov Report

Merging #171 (25be389) into main (4ab9094) will increase coverage by 0.14%.
Report is 3 commits behind head on main.
The diff coverage is 82.45%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #171      +/-   ##
==========================================
+ Coverage   81.16%   81.31%   +0.14%     
==========================================
  Files           1        1              
  Lines         154      182      +28     
==========================================
+ Hits          125      148      +23     
- Misses         20       24       +4     
- Partials        9       10       +1     

@willie-yao willie-yao changed the title Fix broken links by removing module name from github links WIP: Fix broken links by removing module name from github links Feb 1, 2024
@willie-yao willie-yao marked this pull request as draft February 1, 2024 01:31
@willie-yao willie-yao changed the title WIP: Fix broken links by removing module name from github links Fix broken links by removing module name from github links Feb 1, 2024
@willie-yao willie-yao marked this pull request as ready for review February 1, 2024 21:14
@willie-yao
Copy link
Contributor Author

Hi @saschagrunert! We are running into an issue with some of the links generated from this tool. Let me know if it's okay for this fix to be included in the tool!

@@ -12,7 +12,6 @@ linters:
- containedctx
- contextcheck
- decorder
- depguard
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what's up with depguard, but I had to update golangci for go 1.21 and it marked every import as not allowed.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is ok, lgtm

@@ -9,7 +9,7 @@ stdenv: &stdenv
executors:
container:
docker:
- image: cimg/go:1.20
- image: cimg/go:1.21
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating to go 1.21 so I can use the slices package.

Copy link

@cpanato cpanato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -12,7 +12,6 @@ linters:
- containedctx
- contextcheck
- decorder
- depguard
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is ok, lgtm

@@ -89,6 +88,7 @@ linters:
- whitespace
- wrapcheck
# - cyclop
# - depguard
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove this from the comment

Copy link
Owner

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@saschagrunert saschagrunert merged commit 5076f46 into saschagrunert:main Feb 5, 2024
8 checks passed
@saschagrunert
Copy link
Owner

Created v1.3.4 for that

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

Successfully merging this pull request may close these issues.

None yet

3 participants