Repository navigation
Rebuild Read the Docs on master and release tags - #184
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/en/latest/on https://gnews.readthedocs.io is still the 2026-06-15 build of333f526(build 33152454). Later master commits, including3b0c6d9(0.8.3), never started a build, so https://gnews.readthedocs.io/en/latest/usage/proxies.html is 404 even thoughdocs/usage/proxies.mdis 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_TOKENis set.Sponsor wording in the README and docs is unchanged.
Repo-side check
.readthedocs.yamlwas already a valid v2 config:build.os: ubuntu-22.04, Python 3.11, Sphinx configdocs/conf.py. Those values are still supported.fail_on_warning: trueis now set so the hosted build matchessphinx-build -W.docs/requirements.txtalready installsmyst-parser, which is what turns the Markdown pages (includingusage/proxies.md) into Sphinx documents. The package itself is now installed in the RTD build (pip install .) sosphinx.ext.autodoccan importgnews. Runtime deps still come fromrequirements.txtviasetup.py.sphinx-build -W --keep-going -b html docs docs/_build/htmlfailed locally for one reason:html_static_pathpointed at a missingdocs/_static. That is only a warning unless warnings are errors, which is why the Junelatestbuilds still succeeded.docs/_static/.gitkeepfixes it. A fresh-Wbuild now succeeds and writesusage/proxies.html.docs/conf.pystill saidrelease = "0.8.2"after the 0.8.3 bump. It now readsversionfromsetup.py.stablefailures are not a Sphinx or dependency failure on current master. Builds 33144541 and 33144548 finished in 1 second withcommit: nulland the build page showsTag stable (None). Read the Docs looked for a git tag namedstable, which does not exist, and never ran Sphinx. The version record points at7ef18700(git tag0.2.3, 2021), which has nodocs/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.ymlruns on push tomaster, on tag pushes, on published releases, and via manual dispatch.POST https://readthedocs.org/api/v3/projects/gnews/versions/latest/builds/.POST .../versions/<slug>/builds/for that tag (0.8.3stays0.8.3,release/1.0becomesrelease-1.0). If the version exists but is inactive, the workflowPATCHes it active, which is what makes Read the Docs queue the build (a build POST against an inactive version returns 400).READTHEDOCS_TOKENis unset, the job prints a skip message and exits 0.sphinx-build -Wand checks thatusage/proxies.htmlwas written.What the maintainer must do in the Read the Docs / GitHub dashboards
Add the
READTHEDOCS_TOKENsecret. Create a token at https://app.readthedocs.org/accounts/tokens/ from an account that maintains thegnewsproject. In GitHub, add a repository Actions secret named exactlyREADTHEDOCS_TOKENat 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, versionlatest).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.latesthas not built since commit333f526on 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.Deactivate or repair the
stableversion. Edit https://app.readthedocs.org/dashboard/gnews/version/stable/edit/ and turn Active off (and hide it). Do not pointstableback at tag0.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"). Leavestableoff until a current release tag exists and a build of that tag succeeds. The default version is alreadylatest.Test plan
sphinx-build -W --keep-going -b html docs docs/_build/htmlsucceedsusage/proxies.htmland release0.8.3pytest tests/test_readthedocs_trigger.py(latest POST, tag slug, inactive-version activate, missing-token skip)POST .../versions/latest/builds/returns 401Invalid token(confirms the request is a POST, not a redirected GET)latestbuild past333f526, and https://gnews.readthedocs.io/en/latest/usage/proxies.html returns 200