Commit Graph

7713 Commits (c27686e1f8c89f2c5a493ee328e904930095e8bc)

Author SHA1 Message Date
Eric Holscher c27686e1f8 Support backwards compat 2017-12-05 11:25:15 -08:00
Eric Holscher 8d1a58db3b Clean up setting names 2017-12-05 11:22:25 -08:00
Eric Holscher eb7c4b2e65 A bit more clenaup 2017-12-05 09:34:21 -08:00
Eric Holscher a705f9d130 Address review feedback and remove most of my deleted code :) 2017-12-05 09:27:49 -08:00
Eric Holscher aa15e78321 Bump build dep for tests 2017-11-30 14:34:26 -08:00
Eric Holscher 961c18e7b6 Fix tests 2017-11-30 13:10:32 -08:00
Eric Holscher 442c68a398 Add docker image from the YAML config integration 2017-11-30 12:54:17 -08:00
Eric Holscher 0d9c3fefb1
Merge pull request #3336 from rtfd/use-active-for-stable
Change stable version switching to respect `active`
2017-11-30 08:20:05 -08:00
Eric Holscher 01abd43764 Fix test 2017-11-30 08:10:59 -08:00
Eric Holscher f4e6ffdf66 Change stable version switching to respect `active`
This previously used the `machine` tag that was turned off when a user de-activated the version,
but never turned back on when they re-activated it.

This changes to just use the `active` flag on the Version,
so we will update the stable version if the existing one is `active`,
and not if it isn't,
which makes _way_ more sense.
2017-11-30 07:49:11 -08:00
Eric Holscher 73b693ce4d
Merge pull request #3331 from rtfd/humitos/versions/tags-over-branches
Take preferece of tags over branches when selecting the stable version
2017-11-29 14:06:26 -08:00
Manuel Kaufmann 20ce7aa5c5 More styling 2017-11-29 16:38:40 -05:00
Manuel Kaufmann bcfbca8829 'most up to date version' note prefers tags
Now, this logic is like this:

- if the project has any Version that is a TAG, the highest version
  will only be a TAG also (BRANCH are not considered)
- if the project doesn't have any TAG the highest version will be a
  BRANCH (or UNKNOWN in the worst case)
2017-11-29 16:35:13 -05:00
Manuel Kaufmann 1b38e92ae7 Do not split before first argument (#3333)
Keep this format:

```
def run(arg, arg, arg, arg,
        arg, arg, arg):
    pass
```
2017-11-29 13:06:13 -07:00
Manuel Kaufmann 1d76453f3a Test for tags over branches versions 2017-11-29 12:34:01 -05:00
Manuel Kaufmann 073b0c07f0 Do not update version type when sync versions
This allows us to have the same `verbose_name` for different type of
versions (for example, '2.0' could both a tag and a branch). If this
happen, we want to keep them both.

In the UI, it will say just `"2.0"` for the branch and
`"2.0 (c0d25453)"` for the tag. This could be improved later if
necessary.
2017-11-29 12:33:21 -05:00
Eric Holscher 61dc4b5389
Update readme.rst 2017-11-29 07:45:44 -08:00
Manuel Kaufmann fd0b406217 Take preference of tags over branches to get stable version 2017-11-29 10:33:16 -05:00
Manuel Kaufmann 682a7fa708 Add pdbpp for local debugging 2017-11-29 10:30:18 -05:00
Manuel Kaufmann f9c567e9c8 Style rules applied to test_sync_versions 2017-11-29 10:29:28 -05:00
Manuel Kaufmann 5adbdd1fae Improve docstrings and style 2017-11-28 19:45:18 -05:00
Manuel Kaufmann 4a14c56470 Fix isort settings 2017-11-28 19:42:54 -05:00
Manuel Kaufmann cd9802ef2a Update CI requeriments (#3330) 2017-11-28 11:46:58 -07:00
Manuel Kaufmann 9920ba7f21 Allow BUILD_IMAGES to be updated from a setting (#3306)
* Allow BUILD_IMAGES to be updated from a setting

Fixes #3524

* Styles

* Style updates

Config changes:

 - ignore D107 (__init__ method must have a docstring) in flake8
 - readthedocs and readthedocsinc are marked as FIRSTPARTY in isort
 - readthedocs_build is marked as THIRDPARTY

* Rename setting to DOCKER_BUILD_IMAGES
2017-11-27 17:25:01 -07:00
Manuel Kaufmann 90ac70d56e Show the proper version in the project dashboard (#3307)
The bug was introduced at

https://github.com/rtfd/readthedocs.org/pull/2944/files#diff-9a10ae0511ab8eb72096c4a0510a364eL38

Since the {% blocktrans %} was removed, the `slug` name was
undefined. Besides, there is no need to translate the slug, so the
first one was also removed
2017-11-27 10:49:50 -07:00
Eric Holscher dbf6898962
Merge pull request #3256 from rtfd/ads-served-ethically
Add small “ads by” copy to our ads
2017-11-27 09:19:47 -08:00
Eric Holscher 75ba66a68d Review feedback 2017-11-27 08:51:00 -08:00
Manuel Kaufmann ebf9a40c5b Do not show Build button when user is not project admin (#3309)
* Do not show Build button when user is not project admin

Closes #3303

* Add test to check for Build section

* Fix old test to make sure a public branch is listed
2017-11-27 09:50:27 -07:00
Manuel Kaufmann 08a43490a3 Use `id` attribute instead of `pk` for build (#3325)
`pk` exists only for Builds that are retrieved from the database, but
when it's retrieved using the API, the `id` must be used.

Using the `id` is compatible with both instances.

Related to #2963
2017-11-27 09:47:36 -07:00
Manuel Kaufmann 10b319183e Minor improves to `import_project_from_live` management command (#3301)
* record the build
* exclude attributes from API response
* call UpdateDocsTask with `build_id` to avoid failing
2017-11-27 09:42:26 -07:00
Manuel Kaufmann d18ddc9bb5 Config files for auto linting (#3264)
* Config files for auto linting

autoflake, autopep8, docformatter, isort, yapf

* readthedocs.projects.views.base with auto styling applied

* readthedocs.core.models auto styling applied

* readthedocs.builds.urls with auto styling applied

* Do not make multi line summaries

* Improve isort settings

* Use 80 columns as maximum

* pre-commit config file

Use the `pre-commit` tool to run some linting commands before each
commit:

    http://pre-commit.com/

* Update yapf config file to 0.20.0

* Add i18n functions to yapf config

* Remove django as a special section for isort

* Rename config to be automatically discovered

* Add annoying as a third party lib for isort

* Use the new config for all the files modified as a test

I had to add a couple of "trailing commas" to keep the format as we want

* Install additional dependencies for each of the hooks

Remove the auto-lint.txt requirements file since it's not needed anymore

* Use default config name for autopep8

* Include autoflake as pre-commit hook

* Exclude D105 from flake8

D105: Missing docstring in magic method

* Minor fixes from flake8

* autoflake with --in-place

* Arguments for docformatter

* Autofix D203 with yapf

D203 / 1 blank line required before class docstring

* Ignore local_settings.py on prospector
2017-11-27 09:42:09 -07:00
Aaron Carlisle c0de92d173 Upgrade RTD Theme to 0.2.5b1 (#3313)
* Upgrade RTD Theme to 0.2.5b1

* Update dev RTD Theme version to 0.2.5b1
2017-11-27 09:38:32 -07:00
Anthony Johnson f93e509f1a
Fix shitpost 2017-11-23 12:47:45 -07:00
Anthony Johnson 4d71276bb4
Fix copypasta issue with supervisord config 2017-11-23 12:45:50 -07:00
Manuel Kaufmann fef1abfad3 Update Build state at the end of UpdateDocsTask.run (#3293)
* Update Build state at the end of UpdateDocsTask.run

Use the `update_build` method that handles most of the cases but fill
the `failure` with a unhandled exception in case it was risen.

* Fix lint style

* Fix attribute name

* Return the object we already have in memory instead of doing API call

* Use a str variable
2017-11-23 12:41:28 -07:00
Manuel Kaufmann 86f705fe6a Add GLOBAL_PIP_CACHE setting (#3299)
Avoid downloading over and over again the pip packages when you are
developing over a slow internet connection.
2017-11-22 17:11:13 -07:00
Manuel Kaufmann 8de1770dad Remove invalid attribute `exception` (#3298)
* Remove invalid attribute `exception`

https://docs.djangoproject.com/en/1.9/ref/views/#django.views.defaults.server_error

This bug was introduced at 5e0f4c0d07 (diff-f37089595920e35da08a9395c370515eR107)

* Remove linting comments
2017-11-22 14:00:13 -07:00
Eric Holscher a7f54257c1 Merge remote-tracking branch 'origin/master' into ads-served-ethically 2017-11-21 20:22:13 -08:00
Eric Holscher e90d63c1e7 Merge remote-tracking branch 'origin/master' into ads-served-ethically 2017-11-21 20:18:15 -08:00
Manuel Kaufmann 3e1651e9ee Update build from database at __exit__ (#3292)
* Update build from database at __exit__

When an exception happens and it's handled by __exit__ our Build in
the database is not updated and it stay in 'Installing' forever. So,
when something bad happens we force a call to `update_build` with the
FINISHED state

Attempt to fix #3285

* `update_build` when FINISHED in the right place
2017-11-21 17:06:20 -07:00
Manuel Kaufmann d6eac0e480 Extra way to check OOM of a command ran inside Docker (#3294)
* Extra way to check OOM of a command ran inside Docker

Easy way to reproduce this error:

1. Import a project that compiles lxml (Read the Docs, for example)
2. The `pip` command will be killed and Docker won't return a specific
status code, it will just return 1
3. In these cases, the `Killed` word will probably appear in the last
15 lines

* Check status code and 'Killed' word
2017-11-21 17:01:48 -07:00
Anthony 2e39d5f21a
Add supervisord contrib example (#3262)
* Add supervisord contrib example

Useful for running a development instance really quickly.

Doesn't yet support:

* ipdb/pdb, but still supports rdb
* color log output

* Revert to celery concurrency

* Updates
2017-11-21 15:21:40 -07:00
David Fischer 02cc08f245 Allow promos to be placed in the docs footer (#3267)
- this is in addition to the normal left navigation
- works on the RTD and Alabaster themes
2017-11-20 10:16:40 -07:00
Manuel Kaufmann e737d78abd Do not convert to bytes the `refresh_token` (#3273)
* Do not convert to bytes the `refresh_token`

When the body is encoded, a mix of bytes and unicode happens and it
fails at this line

c472e6bf04/requests_oauthlib/oauth2_session.py (L285)

(Pdb) body
u'grant_type=refresh_token&allow_redirects=True&refresh_token=b%27z9BSRKqf2QD4pcDhqj%27&client_id=CLIENT_ID&client_secret=CLIENT_SECRET'

(note those weird `%27` in the string)

* Handle OAuth specific exception properly at `paginate`

* Do not convert the `acess_token` to bytes

* Fix lint :(

* Refactor `paginate` to handle exception in Bitbucket and Github

`paginate` method is shared between both services and each service
implement `get_next_url_to_paginate` and `get_paginated_results`.

* Names and attributes fixes
2017-11-20 10:00:53 -07:00
Eric Holscher d52c693edc Fix lint 2017-11-17 16:20:35 -08:00
Eric Holscher b0dd320efd No period 2017-11-17 15:14:17 -08:00
Eric Holscher ea820f2312 Clean up landing page a bit 2017-11-17 15:11:47 -08:00
Anthony Johnson 5a4fbc93d5
Update team page 2017-11-15 19:39:42 -07:00
Eric Holscher 6038d84d8d Upgrade build dependency (#3274) 2017-11-15 19:31:51 -07:00
Eric Holscher 7cbda6a9b3
Merge pull request #3271 from rtfd/more-fix-logging
More fixes for logging -> Sentry
2017-11-15 14:23:38 -08:00