Skip to content

docs: switch to a MkDocs Material site - #228

Merged
uniqueg merged 8 commits into
devfrom
docs/mkdocs-site
Oct 22, 2026
Merged

uniqueg merged 8 commits into
devfrom
docs/mkdocs-site

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Closes #209.

Summary

proTES gets a MkDocs Material site on Read the Docs, as cloud-registry has (elixir-cloud-aai/cloud-registry#139):

  • mkdocs.yml, .readthedocs.yaml (fail_on_warning: true, docs extra, Python 3.12 as in the image) and docs/hooks.py (with tests/test_docs_hooks.py), copied from cloud-registry and adapted to proTES.
  • Pages:
    • Home: README synopsis, known deployments, contents, architecture, license, contact.
    • Getting started: README quick start, Compose volumes, Flower profile, shutdown, MTU troubleshooting.
    • Configuration: overlays, TES instances, middlewares, task settings, request size limit, Gunicorn and Celery, service info.
    • API: TES endpoints, how tasks are forwarded, errors.
    • Middlewares: built-in ones, writing your own, and the management API (integrates docs/middleware.md, which is removed).
    • Access control: authentication is disabled for now; how Basic credentials are forwarded to TES instances.
    • Deployment: the chart README.
    • Operations.
    • Upgrading: changes since the last deployed version, including refactor!: upgrade to FOCA 0.15 #219, build!: adopt pyproject, harden image and Compose #223 and the Compose data.
    • Development.
    • Contributing: a short page, completed by docs: add code of conduct and contributing guide #211 (docs: add code of conduct and contributing guide #222).
    • API reference (mkdocstrings) and Changelog.
  • The README sections are included as snippets. The chart's deployment/README.md is rewritten with absolute links only, without its broken table of contents, and with the current clone URL, so that the packaged chart's links work (ci: release from signed version tags #44).
  • pyproject.toml: a docs extra (bounded versions, as in cloud-registry) and the Documentation URL.
  • CI: a job "Build documentation" (mkdocs build --strict, pinned actions). The image publishing job also waits for it.
  • Pre-commit hygiene for style: adopt the shared ruff, mypy and pre-commit #206: the files touched here have no trailing whitespace and end with a newline (including docs/images/overview.svg).

Review

  • CodeQL (high, py/incomplete-url-substring-sanitization) on the chart README test: it now compares host names instead of checking for a substring (a test-only false positive, fixed anyway).
  • The docs are kept generic: no issuer-specific (LS Login) or network-specific wording. The ELIXIR On-Cloud branding of the README and the site stays.
  • Merged dev (style: reformat with ruff #227, ruff reformat); docs/hooks.py and its test pass ruff format --check.

Declined review findings

  • Sourcery, "Funnel fallback loses credentials" (docs/access-control.md): a real bug in create_task() (B1 of the plan), not in this docs PR. fix: task listing, timestamps and relay bugs #208 fixes it, and the page describes the intended behaviour.
  • Sourcery, "Versioned chart links point to dev" (docs/hooks.py): Read the Docs sets READTHEDOCS_GIT_COMMIT_HASH for all builds, tags included, so links point to the commit that is built (same hook as in cloud-registry).

Repository setup (admin)

  • Read the Docs project protes (the README badge and links point to https://protes.readthedocs.io/en/latest/), building latest and tags, with an automation rule that activates the versions of v* tags, as for cloud-registry.
  • Once merged, "Build documentation" can become a required check.

Light lane

Light lane: documentation, a docs build job without secrets or permissions, and the small docs hook copied unchanged from cloud-registry (with its tests).

Verification

  • mkdocs build --strict (Python 3.13 venv with the docs extra's packages): no warnings.
  • pytest tests/test_docs_hooks.py: 18 passed.
  • CI: all checks pass (including "Build documentation" and CodeQL).

🤖 Generated with Claude Code

uniqueg and others added 6 commits October 22, 2026 20:39
Title "proTES" with the ELIXIR On-Cloud logo, the badges of
cloud-registry (license, build status, docs, coverage, release tag and
image), a synopsis that presents proTES as a TES gateway for any
network, brought to you by ELIXIR On-Cloud, a "Known deployments"
section (none listed yet), a quick start and contributing; README
sections are marked for inclusion in the docs site. The architecture,
license and contact move to docs/index.md, the Compose details and the
MTU troubleshooting to docs/getting-started.md; the overview diagram
moves to docs/images/, and the old ELIXIR, GA4GH and ELIXIR Cloud &
AAI logos are removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
In the Helm chart's description and notes and the contact of the
middleware management API spec. Identifiers (GitHub organization,
Docker Hub) stay.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
mkdocs.yml, .readthedocs.yaml and docs/hooks.py (with tests) as in
cloud-registry; pages for getting started, configuration, API,
middlewares (from docs/middleware.md), access control, deployment (the
chart README, with absolute links), operations, upgrading, the API
reference and the changelog; README sections are included.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	README.md
#	docs/getting-started.md
#	docs/index.md
Add the docs extra and the CI job "Build documentation" (mkdocs build
--strict on the image's Python 3.12, as on Read the Docs), which the
image publishing now waits for. Describe the Gunicorn settings, the
Compose volumes and Flower profile, and the image changes of #204;
add the development page and a contributing page (completed by #211);
add the final newline of the overview diagram.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR replaces the repository’s ad hoc documentation with a strict MkDocs Material site published on Read the Docs, consolidates and expands operational/API guidance, embeds the Helm README through a tested link-rewriting hook, and enforces documentation builds in CI before image publication.

Flow diagram for strict documentation validation in CI

flowchart LR
    Checkout[Check out repository] --> Python[Set up Python 3.12]
    Python --> Install["Install .[docs]"]
    Install --> Build[Run mkdocs build --strict]
    Build --> DocsOK{Documentation build passes}
    DocsOK -->|yes| Publish[Build and publish app image]
    DocsOK -->|no| Stop[Stop workflow]
Loading

File-Level Changes

Change Details Files
Add a MkDocs Material documentation site with Read the Docs configuration and a structured documentation navigation.
  • Create the MkDocs configuration, theme, plugins, Markdown extensions, strict validation, and documentation navigation.
  • Add pages covering setup, configuration, API behavior, middleware, access control, deployment, operations, upgrades, development, contribution, API reference, and changelog.
  • Include selected README sections as snippets and expose generated Python API documentation with mkdocstrings.
mkdocs.yml
.readthedocs.yaml
docs/index.md
docs/getting-started.md
docs/configuration.md
docs/api.md
docs/middlewares.md
docs/access-control.md
docs/deployment.md
docs/operations.md
docs/upgrading.md
docs/development.md
docs/contributing.md
docs/reference.md
docs/changelog.md
docs/images/overview.svg
docs/middleware.md
Implement and test a MkDocs hook that embeds the Helm chart README while rewriting links for the rendered site and versioned repository sources.
  • Replace the deployment-page include marker with deployment/README.md content.
  • Convert Read the Docs links to MkDocs-relative page links and dev-branch GitHub links to the build commit.
  • Skip link rewriting inside fenced code blocks and validate absolute chart README links.
  • Add focused tests for link adaptation, code fences, README inclusion, and Read the Docs commit handling.
docs/hooks.py
tests/test_docs_hooks.py
deployment/README.md
Integrate documentation dependencies, project metadata, and CI/Read the Docs builds.
  • Add a bounded docs extra and the Read the Docs Documentation project URL.
  • Add a pinned-environment CI documentation job running mkdocs build --strict.
  • Make image publishing depend on the documentation build.
  • Configure Read the Docs to use Python 3.12, install the docs extra, and fail on warnings.
pyproject.toml
.github/workflows/checks.yaml
.readthedocs.yaml
Refresh repository documentation content and links for the new site and current deployment workflow.
  • Convert chart documentation to absolute links and update the repository clone URL and Helm guidance.
  • Move middleware documentation into the consolidated middleware page.
  • Update README links and add Compose, Flower, shutdown, MTU, and upgrade guidance.
README.md
deployment/README.md
docs/getting-started.md
docs/middleware.md
docs/middlewares.md
docs/upgrading.md

Assessment against linked issues

Issue Objective Addressed Explanation
#209 Replace the scattered documentation with a MkDocs Material site containing the existing documentation and the requested configuration, API, access-control, operations, deployment, upgrade, development, reference, and changelog pages. ✅
#209 Configure strict documentation builds in CI and Read the Docs, and support versioned documentation builds for the latest version and tags. ✅
#209 Link the repository README to the new documentation site. ❌ The diff adds the site and a Documentation project URL, but does not update README.md to link to the site; its only README change is a configuration link.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Comment thread tests/test_docs_hooks.py Fixed
uniqueg and others added 2 commits October 22, 2026 21:27
No issuer-specific (LS Login) or network-specific wording in the
access control and configuration pages. The test of the chart README
compares host names instead of substrings (CodeQL).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	deployment/README.md
@uniqueg
uniqueg marked this pull request as ready for review October 22, 2026 19:32

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/access-control.md" line_range="20" />
<code_context>
+requests to the TES instance that the task is forwarded to: to create, track
+and cancel it. Credentials in the URLs of inputs and outputs
+(`https://user:password@host/...`) are removed before the task is forwarded,
+unless the TES instance is a [Funnel](https://ohsu-comp-bio.github.io/funnel/)
+instance.
</code_context>
<issue_to_address>
**Funnel fallback loses credentials**

When a non-Funnel endpoint rejects the task before a Funnel endpoint is tried, `create_task()` strips URL credentials from the shared `payload_marshalled` for a non-Funnel endpoint; if that endpoint rejects the task, a later Funnel endpoint receives the already-stripped URLs, so the forwarded task cannot access those inputs or outputs.

Strip credentials from a copy of the task for each non-Funnel attempt, leaving the original payload unchanged for later endpoints.
</issue_to_address>

### Comment 2
<location path="docs/hooks.py" line_range="105" />
<code_context>
+        return markdown
+    readme = Path(config.config_file_path).parent / README
+    # Set by Read the Docs to the commit of the build
+    ref = os.environ.get("READTHEDOCS_GIT_COMMIT_HASH") or "dev"
+    content = adapt_links(readme.read_text(encoding="utf-8"), config.repo_url, ref)
+    return "\n".join(
</code_context>
<issue_to_address>
**Versioned chart links point to dev**

When read the Docs builds a tagged version, read the Docs does not provide `READTHEDOCS_GIT_COMMIT_HASH`; it provides `READTHEDOCS_GIT_IDENTIFIER`. The hook therefore falls back to `dev` on tagged builds, so links from the deployment page to repository files do not match the version of the docs.

Read `READTHEDOCS_GIT_IDENTIFIER` for the build reference and test the hook using that variable.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: docs/access-control.md:20, docs/hooks.py:105


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread docs/access-control.md Resolved
Comment thread docs/hooks.py Resolved
@uniqueg
uniqueg merged commit 66bdafe into dev Oct 22, 2026
11 checks passed
@uniqueg
uniqueg deleted the docs/mkdocs-site branch October 22, 2026 19:39
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.

docs: switch to a MkDocs Material site

2 participants