Skip to content

docs: Diátaxis foundation, OpenAPI/redoc, validated Platform-API how-to - #1418

Open
sstruzik wants to merge 15 commits into
mainfrom
docs/migration
Open

docs: Diátaxis foundation, OpenAPI/redoc, validated Platform-API how-to#1418
sstruzik wants to merge 15 commits into
mainfrom
docs/migration

Conversation

@sstruzik

@sstruzik sstruzik commented Jul 17, 2026

Copy link
Copy Markdown

Gives OasisPlatform its own Diátaxis documentation set, co-located with the code, replacing the platform prose that lived in GenerateDocs.

Part of the cross-repo Oasis documentation restructure (Option B): each repository owns the docs for what it owns, and GenerateDocs aggregates them into the published site.

What this adds

  • A Furo + MyST Diátaxis project in docs/source/, with the platform pages migrated out of GenerateDocs: explanation (overview, architecture, Oasis UI), how-to (first steps, deployment, container configuration, distributed execution and configuration), reference (REST API).
  • The OpenAPI schemas persisted in-repo (_static/schemas/). They were CI-only with 3-day retention, so the API reference could not be rebuilt from history. Now they are versioned with the code.
  • The REST API rendered with Redoc, vendored in _static/redoc/ (redoc.standalone.js v2.1.5). This replaced sphinxcontrib-redoc, which is abandoned, capped Sphinx below 8 and needed pkg_resources/setuptools<81; dropping it took the whole toolchain to Sphinx 9.1. A build hook inlines each spec into a themed page, so it renders offline and under file://.
  • A Platform-API how-to (run-analysis-via-api) — the full APIClient workflow: connect, register a model, upload OED, create an analysis, generate inputs, run, download ORD. Validated end-to-end against a live v2 platform, not written from the source: build images → register → upload → generate → run → download → EP-curve plot.
  • The old flat alabaster docs removed, including committed build output (53 files, ~18k lines).
  • Shared Oasis branding and cross-component intersphinx links, matching the other five component sites.

Review-round changes

Three broken in-site links, found by the new link check (GenerateDocs#55) and both from RST auto-linking text that was never meant to be a link:

  • first-steps.rst had `httpie <www.httpie.org>`_ with no scheme, so Sphinx resolved it as a relative path. Doubly broken: www.httpie.org no longer resolves at all, and httpie.org now redirects to httpie.io.
  • container_configuration.rst had https://<site-domain>/api/ as a placeholder; the parser auto-linked it only as far as the <, giving href="https:/" twice and rendering the text as https:/ /<site-domain>/api/. So the table read wrongly as well as linking nowhere. Both are now inline literals.

Eleven links off a deleted branch. reference/API.rst pointed at OasisPlatform/blob/platform-2.0/kubernetes/…, and that branch is gone. All three target files exist on main (verified 200). One of the eleven was wrapped across two source lines, so it needed a second pass — worth knowing for anyone doing a similar sweep.

The SaaS providers list migrated in. This page already ended its SaaS discussion with "More information about SaaS and the companies can be found in the SaaS providers section" — a promise to a section that never existed here. That content was in GenerateDocs and was being dropped, with the landing-page link repointed to platform/index.html, which names none of the providers. The six named companies now live in how-to/deployment.rst as a real section, and the dangling sentence references it. All six links verified 200.

conf.py hardened — it no longer aborts when OASIS_INTERSPHINX_MAP is exported empty (environ.get(NAME, "{}") only defaults when the variable is unset, so an empty value reached json.loads("")), plus the E401 import split so the cross-component block is lint-clean and identical across components.

Build is 0 warnings standalone and in the aggregated build.

Two things worth a look

  • https://www.rms.com/ in the new SaaS list now redirects to moodys.com (RMS was acquired), so the label "RMS IRP" is behind the branding. Kept verbatim, since that commit moves content rather than rewriting it.
  • Scan Repo fails on this branch. It was already failing before these commits, and the build_images failures seen mid-review were a GitHub rate limit while building the ods-tools wheel (403 rate limit exceeded fetching OED spec releases) — not caused by anything here.

Add the OasisPlatform documentation set: Diátaxis structure, persisted OpenAPI schemas rendered with a vendored Redoc, and a live-validated Platform-API how-to.

sstruzik and others added 5 commits July 16, 2026 16:41
Stand up a Furo + MyST Diataxis docs project in docs/source/ (replacing the old
flat alabaster docs/) and migrate the platform pages from GenerateDocs:
- explanation/: overview, platform_architecture, Oasis-UI
- how-to/: first-steps, deployment, container_configuration,
  distributed_execution, distributed_configuration (+ pointer to the in-repo
  kubernetes/charts Helm docs rather than duplicating them)
- reference/: rest_api, API (+ note on persisting the drf-spectacular OpenAPI
  schemas and redoc rendering to follow)
Images migrated; within-set :doc: made absolute; out-of-set refs softened.

Build green, renders clean; no broken links/images/toctree (residual warnings are
inherited docutils formatting in the migrated rst). Old flat docs/ (alabaster +
committed build output) superseded by docs/source/ — to be removed in follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…edoc

- Persist the Platform v1/v2 OpenAPI schemas in-repo under
  docs/source/_static/schemas/ (fixes the 3-day CI-artifact problem; they should be
  regenerated + committed on release from drf-spectacular).
- Render them as interactive redoc pages (reference/platform_v1, platform_v2),
  wired into the reference toctree.
- Use the redoc.js bundled with sphinxcontrib-redoc (no redoc_uri) so the docs are
  self-contained (no runtime CDN dependency, no network at build).
- Add docs/requirements.txt.

Build green; API viewer renders offline from the persisted schema (verified).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…d output)

Delete the superseded flat docs/ setup now that docs/source/ is canonical:
- old source (conf.py, index/first-steps/repository-management/sphinx/modules.rst,
  make.bat)
- committed build output (*.html, _modules/, _sources/, _static/, searchindex.js,
  objects.inv, .nojekyll, .DS_Store)
Keep docs/source/, docs/requirements.txt, the analysis_settings.json/.xsd examples,
and point docs/Makefile at source/. Docs build unchanged (16 pages, redoc intact).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add how-to/run-analysis-via-api.md documenting the full API workflow with
oasislmf.platform_api.client.APIClient: connect -> register model -> upload OED
exposure -> create analysis -> generate inputs -> run -> download ORD outputs, plus
the CLI equivalent. Grounded in the real client code; execution-off (a live analysis
needs the full platform stack via Docker Compose). Every endpoint validated against
the persisted platform-2.json OpenAPI schema.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ntersphinx

Corrections from a live end-to-end run (api_url needs /api/, auth_type=simple, model
run_mode step), the real download artifact + an EP-curve plot cell, a local-Docker
RUNBOOK, and the cross-component intersphinx block.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
sstruzik and others added 2 commits July 17, 2026 17:51
Add the Oasis logo (light/dark, always visible in the Furo sidebar), the maroon/red
Raleway palette matching oasislmf.github.io, and a persistent 'Oasis documentation home'
link (rewritten to page-relative by the aggregator) so you can return to the top of the
aggregated site from anywhere.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the abandoned sphinxcontrib-redoc Sphinx extension (last released 2019; caps
Sphinx<8 and imports pkg_resources, removed in setuptools>=81) with Redoc's maintained
standalone bundle, vendored in _static/redoc/. A build-time hook (_ext/gen_redoc.py)
writes the standalone API pages with the OpenAPI spec **inlined** (no spec-url fetch), so
the reference renders fully offline — including under file:// — matching the old embed
behaviour. The themed platform_v{1,2} pages embed them via an isolated iframe. Removes the
Sphinx version cap and the setuptools<81 pin.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@a982331). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1418   +/-   ##
=======================================
  Coverage        ?   74.10%           
=======================================
  Files           ?      214           
  Lines           ?    14140           
  Branches        ?        0           
=======================================
  Hits            ?    10478           
  Misses          ?     3662           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

sstruzik and others added 3 commits August 5, 2026 10:09
Clear the docutils warnings surfaced under the newer Sphinx: blank line between
targets and headings, drop decorative transitions that opened sections, normalise
short title underlines, blank lines after figure directives, escape a stray emphasis
marker, and mark the non-HTTP code block as text. Also link the API schema pages
to the actual v1/v2 references. Both files now build warning-free.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sweep the remaining docutils warnings across the migrated RST so a clean build emits
none: normalise short title underlines, fix heading-level hierarchy (~ -> ^ under H2),
drop section-opening transitions, add blank lines after figures/line-blocks, escape
trailing underscores that formed phantom references (OASIS_, dynamic_, fixed_), and
replace the unavailable youtube directive with a responsive raw-HTML embed (no extra
extension). Clean 'sphinx -E' build: 0 warnings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The sidebar logo now returns to the aggregated landing, so the redundant 'Oasis
documentation home' announcement bar is removed. Add the GitHub link in Furo's
conventional spot — the footer icons (bottom of every page).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sstruzik
sstruzik marked this pull request as ready for review August 11, 2026 08:58
@sstruzik
sstruzik requested review from SkylordA and sambles August 11, 2026 14:04

@sambles sambles left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, New build structure for the documentation works well.

The docs themselves could do with an overhaul and trimming down in places. But i feels its better to do that in another PR after this is merged

sstruzik and others added 5 commits August 18, 2026 12:26
`environ.get(NAME, "{}")` only substitutes the default when the variable is UNSET, so
exporting it empty reached json.loads("") and aborted the build with a traceback instead
of falling back to no cross-component inventories. Now `environ.get(NAME) or "{}"`.

Latent rather than live: the GenerateDocs orchestrator always writes valid JSON via
json.dumps, so it triggers only when the variable is exported empty by hand or by a CI
step. Found while reworking the same block in ODS_Tools (#289, 10e38ba) and applied
across the remaining components for consistency.

Verified by executing conf.py with the variable unset, set-but-empty and mapped: all
three succeed, and any pre-existing intersphinx_mapping entries are preserved.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
autopep8 --diff --exit-code, which OasisLMF runs recursively over the repo, flagged
`import json as _ix_json, os as _ix_os` as E401. Pre-existing, and dormant only because
the code-quality workflow is not among the checks triggered on the docs PRs.

Same change ODS_Tools already took in eb349ea, so all six components now have an
identical, lint-clean cross-component block.

Verified: 0 autopep8 findings for this file (was 3), the CI flake8 selection is clean,
and conf.py still executes with OASIS_INTERSPHINX_MAP unset, set-but-empty and mapped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
GenerateDocs' link check over the assembled site (GenerateDocs#54, d8d362b) reported three
broken in-site links, all here, both with the same root cause: RST auto-linking text that
was never meant to be a link.

**first-steps.rst:44** — ``` `httpie <www.httpie.org>`_ ``` has no scheme, so Sphinx
resolved it as a *relative path* and emitted `href="www.httpie.org"`, which resolves to
nothing. It was doubly broken: `www.httpie.org` no longer resolves at all, and `httpie.org`
now redirects to `httpie.io`. Repointed to `https://httpie.io/`.

**container_configuration.rst:94** — `https://<site-domain>/api/` and
`https://<site-domain>/` are placeholders, but the parser auto-links them as far as the
`<`, producing `href="https:/"` twice and rendering the text as `https:/ /<site-domain>/…`.
So the table read wrongly as well as linking nowhere. Both are now inline literals, which
is what a placeholder URL should be.

Verified: sphinx -E builds 0 warnings; no `href="https:/"` or scheme-less httpie link
remains; the placeholder now renders as literal text; and the assembled-site internal check
goes from 3 broken to 0.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The link check (GenerateDocs#54) found reference/API.rst pointing 11 links at
OasisPlatform/blob/platform-2.0/kubernetes/…, and that branch no longer exists. All three
target files are present on main and were verified 200:

  kubernetes/README.md
  kubernetes/charts/README.md
  kubernetes/worker-controller/README.md

One of the eleven was wrapped across two source lines, so it needed a second pass — worth
noting for anyone doing a similar sweep, since a naive whole-URL match misses those.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
deployment.rst already ended its SaaS discussion with "More information about SaaS and the
companies can be found in the SaaS providers section" — a promise to a section that never
existed here. The content lived in GenerateDocs (`src/sections/SaaS-providers.rst`) and was
dropped in the restructure, with the landing-page link repointed to platform/index.html,
which does not mention any of the providers. So the list of six named companies — the actual
value of that page — was on its way to being lost.

Migrated here, as a section of the deployment how-to rather than a page of its own: it is
the answer to "what if I would rather not host this myself", which is exactly what the
surrounding page is about. The dangling sentence now references it for real.

Added only to the page's "On this page" list, not to the list in the Introduction — that one
enumerates the four types of user, and a provider directory is not one of those.

All six links verified 200 before publishing. One worth a follow-up rather than a silent
edit: https://www.rms.com/ now redirects to moodys.com (RMS was acquired), so the label "RMS
IRP" is behind the branding. Kept verbatim here since this commit moves content rather than
rewriting it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants