Skip to content

Commit 216efa2

Browse files
committed
Merge tag '7.6.1' into rel
2 parents cb45bf6 + b9c9ed7 commit 216efa2

File tree

9 files changed

+74
-90
lines changed

9 files changed

+74
-90
lines changed

CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
Version 7.6.1
2+
-------------
3+
4+
:Date: April 19, 2022
5+
6+
* `@humitos <https://github.com/humitos>`__: Logging: reduce verbosity (`#9107 <https://github.com/readthedocs/readthedocs.org/pull/9107>`__)
7+
* `@stsewd <https://github.com/stsewd>`__: Analytics: Don't use full_path in get_or_create (`#9099 <https://github.com/readthedocs/readthedocs.org/pull/9099>`__)
8+
* `@humitos <https://github.com/humitos>`__: Build: do not upload `build.tool` to production S3 (`#9098 <https://github.com/readthedocs/readthedocs.org/pull/9098>`__)
9+
* `@ericholscher <https://github.com/ericholscher>`__: Cleanup Redirects docs (`#9095 <https://github.com/readthedocs/readthedocs.org/pull/9095>`__)
10+
111
Version 7.6.0
212
-------------
313

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767

6868
master_doc = "index"
6969
copyright = "2010, Read the Docs, Inc & contributors"
70-
version = "7.6.0"
70+
version = "7.6.1"
7171
release = version
7272
exclude_patterns = ["_build"]
7373
default_role = "obj"

docs/user/user-defined-redirects.rst

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
User-defined Redirects
22
======================
33

4-
You can set up redirects for a project in your project dashboard's Redirects page.
4+
You can set up redirects for a project in your project dashboard's :guilabel:`Redirects` page.
55

66
Quick Summary
77
-------------
@@ -16,14 +16,21 @@ Quick Summary
1616

1717
Your redirects will be effective immediately.
1818

19-
.. note::
19+
Limitations
20+
~~~~~~~~~~~
21+
22+
Redirects are only implemented in case of a *404 File Not Found* error.
23+
If you need to redirect a large number of files that still exist,
24+
please reach out to :doc:`/support`.
2025

21-
For the time being, redirects are only implemented in case of a
22-
*404 File Not Found* error.
26+
Page & Exact Redirects can redirect to URLs outside Read the Docs.
27+
Define the `To URL` as the absolute URL you want to redirect to.
2328

2429
Redirect Types
2530
--------------
2631

32+
We offer a few different type of redirects based on what you want to do.
33+
2734
Prefix Redirects
2835
~~~~~~~~~~~~~~~~
2936

@@ -50,12 +57,10 @@ Your users query would now redirect in the following manner::
5057

5158
Where ``en`` and ``latest`` are the default language and version values for your project.
5259

53-
5460
.. note::
5561

56-
In other words, a *Prefix Redirect* removes a prefix from the original URL.
57-
This prefix is removed from the rest of the URL's ``path`` after ``/$lang/$version``.
58-
For example, if the URL is ``/es/1.0/guides/tutorial/install.html`` the "From URL's prefix" will be removed from ``/guides/tutorial/install.html`` part.
62+
If you were hosting your docs without a prefix, you can create a ``/`` Prefix Redirect,
63+
which will prepend ``/$lang/$version/`` to all incoming URLs.
5964

6065

6166
Page Redirects
@@ -73,23 +78,18 @@ You would set the following configuration::
7378
From URL: /example.html
7479
To URL: /examples/intro.html
7580

76-
Note that the ``/`` at the start doesn't count the ``/$lang/$version`` prefix (e.g.
77-
``/en/latest``), but just the user-controlled section of the URL.
81+
**Page Redirects apply to all versions of you documentation.**
82+
Because of this,
83+
the ``/`` at the start of the ``From URL`` doesn't include the ``/$lang/$version`` prefix (e.g.
84+
``/en/latest``), but just the version-specific part of the URL.
7885
If you want to set directs only for some languages or some versions, you should use
7986
:ref:`user-defined-redirects:exact redirects` with the fully-specified path.
8087

81-
.. tip::
82-
83-
*Page Redirects* can redirect URLs **outside** Read the Docs platform
84-
just by defining the "To URL" as the absolute URL you want to redirect to.
85-
86-
8788
Exact Redirects
8889
~~~~~~~~~~~~~~~
8990

90-
If you're redirecting from an old host AND you aren't maintaining old paths for your
91-
documents, a Prefix Redirect won't suffice and you'll need to create *Exact Redirects*
92-
to redirect from a specific URL, to a specific page.
91+
*Exact Redirects* are for redirecting a single URL,
92+
and take into account the full URL (including language & version).
9393

9494
Say you're moving ``docs.example.com`` to Read the Docs and want to redirect traffic
9595
from an old page at ``https://docs.example.com/dev/install.html`` to a new URL
@@ -128,11 +128,6 @@ Similarly, if you maintain several branches of your documentation (e.g. ``3.0``
128128
``latest``) and decide to move pages in ``latest`` but not the older branches, you can use
129129
*Exact Redirects* to do so.
130130

131-
.. tip::
132-
133-
*Exact Redirects* can redirect URLs **outside** Read the Docs platform
134-
just by defining the "To URL" as the absolute URL you want to redirect to.
135-
136131

137132
Sphinx Redirects
138133
~~~~~~~~~~~~~~~~

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "readthedocs",
3-
"version": "7.6.0",
3+
"version": "7.6.1",
44
"description": "Read the Docs build dependencies",
55
"author": "Read the Docs, Inc <[email protected]>",
66
"scripts": {

readthedocs/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Read the Docs."""
22

33

4-
__version__ = "7.6.0"
4+
__version__ = "7.6.1"

readthedocs/doc_builder/environments.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,10 @@ def __exit__(self, exc_type, exc_value, tb):
646646
container_id=self.container_id,
647647
)
648648
except DockerAPIError:
649-
log.exception(
649+
# Logging this as warning because it usually happens due memory
650+
# limit or build timeout. In those cases, the container is not
651+
# running and can't be killed
652+
log.warning(
650653
'Unable to kill container.',
651654
container_id=self.container_id,
652655
)

readthedocs/projects/tasks/builds.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,6 @@ def on_failure(self, exc, task_id, args, kwargs, einfo):
136136
if isinstance(exc, RepositoryError):
137137
log.warning(
138138
'There was an error with the repository.',
139-
exc_info=True,
140139
)
141140
elif isinstance(exc, SyncRepositoryLocked):
142141
log.warning(

scripts/compile_version_upload_s3.sh

Lines changed: 37 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -23,52 +23,16 @@
2323
# PRODUCTION ENVIRONMENT
2424
#
2525
# To create a pre-compiled cached version and make it available on production,
26-
# **the script must be ran from a builder (build-default or build-large)** and
27-
# it's required to set several environment variables for an IAM user with
28-
# permissions on ``readthedocs(inc)-build-tools-prod`` S3's bucket. Also, note
29-
# that in production we need to install `aws` Python package to run the script.
30-
# We can do this in a different virtualenv to avoid collision with the builder's
31-
# code.
32-
#
33-
# The whole process would be something like:
34-
#
35-
# ssh util01
36-
# ssh `scaling status -s build-default -q | head -n 1`
37-
#
38-
# sudo su - docs
39-
# TOOL=python
40-
# VERSION=3.10.0
41-
#
42-
# cd /home/docs/checkouts/readthedocs.org/scripts
43-
# virtualenv venv
44-
# source venv/bin/activate
45-
# pip install awscli==1.20.34
46-
#
47-
# export AWS_REGION=...
48-
# export AWS_ACCESS_KEY_ID=...
49-
# export AWS_SECRET_ACCESS_KEY=...
50-
# export AWS_BUILD_TOOLS_BUCKET=readthedocs(inc)-build-tools-prod
51-
#
52-
# ./compile_version_upload.sh $TOOL $VERSION
53-
#
54-
#
55-
# ONE-LINE COMMAND FROM UTIL01 PRODUCTION
56-
#
57-
# TOOL=python
58-
# VERSION=3.10.0
59-
# AWS_BUILD_TOOLS_BUCKET=readthedocs(inc)-build-tools-prod
60-
#
61-
# ssh `scaling status -s build-default -q | head -n 1` \
62-
# "cd /home/docs && \
63-
# sudo -u docs virtualenv --python python3 /home/docs/buildtools && \
64-
# sudo -u docs /home/docs/buildtools/bin/pip install awscli==1.20.34 && \
65-
# sudo -u docs env AWS_REGION=$AWS_REGION \
66-
# AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
67-
# AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
68-
# AWS_BUILD_TOOLS_BUCKET=$AWS_BUILD_TOOLS_BUCKET \
69-
# PATH=/home/docs/buildtools/bin:${PATH} \
70-
# /home/docs/checkouts/readthedocs.org/scripts/compile_version_upload_s3.sh $TOOL $VERSION"
26+
# we use a CircleCI job
27+
# (https://github.com/readthedocs/readthedocs-docker-images/blob/main/.circleci/config.yml)
28+
# It requires to set several environment variables for an IAM user with
29+
# permissions on ``readthedocs(inc)-build-tools-prod`` S3's bucket. These
30+
# variables are defined via the CircleCI UI under the `readthedocs-docker-image`
31+
# project.
7132
#
33+
# Note that if for some reason, you need to run this command *outside CircleCI*
34+
# you can find more information in this comment:
35+
# https://github.com/readthedocs/readthedocs-ops/issues/1155#issuecomment-1082615972
7236
#
7337
# USAGE
7438
#
@@ -90,6 +54,7 @@ set -x # Echo commands
9054
# Define variables
9155
SLEEP=350 # Container timeout
9256
OS="${OS:-ubuntu-22.04}" # Docker image name
57+
9358
TOOL=$1
9459
VERSION=$2
9560

@@ -103,7 +68,16 @@ echo "Running all the commands in Docker container: $CONTAINER_ID"
10368
# Install the tool version requested
10469
if [[ $TOOL == "python" ]]
10570
then
106-
docker exec --env PYTHON_CONFIGURE_OPTS="--enable-shared" $CONTAINER_ID asdf install $TOOL $VERSION
71+
if [[ $VERSION == "3.6.15" ]]
72+
then
73+
# Special command for Python 3.6.15
74+
# See https://github.com/pyenv/pyenv/issues/1889#issuecomment-833587851
75+
docker exec --user root $CONTAINER_ID apt-get update
76+
docker exec --user root $CONTAINER_ID apt-get install --yes clang
77+
docker exec --env PYTHON_CONFIGURE_OPTS="--enable-shared" --env CC=clang $CONTAINER_ID asdf install $TOOL $VERSION
78+
else
79+
docker exec --env PYTHON_CONFIGURE_OPTS="--enable-shared" $CONTAINER_ID asdf install $TOOL $VERSION
80+
fi
10781
else
10882
docker exec $CONTAINER_ID asdf install $TOOL $VERSION
10983
fi
@@ -113,6 +87,10 @@ docker exec $CONTAINER_ID asdf global $TOOL $VERSION
11387
docker exec $CONTAINER_ID asdf reshim $TOOL
11488

11589
# Install dependencies for this version
90+
#
91+
# TODO: pin all transitive dependencies with pip-tools or similar. We can find
92+
# the current versions by running `pip freeze` in production and stick with them
93+
# for now to avoid changing versions.
11694
if [[ $TOOL == "python" ]] && [[ ! $VERSION =~ (^miniconda.*|^mambaforge.*) ]]
11795
then
11896
RTD_PIP_VERSION=21.2.4
@@ -138,22 +116,21 @@ docker cp $CONTAINER_ID:/home/docs/$OS-$TOOL-$VERSION.tar.gz .
138116
# Kill the container
139117
docker container kill $CONTAINER_ID
140118

141-
# Upload the .tar.gz to S3
142-
AWS_ENDPOINT_URL="${AWS_ENDPOINT_URL:-http://localhost:9000}"
143-
AWS_BUILD_TOOLS_BUCKET="${AWS_BUILD_TOOLS_BUCKET:-build-tools}"
144-
AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-admin}"
145-
AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY:-password}"
146-
147-
if [[ -z $AWS_REGION ]]
119+
if [[ -z $CIRCLECI ]]
148120
then
149-
# Development environment
121+
# Upload the .tar.gz to S3 development environment
150122
echo "Uploading to dev environment"
123+
124+
AWS_ENDPOINT_URL="${AWS_ENDPOINT_URL:-http://localhost:9000}"
125+
AWS_BUILD_TOOLS_BUCKET="${AWS_BUILD_TOOLS_BUCKET:-build-tools}"
126+
AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID:-admin}"
127+
AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY:-password}"
128+
151129
aws --endpoint-url $AWS_ENDPOINT_URL s3 cp $OS-$TOOL-$VERSION.tar.gz s3://$AWS_BUILD_TOOLS_BUCKET
130+
131+
# Delete the .tar.gz file from the host
132+
rm $OS-$TOOL-$VERSION.tar.gz
152133
else
153-
# Production environment does not requires `--endpoint-url`
154-
echo "Uploading to prod environment"
155-
aws s3 cp $OS-$TOOL-$VERSION.tar.gz s3://$AWS_BUILD_TOOLS_BUCKET
134+
echo "Skip uploading .tar.gz file because it's being run from inside CircleCI."
135+
echo "It should be uploaded by orbs/aws automatically."
156136
fi
157-
158-
# Delete the .tar.gz file from the host
159-
rm $OS-$TOOL-$VERSION.tar.gz

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ github_owner = readthedocs
2929
github_repo = readthedocs.org
3030

3131
[bumpver]
32-
current_version = "7.6.0"
32+
current_version = "7.6.1"
3333
version_pattern = "MAJOR.MINOR.PATCH[TAGNUM]"
3434
commit_message = "Bump version {old_version} -> {new_version}"
3535
commit = False

0 commit comments

Comments
 (0)