Repository navigation
[doc] Pin the ReDoc bundle to v2.5.3 instead of tracking the CDN latest tag - #65456
Conversation
…st tag `sphinxcontrib-redoc` injects the renderer from a CDN URL rather than bundling it, so the Ray Jobs API reference page is rendered client-side at page-view time by whatever that URL serves. Pointing it at the `latest` tag means a breaking change in the upstream bundle degrades the published page with no build-time signal, since the Sphinx build never executes the script. Pin to v2.5.3, which is what `latest` currently resolves to. The two bundles are byte-identical (sha256 1320f442151c...), so this changes nothing about how the page renders today. It only stops the renderer from moving underneath us unobserved. Add a comment recording why the version is pinned and that bumping it needs a visual check on the Read the Docs preview, so a future dependency sweep doesn't restore `latest`. Signed-off-by: Douglas Strodtman <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request updates doc/source/conf.py to pin the ReDoc bundle version (redoc_uri) to a specific version (v2.5.3) instead of tracking the CDN's latest tag. This prevents potential breaking changes from degrading the published Jobs API page without a build-time signal. Detailed comments were also added to explain the reasoning and how to verify future updates. There are no review comments to address.
|
This pull request has been automatically marked as stale because it has not had You can always ask for help on our discussion forum or Ray's public slack channel. If you'd like to keep this open, just leave any comment, and the stale label will be removed. |
…ReDoc (#65460) > **Stacked PR.** Targets `doc-1513-declare-openapi-303` (#65458), which targets #65457. Review order is #65457 → #65458 → this. GitHub retargets automatically as each merges. > > **Conflicts with #65456 by design.** That PR pins `redoc_uri` to a specific ReDoc version; this one deletes `redoc_uri` entirely. If #65456 lands first I'll resolve the conflict here. If this lands, #65456 becomes moot and should be closed. Either order works — #65456 is worth keeping as the safe fix in case this one stalls in review. ## Why this change is needed `sphinxcontrib-redoc` is unmaintained. 1.6.0 is the latest release and dates from 2020; the `2.0.0a1` alpha still imports `pkg_resources`. Keeping it costs this repo three things: | Cost | Location | | --- | --- | | A `setuptools<82` ceiling, because the extension imports `pkg_resources` at module load and setuptools 82 removed it | `doc/requirements-doc.txt` | | A `misc.copy_overwrite` entry in `suppress_warnings`, because the extension redundantly copies its own bundled asset | `doc/source/conf.py` | | The renderer fetched from a third-party CDN at page-view time | `doc/source/conf.py` | All of that buys exactly one page. The Jobs API spec is the only consumer: `conf.py` had one `redoc` entry and there's no other OpenAPI document in the repo. There's a second, larger reason. **The current page is a client-rendered JavaScript island.** ReDoc has no source file at all — the extension synthesizes `api.html` from `conf.py`. So today the page: - is in **no toctree**, and - is reachable only through a hardcoded `` `... <api.html>`_ `` link at `rest.rst:94`, and - has **none of its endpoint content in the built HTML**, so it can't participate in Sphinx search or cross-referencing. ## Related changes Fourth in the chain above. Supersedes the "record why we stay on ReDoc" PR (#65459), which I'll close — its conclusion is obsolete now that this works. ## What changes - Swap `sphinxcontrib.redoc` → `sphinxcontrib.openapi` (0.9.0) in `conf.py` and `doc/requirements-doc.txt`, and regenerate the deplock. - Add a real `api.md`, put it in the `job-submission` toctree, and replace the raw `<api.html>` link with a `:ref:`. - Drop the now-unneeded `misc.copy_overwrite` suppression. - Change two operation `summary` fields from YAML block scalars to plain scalars (see below). - Update the `setuptools` comment: the `<82` ceiling's cause is gone. The pin itself is left in place, since unpinning is a separate resolve worth verifying on its own. `sphinxcontrib-openapi` is pure Python, from the same `sphinx-contrib` org, and needs no `pkg_resources`. The deplock diff is `-sphinxcontrib-redoc` and `+sphinxcontrib-openapi` plus its five dependencies (`sphinxcontrib-httpdomain`, `sphinx-mdinclude`, `deepmerge`, `mistune`, `picobox`). ## Verification Built with `make -C doc rtd-build`, which runs the RtD-faithful clean build with `-W`, matching `fail_on_warning: true`: ``` build succeeded. ``` Exit 0, and **zero `WARNING:`/`ERROR:` lines in the whole log**. `raydepsets --check` on `docbuild_depset_311` reports "Lock files are up to date." Checked against the built `api.html` rather than inferred: | Check | Result | | --- | --- | | Request/response schemas rendered | Yes — `Request JSON Object` and `Response JSON Object` field lists, with `entrypoint`, `runtime_env`, `metadata`, and the rest, including types and required flags | | `$ref` and `allOf` resolution | Resolved, including through `JobDetails` | | Literal `**` on the page | None — zero docutils `problematic` nodes | | `http-routingtable` index | Generated | | Page in the sidebar, with prev/next pagination | Yes | | MyST page equivalent to the `.rst` draft it replaced | Yes — 8 httpdomain operation objects, identical `Parameters` / `Request JSON Object` / `Response JSON Object` / `Status Codes` field lists, no leaked rST, and both `:ref:` directions resolving with the right link text | ## Three non-obvious configuration details All three are commented at their sites in the diff, because all three fail quietly. **The renderer is selected via `openapi_default_renderer`, not by the directive spelling.** Writing `.. openapi:httpdomain::` in the page adds an `unknown directive name` warning, which is fatal under `fail_on_warning`. Selecting it in `conf.py` and using a plain `.. openapi::` avoids that. **The default renderer emits no request or response schemas at all** — just paths, parameters, and status codes. So leaving `openapi_default_renderer` unset would silently drop most of the reference content while still building green. That's the trap worth knowing about if anyone touches this later. **The `openapi` directive can't be a bare MyST fence; it has to be wrapped in `eval-rst`.** `sphinxcontrib-openapi` emits reStructuredText into a `ViewList` and hands it to `nested_parse`, but MyST's `nested_parse` renders that content as Markdown. A ```` ```{openapi} ```` fence therefore builds green with zero warnings while silently degrading the entire page: every `.. http:get::` and `:resjson:` line renders as literal text, so nothing becomes an httpdomain object and the page has no field lists, no anchors, and no search or cross-referencing. That's a worse failure than the one above, and just as quiet. ## Why the summary fields change `sphinxcontrib-openapi`'s renderer interpolates an operation's `summary` into `**...**` without stripping it. A YAML block scalar (`summary: |`) leaves a trailing newline in the value, so the markup opens on one line and closes on the next, docutils can't pair it, and readers see literal asterisks. Filed upstream as [sphinx-contrib/openapi#173](sphinx-contrib/openapi#173). Two operations used block scalars (`GET /api/version` and `POST /api/jobs`); the other six already used plain scalars. Converting those two is the whole fix and changes no rendered text. ## What this gives up, honestly **Request and response samples.** ReDoc rendered example payloads; this doesn't. It isn't a configuration choice — both routes to examples are blocked by upstream bugs, and I've confirmed each against this spec: - `:generate-examples-from-schemas:` crashes with `ValueError: dictionary update sequence element #0 has length 1; 2 is required` ([#166](sphinx-contrib/openapi#166)). Example generation can't handle an `allOf` that targets a non-object schema, which is exactly how `JobDetails` attaches descriptions to the `JobType` and `JobStatus` string enums. - `:response-examples-for:` is rejected as an unknown option ([#165](sphinx-contrib/openapi#165)). `api.md` carries a comment recording this so nobody re-derives it, and I've added the reproduction detail to both upstream issues. Weighed against gaining search, cross-referencing, navigation, a dependency that's actually maintained, and no third-party CDN at page-view time, losing sample payloads seemed like the right trade — but it is a real loss, and it's reasonable to want the upstream fixes first instead. I've also filed [#171](sphinx-contrib/openapi#171), [#172](sphinx-contrib/openapi#172), and [#173](sphinx-contrib/openapi#173), each with a minimal reproducer, and am planning PRs for them. ## Checks - [x] `make -C doc rtd-build`: build succeeded, zero warnings. - [x] `raydepsets --check`: lock files up to date. - [x] Built page inspected for schema content, `allOf`/`$ref` resolution, and stray markup. - [x] `pre-commit run` clean. - [x] Read the Docs preview reviewed for the appearance change. --------- Signed-off-by: Douglas Strodtman <[email protected]>
…st tag (ray-project#65456) ## Why this change is needed `doc/source/conf.py` points `redoc_uri` at the ReDoc CDN's unpinned `latest` tag: ```python redoc_uri = "https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js" ``` `sphinxcontrib-redoc` injects that script tag alongside the spec; it doesn't bundle a renderer. So the published Jobs API page at `cluster/running-applications/job-submission/api.html` is rendered client-side, at page-view time, by whatever Redocly currently serves at `latest`. If a breaking change lands in that bundle, the live page degrades with no build-time signal at all, because the Sphinx build never executes the script. The build stays green while the page is broken. This pins the version so the renderer stops moving underneath the docs unobserved. ## Related changes None. This is deliberately scoped to the one line plus a comment. ## What changes - Pin `redoc_uri` to `v2.5.3`. - Add a comment recording why it's pinned and that bumping it requires a visual check on the Read the Docs preview, so a future dependency sweep doesn't helpfully restore `latest`. ## Why v2.5.3, and why this is a no-op today `v2.5.3` is what `latest` currently resolves to, so the pin doesn't silently downgrade the rendering. The two bundles are byte-identical, verified 2026-08-13: | URL | HTTP | Bytes | sha256 | | --- | --- | --- | --- | | `.../redoc/latest/bundles/redoc.standalone.js` | 200 | 1,097,271 | `1320f442151c57c447d3b70c7ffc6c4f86d08464020fe34c8cc5d3164e9944f0` | | `.../redoc/v2.5.3/bundles/redoc.standalone.js` | 200 | 1,097,271 | `1320f442151c57c447d3b70c7ffc6c4f86d08464020fe34c8cc5d3164e9944f0` | `2.5.3` is also the current `latest` dist-tag on npm. The next release line is `3.0.0-rc.0`, which is exactly the kind of bundle that would arrive through this URL unannounced and unverified today. For context on why the unpinned tag isn't hypothetical, `latest` has already moved well away from older 2.x builds: `v2.5.0` is 910,994 bytes against the current 1,097,271. ## Checks - [x] `doc/source/conf.py` parses; `pre-commit run` clean on the staged change. - [ ] Loaded `api.html` in the Read the Docs preview for this PR and confirmed the three-panel layout and the endpoint list render. Will confirm here once the preview build finishes — a green Sphinx build proves nothing for a client-rendered page. ## Out of scope Replacing the unmaintained `sphinxcontrib-redoc` extension, and the separate question of the spec's declared OpenAPI version. Both are tracked separately and neither blocks this pin, which is worth having regardless of how they land. Signed-off-by: Douglas Strodtman <[email protected]>
…ReDoc (ray-project#65460) > **Stacked PR.** Targets `doc-1513-declare-openapi-303` (ray-project#65458), which targets ray-project#65457. Review order is ray-project#65457 → ray-project#65458 → this. GitHub retargets automatically as each merges. > > **Conflicts with ray-project#65456 by design.** That PR pins `redoc_uri` to a specific ReDoc version; this one deletes `redoc_uri` entirely. If ray-project#65456 lands first I'll resolve the conflict here. If this lands, ray-project#65456 becomes moot and should be closed. Either order works — ray-project#65456 is worth keeping as the safe fix in case this one stalls in review. ## Why this change is needed `sphinxcontrib-redoc` is unmaintained. 1.6.0 is the latest release and dates from 2020; the `2.0.0a1` alpha still imports `pkg_resources`. Keeping it costs this repo three things: | Cost | Location | | --- | --- | | A `setuptools<82` ceiling, because the extension imports `pkg_resources` at module load and setuptools 82 removed it | `doc/requirements-doc.txt` | | A `misc.copy_overwrite` entry in `suppress_warnings`, because the extension redundantly copies its own bundled asset | `doc/source/conf.py` | | The renderer fetched from a third-party CDN at page-view time | `doc/source/conf.py` | All of that buys exactly one page. The Jobs API spec is the only consumer: `conf.py` had one `redoc` entry and there's no other OpenAPI document in the repo. There's a second, larger reason. **The current page is a client-rendered JavaScript island.** ReDoc has no source file at all — the extension synthesizes `api.html` from `conf.py`. So today the page: - is in **no toctree**, and - is reachable only through a hardcoded `` `... <api.html>`_ `` link at `rest.rst:94`, and - has **none of its endpoint content in the built HTML**, so it can't participate in Sphinx search or cross-referencing. ## Related changes Fourth in the chain above. Supersedes the "record why we stay on ReDoc" PR (ray-project#65459), which I'll close — its conclusion is obsolete now that this works. ## What changes - Swap `sphinxcontrib.redoc` → `sphinxcontrib.openapi` (0.9.0) in `conf.py` and `doc/requirements-doc.txt`, and regenerate the deplock. - Add a real `api.md`, put it in the `job-submission` toctree, and replace the raw `<api.html>` link with a `:ref:`. - Drop the now-unneeded `misc.copy_overwrite` suppression. - Change two operation `summary` fields from YAML block scalars to plain scalars (see below). - Update the `setuptools` comment: the `<82` ceiling's cause is gone. The pin itself is left in place, since unpinning is a separate resolve worth verifying on its own. `sphinxcontrib-openapi` is pure Python, from the same `sphinx-contrib` org, and needs no `pkg_resources`. The deplock diff is `-sphinxcontrib-redoc` and `+sphinxcontrib-openapi` plus its five dependencies (`sphinxcontrib-httpdomain`, `sphinx-mdinclude`, `deepmerge`, `mistune`, `picobox`). ## Verification Built with `make -C doc rtd-build`, which runs the RtD-faithful clean build with `-W`, matching `fail_on_warning: true`: ``` build succeeded. ``` Exit 0, and **zero `WARNING:`/`ERROR:` lines in the whole log**. `raydepsets --check` on `docbuild_depset_311` reports "Lock files are up to date." Checked against the built `api.html` rather than inferred: | Check | Result | | --- | --- | | Request/response schemas rendered | Yes — `Request JSON Object` and `Response JSON Object` field lists, with `entrypoint`, `runtime_env`, `metadata`, and the rest, including types and required flags | | `$ref` and `allOf` resolution | Resolved, including through `JobDetails` | | Literal `**` on the page | None — zero docutils `problematic` nodes | | `http-routingtable` index | Generated | | Page in the sidebar, with prev/next pagination | Yes | | MyST page equivalent to the `.rst` draft it replaced | Yes — 8 httpdomain operation objects, identical `Parameters` / `Request JSON Object` / `Response JSON Object` / `Status Codes` field lists, no leaked rST, and both `:ref:` directions resolving with the right link text | ## Three non-obvious configuration details All three are commented at their sites in the diff, because all three fail quietly. **The renderer is selected via `openapi_default_renderer`, not by the directive spelling.** Writing `.. openapi:httpdomain::` in the page adds an `unknown directive name` warning, which is fatal under `fail_on_warning`. Selecting it in `conf.py` and using a plain `.. openapi::` avoids that. **The default renderer emits no request or response schemas at all** — just paths, parameters, and status codes. So leaving `openapi_default_renderer` unset would silently drop most of the reference content while still building green. That's the trap worth knowing about if anyone touches this later. **The `openapi` directive can't be a bare MyST fence; it has to be wrapped in `eval-rst`.** `sphinxcontrib-openapi` emits reStructuredText into a `ViewList` and hands it to `nested_parse`, but MyST's `nested_parse` renders that content as Markdown. A ```` ```{openapi} ```` fence therefore builds green with zero warnings while silently degrading the entire page: every `.. http:get::` and `:resjson:` line renders as literal text, so nothing becomes an httpdomain object and the page has no field lists, no anchors, and no search or cross-referencing. That's a worse failure than the one above, and just as quiet. ## Why the summary fields change `sphinxcontrib-openapi`'s renderer interpolates an operation's `summary` into `**...**` without stripping it. A YAML block scalar (`summary: |`) leaves a trailing newline in the value, so the markup opens on one line and closes on the next, docutils can't pair it, and readers see literal asterisks. Filed upstream as [sphinx-contrib/openapi#173](sphinx-contrib/openapi#173). Two operations used block scalars (`GET /api/version` and `POST /api/jobs`); the other six already used plain scalars. Converting those two is the whole fix and changes no rendered text. ## What this gives up, honestly **Request and response samples.** ReDoc rendered example payloads; this doesn't. It isn't a configuration choice — both routes to examples are blocked by upstream bugs, and I've confirmed each against this spec: - `:generate-examples-from-schemas:` crashes with `ValueError: dictionary update sequence element #0 has length 1; 2 is required` ([ray-project#166](sphinx-contrib/openapi#166)). Example generation can't handle an `allOf` that targets a non-object schema, which is exactly how `JobDetails` attaches descriptions to the `JobType` and `JobStatus` string enums. - `:response-examples-for:` is rejected as an unknown option ([ray-project#165](sphinx-contrib/openapi#165)). `api.md` carries a comment recording this so nobody re-derives it, and I've added the reproduction detail to both upstream issues. Weighed against gaining search, cross-referencing, navigation, a dependency that's actually maintained, and no third-party CDN at page-view time, losing sample payloads seemed like the right trade — but it is a real loss, and it's reasonable to want the upstream fixes first instead. I've also filed [ray-project#171](sphinx-contrib/openapi#171), [ray-project#172](sphinx-contrib/openapi#172), and [ray-project#173](sphinx-contrib/openapi#173), each with a minimal reproducer, and am planning PRs for them. ## Checks - [x] `make -C doc rtd-build`: build succeeded, zero warnings. - [x] `raydepsets --check`: lock files up to date. - [x] Built page inspected for schema content, `allOf`/`$ref` resolution, and stray markup. - [x] `pre-commit run` clean. - [x] Read the Docs preview reviewed for the appearance change. --------- Signed-off-by: Douglas Strodtman <[email protected]>
Why this change is needed
doc/source/conf.pypointsredoc_uriat the ReDoc CDN's unpinnedlatesttag:sphinxcontrib-redocinjects that script tag alongside the spec; it doesn't bundle a renderer. So the published Jobs API page atcluster/running-applications/job-submission/api.htmlis rendered client-side, at page-view time, by whatever Redocly currently serves atlatest. If a breaking change lands in that bundle, the live page degrades with no build-time signal at all, because the Sphinx build never executes the script. The build stays green while the page is broken.This pins the version so the renderer stops moving underneath the docs unobserved.
Related changes
None. This is deliberately scoped to the one line plus a comment.
What changes
redoc_uritov2.5.3.latest.Why v2.5.3, and why this is a no-op today
v2.5.3is whatlatestcurrently resolves to, so the pin doesn't silently downgrade the rendering. The two bundles are byte-identical, verified 2026-08-13:.../redoc/latest/bundles/redoc.standalone.js1320f442151c57c447d3b70c7ffc6c4f86d08464020fe34c8cc5d3164e9944f0.../redoc/v2.5.3/bundles/redoc.standalone.js1320f442151c57c447d3b70c7ffc6c4f86d08464020fe34c8cc5d3164e9944f02.5.3is also the currentlatestdist-tag on npm. The next release line is3.0.0-rc.0, which is exactly the kind of bundle that would arrive through this URL unannounced and unverified today.For context on why the unpinned tag isn't hypothetical,
latesthas already moved well away from older 2.x builds:v2.5.0is 910,994 bytes against the current 1,097,271.Checks
doc/source/conf.pyparses;pre-commit runclean on the staged change.api.htmlin the Read the Docs preview for this PR and confirmed the three-panel layout and the endpoint list render. Will confirm here once the preview build finishes — a green Sphinx build proves nothing for a client-rendered page.Out of scope
Replacing the unmaintained
sphinxcontrib-redocextension, and the separate question of the spec's declared OpenAPI version. Both are tracked separately and neither blocks this pin, which is worth having regardless of how they land.