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

Hook for GitLab #1068

Closed
alexjironkin opened this issue Dec 5, 2014 · 24 comments
Closed

Hook for GitLab #1068

alexjironkin opened this issue Dec 5, 2014 · 24 comments
Labels
Improvement Minor improvement to code Needed: patch A pull request is required Sprintable Small enough to sprint on
Milestone

Comments

@alexjironkin
Copy link

Hi,

I was trying to get RTD to play nicely with GitLab and found a little problem in that if the project is marked as private/internal RTD needs authentication details in order to clone it.

So is there any plans to make RTD integrate with GitLab repos a little better? I think there are a lot of people that currently host either internal GitLab servers or projects on GitLab.com that would be very excited about ability to use RTD for their documentation!

@agjohnson
Copy link
Contributor

I'm not a gitlab user, but I imagine support shouldn't be very hard to build in. I think supporting gitlab.com would definitely be a good addition.

However, we aren't looking to support private/internal documentation, or public documentation for code that is private, on readthedocs.org -- we wish to only support open source projects with readthedocs.org.
We will soon be launching readthedocs.com, usable for private/internal documentation or for users with special authentication needs, such as private key auth on a hosted install of gitlab.

@gigster99
Copy link

@agjohnson please put me on the announcement list for private documentation. When do you expect to release that service?

@alexjironkin
Copy link
Author

@agjohnson I was setting up RTD server internally to talk to our gitlab server. It's a little complicated because our projects are open source, but we host them internally, yadda yadda yadda. I would also offer help with making this feature and testing it out.

@agjohnson
Copy link
Contributor

@gigster99 in a private beta now, looking to do a public beta the beginning of next year -- feel free to request an invite on readthedocs.com, or shoot me an email at anthony@readthedocs.org

@alexjironkin i haven't used gitlab before, so i'm curious: gitlab public repositories, hosted externally or on gitlab.com, work as expected? also, it sounds like you are using a private designation in gitlab on open source code, why is that?

@alexjironkin
Copy link
Author

@agjohnson We write code for one of the government health departments. As our work is funded by the tax payer, everything we write is also open source, or at least we release it under open source after developing it internally. As such, we have gitlab CE deployed behind corporate firewall to manage repositories, and want to host our documentation using RTD in similar way. If we host projects on internal server, it also makes sense for us to host the documentation for it in a similar way.

@markshao
Copy link

Is there any plan to make RTD well integrated with the Gitlab ? Currently we are using Gitlab internally and need to push the docs to the internal RTD server when something update on the Gitlab automatically.

@weiwongfaye
Copy link

+1

1 similar comment
@mkaag
Copy link

mkaag commented Jan 30, 2015

+1

@agjohnson
Copy link
Contributor

We'd like to be able to support public repos hosted at gitlab. We're focusing on github and bitbucket integrations for now, among many other things. Gitlab is off our radar for the immediate future. We'd be glad to point anyone willing to work on this in the right direction.

@markshao @alexjironkin if these are internal RTD installs, can you not clone via ssh to your internal gitlab installs? If you have the option of ssh pull from gitlab, installing a private key that can auth on the gitlab instance should get you access to your code. The post commit RTD endpoint can then be used to trigger a build.

@deanet
Copy link

deanet commented Feb 17, 2015

+1

2 similar comments
@ghost
Copy link

ghost commented May 6, 2015

👍

@carukc
Copy link

carukc commented May 15, 2015

+1

@warsaw
Copy link

warsaw commented May 19, 2015

Another +1 for gitlab.com integration!

@dissipate
Copy link

We need gitlab integration as well. +1

@BitFis
Copy link

BitFis commented Jun 24, 2015

+1 for a clean gitlab integration

@agjohnson
Copy link
Contributor

We're happy to point anyone that wants to help with this in the right direction. This is low on our priorities at the moment though.

Otherwise, interest is noted, no more reason to add any more noise to this ticket.

@agjohnson agjohnson added Sprintable Small enough to sprint on Needed: patch A pull request is required labels Jun 24, 2015
@takotuesday
Copy link
Contributor

@agjohnson would the place to start be adding gitlab to oauth and then work from there?

@agjohnson
Copy link
Contributor

@takotuesday It depends on the level of integration.

To just accept a webhook and update a project on push, there needs to be an endpoint for github to push to, similar to:
https://github.com/rtfd/readthedocs.org/blob/1511716c9c984e7a53521c0fcc91e50f49e1473c/readthedocs/core/views.py#L197-L274

Ideally, integration would set this up automatically, but this requires oauth support for gitlab in django-allauth. With oauth, we can enable webhooks automatically:
https://github.com/rtfd/readthedocs.org/blob/1511716c9c984e7a53521c0fcc91e50f49e1473c/readthedocs/projects/signals.py

For full integration, we'd need oauth at gitlab, webhook creation, and models in our database to reflect what we get back from gitlab's api:
https://github.com/rtfd/readthedocs.org/blob/1511716c9c984e7a53521c0fcc91e50f49e1473c/readthedocs/oauth/models.py

@agjohnson agjohnson modified the milestone: Gitlab Jul 16, 2015
@agjohnson agjohnson added the Improvement Minor improvement to code label Jul 17, 2015
@ghost
Copy link

ghost commented Jul 20, 2015

To everyone who has previously commented on the desire to have GitLab integration with ReadTheDocs, @agjohnson has setup a GitLab Milestone to track all issues related to adding GitLab support.

We would appreciate your help in developing merge requests to close out the issues, and/or reviewing merge requests related to the GitLab milestone.

@alexjironkin
Copy link
Author

Hi, I am going to find some time to test this on our Gitlab server and feedback as much as I can. I saw there is #1448, would it be better if I pull down that revision before the merge and test it out, or you would like to merge first?

Also, you may not want this polluting your current development, maybe gilab branch would be good place to merge this code, then others might find it easier to pull the latest Gitlab integration code. Only a thought.

@agjohnson
Copy link
Contributor

@alexjironkin We won't merge PRs into master until they are ready for production. Feel free to target the PR branch.

@ericholscher
Copy link
Member

We have merged a hook for GitLab. #1442

@alexjironkin
Copy link
Author

Should Gitlab appear as an option for importing project together with BitBucket and Github? Otherwise, how do I link to gitlab repo? Do I have to manually import git repo then setup hook on gitlab for this? In that case where should the hook go in RTD project?

@agjohnson
Copy link
Contributor

No, that integration is not currently active, #1870 was the PR with work to add this, but it has rotted a bit by now.

Yes, manual import and manual set up of a gitlab webhook -- i'm not a user so can't walk you through that process. Docs here would be a good addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code Needed: patch A pull request is required Sprintable Small enough to sprint on
Projects
None yet
Development

No branches or pull requests