iver-wharf / wharf-provider-gitlab

Import Wharf projects from GitLab repositories
MIT License
2 stars 0 forks source link

Cannot import project whose name is subset of other project #3

Closed applejag closed 2 years ago

applejag commented 3 years ago

Let's say you have projects

Then when importing the first one it fails with the log message:

INFO[2021-05-04T12:14:13Z] Invalid projects count                        group name=mygroup project name=myrepo

The log message comes from here:

https://github.com/iver-wharf/wharf-provider-gitlab/blob/413c450167f12fc9978c6fe75b192b7e993f891a/gitlab.go#L48-L66

Proposed solution

When searching for projects in the above function, then after that do yet another filtering for the project names as client.listProjectsFromGroup apparently does a search and matches subset project names