-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
GitLab Integration #3327
GitLab Integration #3327
Changes from 38 commits
ef9c792
cf5c47c
2356d84
7113e94
5d7d6c1
f9df35e
e4adb98
da7471f
aec6941
9152bb6
299a2b5
8a10848
97a4fb1
dff4d7d
4fbe6bb
50285fe
e288bf3
6c8d1c3
0cb1ed5
435e870
c33b691
be5ccd0
7e38e70
90e4ba1
1e8a8a8
2fa1c51
39c9899
c2f16d6
e77efa4
b1ff48c
4db7339
5e5a6c8
b8e1b25
ad6ba74
66f8ea2
237531c
4e6f4a6
0ce1702
1e668e1
4eec51e
1e5200e
12eae4b
3d276dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[flake8] | ||
ignore = E125,D100,D101,D102,D105,D107,D200,D211,P101,FI15,FI16,FI12,FI11,FI17,FI50,FI53,FI54 | ||
ignore = E125,D100,D101,D102,D103,D105,D107,D200,D202,D211,P101,FI15,FI16,FI12,FI11,FI17,FI50,FI53,FI54,MQ101,T000 | ||
max-line-length = 80 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ repos: | |
'flake8-string-format', | ||
'flake8-tidy-imports', | ||
'flake8-todo'] | ||
exclude: 'test_oauth.py' | ||
- id: trailing-whitespace | ||
|
||
- repo: [email protected]:pre-commit/mirrors-yapf.git | ||
|
@@ -34,6 +35,7 @@ repos: | |
- id: yapf | ||
exclude: 'migrations|settings|scripts' | ||
additional_dependencies: ['futures'] | ||
args: ['--style=.style.yapf', '--parallel'] | ||
|
||
- repo: [email protected]:FalconSocial/pre-commit-python-sorter.git | ||
sha: b57843b0b874df1d16eb0bef00b868792cb245c2 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ More information can be found in the :doc:`vcs` page. | |
Auto-updating | ||
------------- | ||
|
||
The :doc:`webhooks` page talks about the different ways you can ping RTD to let us know your project has been updated. We have official support for GitHub, and anywhere else we have a generic post-commit hook that allows you to POST to a URL to get your documentation built. | ||
The :doc:`webhooks` page talks about the different ways you can ping RTD to let us know your project has been updated. We have official support for GitHub, Bitbucket and GitLab, and anywhere else we have a generic post-commit hook that allows you to POST to a URL to get your documentation built. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. <3 doc updates. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Credits to @saily, the original author :) |
||
|
||
Internationalization | ||
-------------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ GitLab | |
* Click **Integrations** | ||
* For **URL**, use the URL of the integration on Read the Docs, found on the | ||
:ref:`integration detail page <integration-detail>` page | ||
* Leave the default **Push events** selected | ||
* Leave the default **Push events** selected and mark **Tag push events** also | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure, but I think we need the Tag push events here also... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like we'd want them. +1 |
||
* Finish by clicking **Add Webhook** | ||
|
||
Using the generic API integration | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Utilities for the builds app.""" | ||
|
||
from __future__ import absolute_import | ||
import re | ||
from __future__ import ( | ||
absolute_import, division, print_function, unicode_literals) | ||
|
||
import re | ||
|
||
GH_REGEXS = [ | ||
re.compile('github.com/(.+)/(.+)(?:\.git){1}'), | ||
|
@@ -16,6 +18,14 @@ | |
re.compile('bitbucket.org:(.+)/(.+)\.git'), | ||
] | ||
|
||
# TODO: I think this can be different than `gitlab.com` | ||
# self.adapter.provider_base_url | ||
GL_REGEXS = [ | ||
re.compile('gitlab.com/(.+)/(.+)(?:\.git){1}'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we going to support private gitlab instalation? How this should looks like? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will, but this integration will be on the .com, we won't put that code here yet. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. So, I think the TODO note is good for now. I will leave it there |
||
re.compile('gitlab.com/(.+)/(.+)'), | ||
re.compile('gitlab.com:(.+)/(.+)\.git'), | ||
] | ||
|
||
|
||
def get_github_username_repo(url): | ||
if 'github' in url: | ||
|
@@ -33,3 +43,12 @@ def get_bitbucket_username_repo(url=None): | |
if match: | ||
return match.groups() | ||
return (None, None) | ||
|
||
|
||
def get_gitlab_username_repo(url=None): | ||
if 'gitlab' in url: | ||
for regex in GL_REGEXS: | ||
match = regex.search(url) | ||
if match: | ||
return match.groups() | ||
return (None, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has a lot of long lines that I don't want to fix now :)