Skip to content

docs: Source the advertised API version from client.config.API_VERSION#11787

Open
rapsealk wants to merge 9 commits into
mainfrom
docs/update-api-version-substitution
Open

docs: Source the advertised API version from client.config.API_VERSION#11787
rapsealk wants to merge 9 commits into
mainfrom
docs/update-api-version-substitution

Conversation

@rapsealk

@rapsealk rapsealk commented May 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Wire ai.backend.client.config.API_VERSION into docs/conf.py as the Sphinx
    substitution |api_version| so the rendered API version stays in sync with
    the client's source of truth.
  • Replace the hard-coded v6.20220615 string in docs/index.rst with
    |api_version|.
  • Switch the install guide's sample curl block from code-block:: console
    to parsed-literal:: so |api_version| and |release| expand inside it.
  • Refresh the Korean .po entry to track the new placeholder-based msgid
    (drop stale #, fuzzy).

Resolves #11786.

Test plan

  • make html in docs/ renders v9.20250722 on the homepage and inside
    the curl bai-m1:8081 example.
  • No grep -rn "v6\.20220615" docs/ hits remain.
  • Korean .po msgid for the homepage version line contains |api_version|
    (not a literal version string).

🤖 Generated with Claude Code


📚 Documentation preview 📚: https://sorna--11787.org.readthedocs.build/en/11787/


📚 Documentation preview 📚: https://sorna-ko--11787.org.readthedocs.build/ko/11787/

The homepage and install guide still advertised v6.20220615 as the
latest API version, ~4 years out of date. Rather than hand-edit the
strings on every release, source the value from
`ai.backend.client.config.API_VERSION` and expose it as the Sphinx
substitution `|api_version|` so the rendered docs stay in sync with the
client's source of truth.

The install guide's sample `curl` output now uses `parsed-literal::`
instead of `code-block:: console` so both `|api_version|` and the
existing `|release|` substitutions expand inside the block.

Refs #11786.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 26, 2026 08:28
@rapsealk rapsealk requested a review from a team as a code owner May 26, 2026 08:28
@github-actions github-actions Bot added the size:S 10~30 LoC label May 26, 2026
@github-actions github-actions Bot added the area:docs Documentations label May 26, 2026
11786.doc.md -> 11787.doc.md

Co-authored-by: octodog <mu001@lablup.com>

Copilot AI 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.

Pull request overview

This PR updates the documentation to avoid hard-coding the “Latest API version” string by sourcing it directly from the Python client’s ai.backend.client.config.API_VERSION, ensuring the rendered docs stay in sync with the codebase over time.

Changes:

  • Add a Sphinx |api_version| substitution in docs/conf.py, derived from ai.backend.client.config.API_VERSION.
  • Replace hard-coded API version strings in the docs with |api_version|, including in a command output sample (via parsed-literal to allow substitutions).
  • Update the Korean translation catalog entry to match the new placeholder-based source string.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
docs/conf.py Imports API_VERSION and defines rst_prolog substitution `
docs/index.rst Replaces hard-coded latest API version with `
docs/install/install-from-package/install-manager.rst Switches the curl example to parsed-literal and substitutes `
docs/locales/ko/LC_MESSAGES/index.po Updates the msgid/msgstr for the homepage API version line to use `
changes/11786.doc.md Adds a changelog fragment describing the documentation change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Importing `ai.backend.client.config` from `docs/conf.py` transitively
imports `ai.backend.client.session`, which requires `aiohttp` — not
installed in the docs build environment. Read the `API_VERSION` literal
out of `client/config.py` with `ast.parse` instead so the docs build no
longer depends on the client runtime.

Verified locally: `make clean html` succeeds and the homepage renders
"Latest API version: v9.20250722"; the install-manager curl example
renders the version and `|release|` substitutions inside the parsed
literal block.

Refs #11786.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added size:M 30~100 LoC and removed size:S 10~30 LoC labels May 26, 2026
@rapsealk rapsealk requested a review from Copilot May 26, 2026 08:49

Copilot AI 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.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

… add config back-pointer

- `docs/install/install-from-package/install-manager.rst`: revert the
  switch to `parsed-literal::` and keep `code-block:: console` for the
  sample `curl` output. The substitution-based block lost the
  `console` lexer's prompt styling, leaving the page inconsistent with
  its sibling blocks. The version inside this one block is now
  hand-maintained again, but the prominent homepage advert (the more
  visible stale spot) still uses `|api_version|`.
- `docs/conf.py`: move `import ast` to the top-level imports block.
- `src/ai/backend/client/config.py`: add a comment next to `API_VERSION`
  pointing at `docs/conf.py:_read_api_version()` so future refactors of
  the constant surface the docs coupling.

Refs #11786.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the comp:client Related to Client component label May 26, 2026
@rapsealk rapsealk changed the title docs: Update advertised API version from v6.20220615 to v9.20250722 docs: Source the advertised API version from client.config.API_VERSION May 26, 2026
@rapsealk rapsealk changed the title docs: Source the advertised API version from client.config.API_VERSION docs: Source the advertised API version from client.config.API_VERSION May 26, 2026

Copilot AI 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.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread docs/install/install-from-package/install-manager.rst
Comment thread docs/conf.py Outdated
rapsealk and others added 2 commits May 27, 2026 11:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@rapsealk rapsealk requested a review from HyeockJinKim May 27, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentations comp:client Related to Client component size:M 30~100 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update advertised API version from v6.20220615 to v9.20250722

2 participants