readthedocs.org: API to get active versions is slow, when injecting the sphinx context

Details

Expected Result

I expect the build to succeed (or to fail with a clearer error message)

Actual Result

The build stopped after 40 seconds, just after doing following command :

/home/docs/checkouts/readthedocs.org/user_builds/docxtemplater/envs/latest/bin/python -m pip install --upgrade --cache-dir /home/docs/checkouts/readthedocs.org/user_builds/docxtemplater/.cache/pip Pygments==2.3.1 setuptools==41.0.1 docutils==0.14 mock==1.0.1 pillow==5.4.1 alabaster>=0.7,<0.8,!=0.7.5 commonmark==0.8.1 recommonmark==0.5.0 sphinx<2 sphinx-rtd-theme<0.5 readthedocs-sphinx-ext<1.1

I think this might be related to https://github.com/readthedocs/readthedocs.org/issues/6687, but I would like to keep older versions available in the doc if possible.

Also, if it can help, the last successful build for my project was on 2020-01-31T10:34:03.130141Z : https://readthedocs.org/api/v2/build/10360658.txt and the first failing build was on 2020-02-05T08:40:45.500491Z https://readthedocs.org/api/v2/build/10386322.txt.

The logs inside both these builds seem to be quite different, for example, the successful build does the following :

git remote set-url origin https://github.com/open-xml-templating/docxtemplater.git
git fetch origin --force --tags --prune --prune-tags --depth 50
git checkout --force origin/master

The failing build does the following :

git clone --no-single-branch --depth 50 https://github.com/open-xml-templating/docxtemplater.git .
git checkout --force origin/master
git clean -d -f -f

So I suspect there might have been a big change in readthedocs between those two dates (or something else happened which I don’t understand).

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Some quick things we can do are:

  1. Add an option to the api to only return the fields we need (project is basically being returned for each version, and it’s the same).
  2. Don’t hit that api at all. We inject these versions in the sphinx context and put them in the footer. But online docs use the footer api to get all the versions, so those are replaced.

If we do 2, we are breaking backwards compatibility. Some users may be using the context, we don’t have an easy way of checking this. We could add a feature flag in case a user is using it.

I am reopening since you say that the real problem is still not fixed, feel free to close it as for me all is good.