Skip to content

Commit

Permalink
GitLab Integration (#3327)
Browse files Browse the repository at this point in the history
This adds GitLab integration for project import, including remote repositories and webhooks.
  • Loading branch information
humitos authored and agjohnson committed Dec 7, 2017
1 parent 6a18b75 commit ba71aa1
Show file tree
Hide file tree
Showing 26 changed files with 1,549 additions and 740 deletions.
2 changes: 1 addition & 1 deletion .flake8
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,T000,MQ101
ignore = E125,D100,D101,D102,D103,D105,D106,D107,D200,D202,D211,P101,FI15,FI16,FI12,FI11,FI17,FI50,FI53,FI54,MQ101,T000
max-line-length = 80
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .style.yapf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ALLOW_MULTILINE_DICTIONARY_KEYS=False
# # <------ this blank line
# def method():
# ...
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=True
BLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF=False

# Insert a blank line before a class-level docstring.
BLANK_LINE_BEFORE_CLASS_DOCSTRING=True
Expand Down
7 changes: 3 additions & 4 deletions docs/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Read the Docs features

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.

GitHub and Bitbucket Integration
--------------------------------
GitHub, Bitbucket and GitLab Integration
----------------------------------------

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.

Expand All @@ -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.

Internationalization
--------------------
Expand Down Expand Up @@ -66,4 +66,3 @@ Alternate Domains
-----------------

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

6 changes: 2 additions & 4 deletions docs/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,13 @@ Then in your ``conf.py``:
Sign Up and Connect an External Account
---------------------------------------

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

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

Expand Down
4 changes: 2 additions & 2 deletions docs/webhooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Webhooks

The primary method that Read the Docs uses to detect changes to your
documentation is through the use of *webhooks*. Webhooks are configured with
your repository provider, such as GitHub or Bitbucket, and with each commit,
your repository provider, such as GitHub, Bitbucket or GitLab, and with each commit,
merge, or other change to your repository, Read the Docs is notified. When we
receive a webhook notification, we determine if the change is related to an
active version for your project, and if it is, a build is triggered for that
Expand Down Expand Up @@ -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
* Finish by clicking **Add Webhook**

Using the generic API integration
Expand Down
80 changes: 43 additions & 37 deletions media/css/core.css
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ p.build-failure { font-size: .8em; color: #dc1020; margin: 0 0 3px; }
p.build-missing { font-size: .8em; color: #9d9a55; margin: 0 0 3px; }

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

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

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

/* autocomplete */

Expand Down Expand Up @@ -696,6 +696,12 @@ a.socialaccount-provider.github:before {
content: "\f09b";
}

div.project-import-remote form.import-connect-gitlab button:before,
a.socialaccount-provider.gitlab:before {
font-family: FontAwesome;
content: "\f1d3";
}

div.project-import-remote form.import-connect-bitbucket button:before,
a.socialaccount-provider.bitbucket:before,
a.socialaccount-provider.bitbucket_oauth2:before {
Expand Down Expand Up @@ -934,7 +940,7 @@ span.build-state.build-state-failing { color: #a55; }

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

.edit-input { display: none; }
Expand Down Expand Up @@ -1018,50 +1024,50 @@ select.dropdown { display: none; }
}

/* CHART LISTS */
.chartlist {
float: left;
border-top: 1px solid #EEE;
.chartlist {
float: left;
border-top: 1px solid #EEE;
width: 15em;
}
.chartlist li {
.chartlist li {
position: relative;
display: block;
border-bottom: 1px solid #EEE;
display: block;
border-bottom: 1px solid #EEE;
_zoom: 1;
}
.chartlist li a {
display: block;
.chartlist li a {
display: block;
padding: 0.4em 4.5em 0.4em 0.5em;
position: relative;
z-index: 2;
position: relative;
z-index: 2;
}
.chartlist .count {
display: block;
position: absolute;
top: 0;
right: 0;
margin: 0 0.3em;
text-align: right;
color: #999;
font-weight: bold;
font-size: 0.875em;
line-height: 2em;
z-index: 5;
.chartlist .count {
display: block;
position: absolute;
top: 0;
right: 0;
margin: 0 0.3em;
text-align: right;
color: #999;
font-weight: bold;
font-size: 0.875em;
line-height: 2em;
z-index: 5;
}
.chartlist .index {
display: block;
position: absolute;
top: 0;
left: 0;
height: 100%;
background: #B8E4F5;
text-indent: -9999px;
overflow: hidden;
.chartlist .index {
display: block;
position: absolute;
top: 0;
left: 0;
height: 100%;
background: #B8E4F5;
text-indent: -9999px;
overflow: hidden;
line-height: 2em;
z-index: 1;
z-index: 1;
}
.chartlist li:hover {
background: #EFEFEF;
.chartlist li:hover {
background: #EFEFEF;
}


Expand Down
Loading

0 comments on commit ba71aa1

Please sign in to comment.