Fix generating links for gitlab repos in subgroups #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey,
first of all, thanks for the great package. I found a minor bug when using it with gitlab repositories.
Gitlab allows creating subgroups, for instance here is one of the gitlab repostiories: https://gitlab.com/gitlab-org/ci-cd/shared-runners/images/gcp/windows-containers . The source git path for that repo has many
/signs:The regex that is used to substitute package url does not allow for that, it only allows single
/sign in path. As a result, it generated a line like that for me:As you can see, it left the
git@part in the comparison link, becausepreg_replacepattern didn't match anything.I propose a simple fix that allows
/in repository namespaces.Additionally, comparison links across forks like:
don't work on gitlab for me, they have slightly different syntax:
Unfortunately, we cannot generate it without knowing internal numerical project id, so I propose to simply return null in gitlab links generator when project namespaces don't match.