alexandear / import-gitlab-commits

Import commits from a private GitLab repository in an anonymized way.
MIT License
161 stars 14 forks source link

Not working with older gitlab self hosted version #23

Closed waltir closed 1 year ago

waltir commented 1 year ago

The company I work for has an older self hosted version of Gitlab which appears to only have access to /api/v3/ as opposed to /api/v4/ which this project appears to be using. My unfamiliarity with GO has made it challenging to determine if this can be modified for my teams use or not.

~/Desktop/import-gitlab-commits main ⇣3 !3 import-gitlab-commits ✔ 02:59:51 PM 14:59:54 main.go:59: Error: app run: get current user: get current user: GET https://gitlab.companyNameHere.com/api/v4/user: 404 failed to parse unknown error format

This https://gitlab.companyNameHere.com/api/v3/user, however, does appear to work when I hit it directly with a PRIVATE-TOKEN header set.

• Do you have any recommendations for how I could modify this for an older gitlab instance? • Could support be added on your end that would allow users to set an env variable for the required api version?

Thanks

alexandear commented 1 year ago

@waltir thanks for the questions.

API v3 is deprecated since GitLab 11.0. I don't think that the project should support the old GitLab instance because a lot of effort is needed.