Skip to content

Commit ba71aa1

Browse files
humitosagjohnson
authored andcommitted
GitLab Integration (#3327)
This adds GitLab integration for project import, including remote repositories and webhooks.
1 parent 6a18b75 commit ba71aa1

File tree

26 files changed

+1549
-740
lines changed

26 files changed

+1549
-740
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[flake8]
2-
ignore = E125,D100,D101,D102,D105,D107,D200,D211,P101,FI15,FI16,FI12,FI11,FI17,FI50,FI53,FI54,T000,MQ101
2+
ignore = E125,D100,D101,D102,D103,D105,D106,D107,D200,D202,D211,P101,FI15,FI16,FI12,FI11,FI17,FI50,FI53,FI54,MQ101,T000
33
max-line-length = 80

.pre-commit-config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ repos:
2626
'flake8-string-format',
2727
'flake8-tidy-imports',
2828
'flake8-todo']
29+
exclude: 'test_oauth.py'
2930
- id: trailing-whitespace
3031

3132
- repo: [email protected]:pre-commit/mirrors-yapf.git
@@ -34,6 +35,7 @@ repos:
3435
- id: yapf
3536
exclude: 'migrations|settings|scripts'
3637
additional_dependencies: ['futures']
38+
args: ['--style=.style.yapf', '--parallel']
3739

3840
- repo: [email protected]:FalconSocial/pre-commit-python-sorter.git
3941
sha: b57843b0b874df1d16eb0bef00b868792cb245c2

.style.yapf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ALLOW_MULTILINE_DICTIONARY_KEYS=False
2626
# # <------ this blank line
2727
# def method():
2828
# ...
29-
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=True
29+
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=False
3030

3131
# Insert a blank line before a class-level docstring.
3232
BLANK_LINE_BEFORE_CLASS_DOCSTRING=True

docs/features.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Read the Docs features
33

44
This will serve as a list of all of the features that Read the Docs currently has. Some features are important enough to have their own page in the docs, others will simply be listed here.
55

6-
GitHub and Bitbucket Integration
7-
--------------------------------
6+
GitHub, Bitbucket and GitLab Integration
7+
----------------------------------------
88

99
We now support linking by default in the sidebar. It links to the page on your host, which should help people quickly update typos and send pull requests to contribute to project documentation.
1010

@@ -13,7 +13,7 @@ More information can be found in the :doc:`vcs` page.
1313
Auto-updating
1414
-------------
1515

16-
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.
16+
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.
1717

1818
Internationalization
1919
--------------------
@@ -66,4 +66,3 @@ Alternate Domains
6666
-----------------
6767

6868
We provide support for CNAMEs, subdomains, and a shorturl for your project as well. This is outlined in the :doc:`alternate_domains` section.
69-

docs/getting_started.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,13 @@ Then in your ``conf.py``:
8888
Sign Up and Connect an External Account
8989
---------------------------------------
9090

91-
.. TODO Update this with GitLab support later
92-
93-
If you are going to import a repository from GitHub or Bitbucket, you should
91+
If you are going to import a repository from GitHub, Bitbucket or GitLab, you should
9492
connect your account to your provider first. Connecting your account allows for
9593
easier importing and enables Read the Docs to configure your repository webhooks
9694
automatically.
9795

9896
To connect your account, got to your *Settings* dashboard and select *Connected
99-
Services*. From here, you'll be able to connect to your GitHub or Bitbucket
97+
Services*. From here, you'll be able to connect to your GitHub, Bitbucket or GitLab
10098
account. This process will ask you to authorize a connection to Read the Docs,
10199
that allows us to read information about and clone your repositories.
102100

docs/webhooks.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Webhooks
33

44
The primary method that Read the Docs uses to detect changes to your
55
documentation is through the use of *webhooks*. Webhooks are configured with
6-
your repository provider, such as GitHub or Bitbucket, and with each commit,
6+
your repository provider, such as GitHub, Bitbucket or GitLab, and with each commit,
77
merge, or other change to your repository, Read the Docs is notified. When we
88
receive a webhook notification, we determine if the change is related to an
99
active version for your project, and if it is, a build is triggered for that
@@ -67,7 +67,7 @@ GitLab
6767
* Click **Integrations**
6868
* For **URL**, use the URL of the integration on Read the Docs, found on the
6969
:ref:`integration detail page <integration-detail>` page
70-
* Leave the default **Push events** selected
70+
* Leave the default **Push events** selected and mark **Tag push events** also
7171
* Finish by clicking **Add Webhook**
7272

7373
Using the generic API integration

media/css/core.css

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ p.build-failure { font-size: .8em; color: #dc1020; margin: 0 0 3px; }
479479
p.build-missing { font-size: .8em; color: #9d9a55; margin: 0 0 3px; }
480480

481481
.navigable .profile_image { position:relative; left:-8px; top:-1px; width:184px; overflow:hidden; }
482-
.navigable .profile_image img { border-radius:5px; }
482+
.navigable .profile_image img { border-radius:5px; }
483483

484484
.profile #content { padding-top:8px; }
485485
/* build page */
@@ -551,7 +551,7 @@ p.build-missing { font-size: .8em; color: #9d9a55; margin: 0 0 3px; }
551551
.navigable > ul > li.active:after { content:"•"; position:absolute; right:8px; top:6px; font-size:1.2em; color:#465158; }
552552

553553
.navigable > ul > li > a:hover { background:#E8ECEF; }
554-
.navigable > div { width:600px; float: left; padding-top:4px; }
554+
.navigable > div { width:600px; float: left; padding-top:4px; }
555555

556556
/* autocomplete */
557557

@@ -696,6 +696,12 @@ a.socialaccount-provider.github:before {
696696
content: "\f09b";
697697
}
698698

699+
div.project-import-remote form.import-connect-gitlab button:before,
700+
a.socialaccount-provider.gitlab:before {
701+
font-family: FontAwesome;
702+
content: "\f1d3";
703+
}
704+
699705
div.project-import-remote form.import-connect-bitbucket button:before,
700706
a.socialaccount-provider.bitbucket:before,
701707
a.socialaccount-provider.bitbucket_oauth2:before {
@@ -934,7 +940,7 @@ span.build-state.build-state-failing { color: #a55; }
934940

935941
.edit { cursor: pointer; -webkit-user-select: none; overflow:hidden; position:relative; }
936942
.edit { background:url(../images/edit.png) no-repeat; display:block; width:16px; height:16px; background-size:100% 100%; }
937-
.edit > span {text-indent:-9999em; text-direction:ltr; display:block; }
943+
.edit > span {text-indent:-9999em; text-direction:ltr; display:block; }
938944
body .edit-toggle { display: none; }
939945

940946
.edit-input { display: none; }
@@ -1018,50 +1024,50 @@ select.dropdown { display: none; }
10181024
}
10191025

10201026
/* CHART LISTS */
1021-
.chartlist {
1022-
float: left;
1023-
border-top: 1px solid #EEE;
1027+
.chartlist {
1028+
float: left;
1029+
border-top: 1px solid #EEE;
10241030
width: 15em;
10251031
}
1026-
.chartlist li {
1032+
.chartlist li {
10271033
position: relative;
1028-
display: block;
1029-
border-bottom: 1px solid #EEE;
1034+
display: block;
1035+
border-bottom: 1px solid #EEE;
10301036
_zoom: 1;
10311037
}
1032-
.chartlist li a {
1033-
display: block;
1038+
.chartlist li a {
1039+
display: block;
10341040
padding: 0.4em 4.5em 0.4em 0.5em;
1035-
position: relative;
1036-
z-index: 2;
1041+
position: relative;
1042+
z-index: 2;
10371043
}
1038-
.chartlist .count {
1039-
display: block;
1040-
position: absolute;
1041-
top: 0;
1042-
right: 0;
1043-
margin: 0 0.3em;
1044-
text-align: right;
1045-
color: #999;
1046-
font-weight: bold;
1047-
font-size: 0.875em;
1048-
line-height: 2em;
1049-
z-index: 5;
1044+
.chartlist .count {
1045+
display: block;
1046+
position: absolute;
1047+
top: 0;
1048+
right: 0;
1049+
margin: 0 0.3em;
1050+
text-align: right;
1051+
color: #999;
1052+
font-weight: bold;
1053+
font-size: 0.875em;
1054+
line-height: 2em;
1055+
z-index: 5;
10501056
}
1051-
.chartlist .index {
1052-
display: block;
1053-
position: absolute;
1054-
top: 0;
1055-
left: 0;
1056-
height: 100%;
1057-
background: #B8E4F5;
1058-
text-indent: -9999px;
1059-
overflow: hidden;
1057+
.chartlist .index {
1058+
display: block;
1059+
position: absolute;
1060+
top: 0;
1061+
left: 0;
1062+
height: 100%;
1063+
background: #B8E4F5;
1064+
text-indent: -9999px;
1065+
overflow: hidden;
10601066
line-height: 2em;
1061-
z-index: 1;
1067+
z-index: 1;
10621068
}
1063-
.chartlist li:hover {
1064-
background: #EFEFEF;
1069+
.chartlist li:hover {
1070+
background: #EFEFEF;
10651071
}
10661072

10671073

0 commit comments

Comments
 (0)