Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 8a66e9b

Browse files
committed
Use latest compatible chart version in doc
(cherry picked from commit 0f2090b)
1 parent ee0b3f8 commit 8a66e9b

2 files changed

Lines changed: 23 additions & 10 deletions

File tree

docs/source/conf.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,18 @@
66
# -- Project information -----------------------------------------------------
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
88

9+
import asyncio
910
import os
1011
import sys
1112

12-
import requests
13+
from jumpstarter_cli_admin.controller import get_latest_compatible_controller_version
1314

1415
sys.path.insert(0, os.path.abspath("../.."))
1516

1617
project = "jumpstarter"
1718
copyright = "2025, Jumpstarter Contributors"
1819
author = "Jumpstarter Contributors"
1920

20-
controller_version = requests.get(
21-
"https://quay.io/api/v1/repository/jumpstarter-dev/helm/jumpstarter/tag/", params={"limit": 1}
22-
).json()["tags"][0]["name"]
23-
2421
# -- General configuration ---------------------------------------------------
2522
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2623

@@ -54,14 +51,27 @@
5451
html_favicon = "_static/img/favicon.png"
5552
html_show_sphinx = False
5653

54+
55+
def get_controller_version():
56+
name = os.getenv("SPHINX_MULTIVERSION_NAME")
57+
if name == "main" or name is None:
58+
version = None
59+
elif name.startswith("release-"):
60+
version = name.removeprefix("release-")
61+
else:
62+
version = None
63+
64+
return asyncio.run(get_latest_compatible_controller_version(client_version=version))
65+
66+
5767
myst_heading_anchors = 3
5868
myst_enable_extensions = [
5969
"substitution",
6070
]
6171
myst_substitutions = {
6272
"requires_python": ">=3.11",
6373
"version": "latest",
64-
"controller_version": controller_version,
74+
"controller_version": get_controller_version(),
6575
}
6676

6777
doctest_test_doctest_blocks = ""
@@ -91,10 +101,11 @@
91101
# This replaces the custom bash script approach with built-in functionality
92102

93103
# Tags pattern for html_context["versions"]
94-
smv_tag_whitelist = r"^v(0\.[5-9](\.\d+)|0\.[1-9][0-9]+(\.\d+)|[1-9]\d*\.\d+\.\d+)$" # Starting from v0.5.0
95-
smv_branch_whitelist = r"^(main|master)$" # Only include main/master branch
96-
smv_remote_whitelist = None
97-
smv_released_pattern = r"^v[0-9]+\.[0-9]+\.[0-9]+$" # Tags that are considered releases
104+
smv_tag_whitelist = r"$^" # Ignore all tags
105+
smv_branch_whitelist = r"^(main|release-\d+\.\d+)$" # Include all release branches and main
106+
smv_remote_whitelist = r'^(origin|upstream)$' # Include branches from origin and upstream
107+
smv_prefer_remote_refs = True
108+
# smv_released_pattern = r"^v[0-9]+\.[0-9]+\.[0-9]+$" # Tags that are considered releases
98109
smv_outputdir_format = "{ref.name}" # Directory name format
99110

100111
# Ensure static files are copied to all versions

packages/jumpstarter-cli-admin/jumpstarter_cli_admin/controller.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ async def get_latest_compatible_controller_version(
1010
):
1111
if client_version is None:
1212
client_version = Version(get_client_version())
13+
else:
14+
client_version = Version(client_version)
1315

1416
async with aiohttp.ClientSession(
1517
raise_for_status=True,

0 commit comments

Comments
 (0)