Skip to content

Rebuild Read the Docs on master and release tags - #184

Merged
ranahaani merged 1 commit into
masterfrom
cursor/fix-readthedocs-builds-b964
Oct 9, 2026
Merged

ranahaani merged 1 commit into
masterfrom
cursor/fix-readthedocs-builds-b964

Conversation

@ranahaani

Copy link
Copy Markdown
Owner

Summary

/en/latest/ on https://gnews.readthedocs.io is still the 2026-06-15 build of 333f526 (build 33152454). Later master commits, including 3b0c6d9 (0.8.3), never started a build, so https://gnews.readthedocs.io/en/latest/usage/proxies.html is 404 even though docs/usage/proxies.md is on master and already in the toctree.

The repo webhook list is not visible with the available token (GitHub returns 403), but the public build history shows no build at all after that commit. That matches a dead GitHub → Read the Docs webhook. This PR does not change that integration (it lives in the Read the Docs account). It makes the docs build strict and clean, and it triggers builds from GitHub Actions when READTHEDOCS_TOKEN is set.

Sponsor wording in the README and docs is unchanged.

Repo-side check

  • .readthedocs.yaml was already a valid v2 config: build.os: ubuntu-22.04, Python 3.11, Sphinx config docs/conf.py. Those values are still supported. fail_on_warning: true is now set so the hosted build matches sphinx-build -W.
  • docs/requirements.txt already installs myst-parser, which is what turns the Markdown pages (including usage/proxies.md) into Sphinx documents. The package itself is now installed in the RTD build (pip install .) so sphinx.ext.autodoc can import gnews. Runtime deps still come from requirements.txt via setup.py.
  • sphinx-build -W --keep-going -b html docs docs/_build/html failed locally for one reason: html_static_path pointed at a missing docs/_static. That is only a warning unless warnings are errors, which is why the June latest builds still succeeded. docs/_static/.gitkeep fixes it. A fresh -W build now succeeds and writes usage/proxies.html.
  • docs/conf.py still said release = "0.8.2" after the 0.8.3 bump. It now reads version from setup.py.
  • The 2026-06-15 stable failures are not a Sphinx or dependency failure on current master. Builds 33144541 and 33144548 finished in 1 second with commit: null and the build page shows Tag stable (None). Read the Docs looked for a git tag named stable, which does not exist, and never ran Sphinx. The version record points at 7ef18700 (git tag 0.2.3, 2021), which has no docs/ tree and no .readthedocs.yaml. https://gnews.readthedocs.io/en/stable/ returns 404. The site root already redirects to /en/latest/.

What this PR adds

  • .github/workflows/readthedocs.yml runs on push to master, on tag pushes, on published releases, and via manual dispatch.
    • Master pushes POST https://readthedocs.org/api/v3/projects/gnews/versions/latest/builds/.
    • Tags and published releases sync versions, then POST .../versions/<slug>/builds/ for that tag (0.8.3 stays 0.8.3, release/1.0 becomes release-1.0). If the version exists but is inactive, the workflow PATCHes it active, which is what makes Read the Docs queue the build (a build POST against an inactive version returns 400).
    • If READTHEDOCS_TOKEN is unset, the job prints a skip message and exits 0.
  • The existing test workflow also builds the docs with sphinx-build -W and checks that usage/proxies.html was written.

What the maintainer must do in the Read the Docs / GitHub dashboards

  1. Add the READTHEDOCS_TOKEN secret. Create a token at https://app.readthedocs.org/accounts/tokens/ from an account that maintains the gnews project. In GitHub, add a repository Actions secret named exactly READTHEDOCS_TOKEN at https://github.com/ranahaani/GNews/settings/secrets/actions. Until that secret exists, the new workflow succeeds and does not call the API. After it exists, re-run the workflow (or use Actions → Trigger Read the Docs → Run workflow, version latest).

  2. Reconnect the GitHub integration and resync versions. In https://app.readthedocs.org/dashboard/gnews/, open Admin → Integrations and reconnect the GitHub service (or reinstall the Read the Docs GitHub App / webhook on ranahaani/GNews). Then resync versions from Admin → Versions. latest has not built since commit 333f526 on 2026-06-15, so pushes are not arriving. The Actions workflow is the backup trigger; reconnecting the integration is what makes Read the Docs notice new commits and tags on its own.

  3. Deactivate or repair the stable version. Edit https://app.readthedocs.org/dashboard/gnews/version/stable/edit/ and turn Active off (and hide it). Do not point stable back at tag 0.2.3: that tag cannot build these docs, and there is still no git tag or GitHub Release for 0.8.3 (the newest GitHub release is "Version 0.2.3"). Leave stable off until a current release tag exists and a build of that tag succeeds. The default version is already latest.

Test plan

  • sphinx-build -W --keep-going -b html docs docs/_build/html succeeds
  • Built HTML contains usage/proxies.html and release 0.8.3
  • pytest tests/test_readthedocs_trigger.py (latest POST, tag slug, inactive-version activate, missing-token skip)
  • Unauthenticated POST .../versions/latest/builds/ returns 401 Invalid token (confirms the request is a POST, not a redirected GET)
  • After the secret is added: Actions run triggers a new latest build past 333f526, and https://gnews.readthedocs.io/en/latest/usage/proxies.html returns 200
Open in Web Open in Cursor 

Pushes to master stopped rebuilding gnews.readthedocs.io after 333f526,
so usage/proxies never appeared on /en/latest/. Make the Sphinx build
pass under -W and call the Read the Docs API when READTHEDOCS_TOKEN is set.

Co-authored-by: Muhammad Abdullah <ranahaani@gmail.com>
@ranahaani
ranahaani merged commit 94117c4 into master Oct 9, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants