Add Support for GOGs

Issue #100 new
River Hog created an issue

Hello,

I tried to add a GOGs (selfhosted) repository to jigit. Gog works very similar to GitHub - they aim to have GitHub v3 compatible rest api, see https://github.com/gogs/docs-api . The connection check shows a 404 and I see in logs access for test https://my-server-name/api/v3/repos/ORGANIZATION/REPOSITORY/branches/master but GOGs api has version 1 so actual link in my case will be https://my-server-name/api/v1/repos/ORGANIZATION/REPOSITORY/branches/master . From my understanding the difference is only in URL to create /v1/ versus /v3/ since API suppose to be compatible. Is there any chance you can create some test build with one more choice “GOGs” and with generation “/v1/” URLs for calls, but similar to GitHub - even just to test it? Unfortunately I am not a developer, so cannot just fork this project for test.

If you will be able to check GOGs documentation (link above) to see will it work with minimal changes on your side - it will be really nice.

TIA, RH.

Comments (3)

  1. Dmitrii Apanasevich repo owner

    Hi,

    Well, it is possible in general, but it requires a deeper look at the API. At first sight, API is very similar, but it is not the same in the content of the responses. For example, I didn't find information about changed files. Compare response content from https://developer.github.com/v3/repos/commits/#get-a-single-commit and https://github.com/gogs/docs-api/blob/master/Repositories/Commits.md Github API contains files section whereas it is missed in GOGs. Maybe, this is an issue of the documentation, and a real server returns the shange set. Could you check it?

  2. River Hog reporter

    Greetings,

    thank you for time and effort to checking this out.

    I have run single commit API call and it looks like GOG documentation is up-today and “files” section is not presented in answer 😞 See output below.

    [user@server ~]$ curl -k -H "Authorization: token f....a" https://my-server-name/api/v1/repos/ORGANIZATION/REPOSITORY/commits/1.....7

    {"url":"https://my-server-name/api/v1/repos/ORGANIZATION/REPOSITORY/commits/1.....7","sha":"1.....7","html_url":"https://my-server-name/ORGANIZATION/REPOSITORY/commits/1.....7","commit":{"url":"https://my-server-name/api/v1/repos/ORGANIZATION/REPOSITORY/commits/1.....7","author":{"name":"Joe Doe","email":"JDoe@mail.com","date":"2020-03-06T12:42:38-05:00"},"committer":{"name":"Joe Doe","email":"JDoe@mail.com","date":"2020-03-06T12:42:38-05:00"},"message":"JIRA-71 jythons","tree":{"url":"https://my-server-name/api/v1/repos/ORGANIZATION/REPOSITORY/tree/1.....7","sha":"1.....7"}},"author":{"id":20,"username":"JDoe","login":"JDoe","full_name":"Joe Doe","email":"JDoe@mail.com","avatar_url":"https://my-server-name/avatars/20"},"committer":{"id":20,"username":"JDoe","login":"JDoe","full_name":"Joe Doe","email":"JDoe@mail.com","avatar_url":"https://my-server-name/avatars/20"},"parents":[{"url":"https://my-server-name/api/v1/repos/ORGANIZATION/REPOSITORY/commits/f......6","sha":"f.....6"}]}

    HTH, RH

  3. Log in to comment