Skip to content
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

Config file: add support for latest aliases #11081

Merged
merged 7 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions docs/user/config-file/v2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,18 @@ Image names refer to the operating system Read the Docs uses to build them.
Arbitrary Docker images are not supported.

:Type: ``string``
:Options: ``ubuntu-20.04``, ``ubuntu-22.04``
:Options: ``ubuntu-20.04``, ``ubuntu-22.04``, ``ubuntu-latest-lts``
stsewd marked this conversation as resolved.
Show resolved Hide resolved
:Required: ``true``

.. note::

The ``ubuntu-latest-lts`` option refers to the latest LTS version of Ubuntu available on Read the Docs,
not the latest LTS version available.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sentence is confusing. In particular the final part saying "not the latest LTS version available"

Suggested change
The ``ubuntu-latest-lts`` option refers to the latest LTS version of Ubuntu available on Read the Docs,
not the latest LTS version available.
The ``ubuntu-lts-latest`` option refers to the latest Ubuntu LTS version available on Read the Docs,
which may not match with the latest Ubuntu LTS officially released.


.. warning::

Using ``ubuntu-latest-lts`` may break your builds unexpectedly if your project isn't compatible with the latest version when it's updated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Using ``ubuntu-latest-lts`` may break your builds unexpectedly if your project isn't compatible with the latest version when it's updated.
Using ``ubuntu-lts-latest`` may break your builds unexpectedly if your project isn't compatible with the newest Ubuntu LTS version released when Read the Docs upgrades to it.


build.tools
```````````

Expand All @@ -286,6 +295,15 @@ Version specifiers for each tool. It must contain at least one tool.
:Options: ``python``, ``nodejs``, ``rust``, ``golang``
:Required: ``true``

.. note::

Each tool has a ``latest`` option available, which refers to the latest version available on Read the Docs,
not the latest version available. Versions are updated at least once every six months.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Each tool has a ``latest`` option available, which refers to the latest version available on Read the Docs,
not the latest version available. Versions are updated at least once every six months.
Each tool has a ``latest`` option available, which refers to the latest version available on Read the Docs,
which may not match with the latest version officially released by the tool.
`latest` versions are updated every 6 months to point to the latest version officially released.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept the at least once part


.. warning::

Using ``latest`` may break your builds unexpectedly if your project isn't compatible with the latest version of the tool when it's updated.
stsewd marked this conversation as resolved.
Show resolved Hide resolved

build.tools.python
``````````````````

Expand All @@ -301,17 +319,20 @@ You can use several interpreters and versions, from CPython, Miniconda, and Mamb
:Type: ``string``
:Options:
- ``2.7``
- ``3`` (last stable CPython version)
- ``3`` (alias for the latest 3.x version available on Read the Docs)
- ``3.6``
- ``3.7``
- ``3.8``
- ``3.9``
- ``3.10``
- ``3.11``
- ``3.12``
- ``latest`` (alias for the latest version available on Read the Docs)
- ``miniconda3-4.7``
- ``miniconda-latest`` (alias for the latest version available on Read the Docs)
- ``mambaforge-4.10``
- ``mambaforge-22.9``
- ``mambaforge-latest`` (alias for the latest version available on Read the Docs)

build.tools.nodejs
``````````````````
Expand All @@ -325,6 +346,7 @@ Node.js version to use.
- ``18``
- ``19``
- ``20``
- ``latest`` (alias for the latest version available on Read the Docs)

build.tools.rust
````````````````
Expand All @@ -337,6 +359,8 @@ Rust version to use.
- ``1.61``
- ``1.64``
- ``1.70``
- ``1.75``
- ``latest`` (alias for the latest version available on Read the Docs)

build.tools.golang
``````````````````
Expand All @@ -349,6 +373,8 @@ Go version to use.
- ``1.18``
- ``1.19``
- ``1.20``
- ``1.21``
- ``latest`` (alias for the latest version available on Read the Docs)

build.apt_packages
``````````````````
Expand Down
33 changes: 21 additions & 12 deletions readthedocs/builds/constants_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@

DOCKER_DEFAULT_IMAGE = "readthedocs/build"

# Adding a new tool/version to this setting requires:
# When adding a new tool/version to this setting, you should:
#
# - a mapping between the expected version in the config file, to the full
# version installed via asdf (found via ``asdf list all <tool>``)
#
# - running the script ``./scripts/compile_version_upload.sh`` in
# development and production environments to compile and cache the new
# tool/version
#
# Note that when updating this options, you should also update the file:
# readthedocs/rtd_tests/fixtures/spec/v2/schema.json
# - Add a mapping between the expected version in the config file, to the full
# version installed via asdf (found via ``asdf list all <tool>``).
# - Run the script ``./scripts/compile_version_upload.sh`` in
# development and production environments to compile and cache the new
# tool/version.
stsewd marked this conversation as resolved.
Show resolved Hide resolved
# - Update the latest aliases for OS and tools (below this setting).
stsewd marked this conversation as resolved.
Show resolved Hide resolved
# - Update readthedocs/rtd_tests/fixtures/spec/v2/schema.json.
# - Update the documentation in ``docs/user/config-file/v2.rst``.
RTD_DOCKER_BUILD_SETTINGS = {
# Mapping of build.os options to docker image.
"os": {
Expand All @@ -37,8 +36,6 @@
"3.10": "3.10.13",
"3.11": "3.11.6",
"3.12": "3.12.0",
# Always point to the latest stable release.
"3": "3.12.0",
"miniconda3-4.7": "miniconda3-4.7.12",
"mambaforge-4.10": "mambaforge-4.10.3-10",
"mambaforge-22.9": "mambaforge-22.9.0-3",
Expand Down Expand Up @@ -66,3 +63,15 @@
},
},
}

# Set latest aliases for OS and tools.
_OS = RTD_DOCKER_BUILD_SETTINGS["os"]
_TOOLS = RTD_DOCKER_BUILD_SETTINGS["tools"]
_OS["ubuntu-latest-lts"] = _OS["ubuntu-22.04"]
_TOOLS["python"]["3"] = _TOOLS["python"]["3.12"]
_TOOLS["python"]["latest"] = _TOOLS["python"]["3"]
_TOOLS["python"]["miniconda-latest"] = _TOOLS["python"]["miniconda3-4.7"]
_TOOLS["python"]["mambaforge-latest"] = _TOOLS["python"]["mambaforge-22.9"]
_TOOLS["nodejs"]["latest"] = _TOOLS["nodejs"]["20"]
_TOOLS["rust"]["latest"] = _TOOLS["rust"]["1.75"]
_TOOLS["golang"]["latest"] = _TOOLS["golang"]["1.21"]
19 changes: 14 additions & 5 deletions readthedocs/rtd_tests/fixtures/spec/v2/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"description": "Operating system to be used in the build.",
"enum": [
"ubuntu-20.04",
"ubuntu-22.04"
"ubuntu-22.04",
"ubuntu-latest-lts"
]
},
"jobs": {
Expand Down Expand Up @@ -150,9 +151,12 @@
"3.10",
"3.11",
"3.12",
"latest",
"miniconda3-4.7",
"miniconda-latest",
"mambaforge-4.10",
"mambaforge-22.9"
"mambaforge-22.9",
"mambaforge-latest"
]
},
"nodejs": {
Expand All @@ -161,23 +165,28 @@
"16",
"18",
"19",
"20"
"20",
"latest"
]
},
"rust": {
"enum": [
"1.55",
"1.61",
"1.64",
"1.70"
"1.70",
"1.75",
"latest"
]
},
"golang": {
"enum": [
"1.17",
"1.18",
"1.19",
"1.20"
"1.20",
"1.21",
"latest"
]
}
},
Expand Down