Search code examples
python-3.xpython-sphinxcloudflarecloudflare-pages

Cloudflare Pages uses different sphinx version depending on commits and one is failing


I have a Cloudflare page that uses python-sphinxto build docs. For some of my commits, it downloads a different version of sphinx than others and fails to build docs correctly.

What I tried:

  • Adding a dummy commit on top of a failing build seems to fix an issue and force Cloudflare builder to download the correct sphinx version
  • re-running deployments doesn't fix the issue
  • creating a new branch with the same head(failing commit) and running another deployment doesn't fix the issue
  • changing between preview/production deployments has no impact on this issue

Here is a dummy commit I added to make the docs build correctly

enter image description here

Commit one result vs. Commit two result

Commit 1 result Commit 2 result

The diff in deployment logs old commits, the left is Commit 1(not working), and the right, Commit two, correctly builds all three tasks and the releases.

https://www.diffchecker.com/ZpV8vE9D

I have tried making different branches and re-run deployments to check whether the sphinx version will change, but it seems like it's bounded the the "old commit". This is also an issue for other Cloudflare Pages, and using preview/production deployments has no impact on this problem.


Solution

  • The issue in this case was actually not with sphinx version but with the fact that I was using:

    git fetch --all
    

    Which does not guarantee pulling the tags with it. The --all pull from all remotes instead of "everything" as I thought.

    Using git fetch --tags instead fixed the issue