set_versions.py: build with versions from releases.json
v2 cover set_versions.py: build with versions from releases.json
---
Changes in v2:
- add a python script to fetch and format the releases.json file
- instead of a make target, make it possible to use a different releases.json file using an environment variable
- Link to v1: https://patch.msgid.link/[email protected]
---
Antonin Godard (3):
tools/fetch-releases-json: add to fetch and format releases.json set_versions.py: build with versions from releases.json set_versions.py: make it possible to use a different releases.json file
documentation/README | 9 + documentation/releases.json | 623 ++++++++++++++++++++++++++++++++ documentation/set_versions.py | 100 +++-- documentation/tools/fetch-releases-json | 30 ++ 4 files changed, 723 insertions(+), 39 deletions(-)
---
base-commit: ff3cfb0ed3515fe42ef25f055e039ebdfe66dac0
change-id: 20260223-releases-json-93f5d84dd93a
PATCH v2 1/3 tools/fetch-releases-json: add to fetch and format releases.json
Add a simple script that can be used to fetch and format the releases.json file from https://dashboard.yoctoproject.org/releases.json.
--- documentation/README | 9 + documentation/releases.json | 623 ++++++++++++++++++++++++++++++++ documentation/tools/fetch-releases-json | 30 ++ 3 files changed, 662 insertions(+)
documentation/README +9 -0
@@ -109,6 +109,15 @@ dependencies in a virtual environment: $ pipenv install $ pipenv run make html +Updating the releases.json file +=============================== + +The Yocto Project documentation uses the documentation/releases.json to know +which releases are currently supported and which are obsolete. This file can be +updated using the the following command: + + $ ./documentation/tools/fetch-releases-json documentation/releases.json + Style checking the Yocto Project documentation ==============================================
documentation/releases.json new file +623 -0
623 lines not on this page · raw message
documentation/tools/fetch-releases-json new file +30 -0
@@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# +# Fetch the releases.json file from the remote endpoint and format it. +# Copyright Linux Foundation +# Author: Antonin Godard <[email protected]> +# +# SPDX-License-Identifier: MIT +# + +import argparse +import json + +from pathlib import Path +from urllib.request import urlopen + + +def main(): + + parser = argparse.ArgumentParser(description="Fetch and format releases.json") + parser.add_argument("output", type=Path, help="Output releases.json file") + args = parser.parse_args() + + with urlopen("https://dashboard.yoctoproject.org/releases.json") as req: + releases = json.load(req) + with open(args.output, "w") as f: + json.dump(releases, f, indent=2) + + +if __name__ == "__main__": + main()
Signature · 1 line
2.52.0
Re: [PATCH v2 1/3] tools/fetch-releases-json: add to fetch and format releases.json
On Thu Feb 26, 2026 at 3:00 PM CET, Antonin Godard wrote:
[...]
Quoted 24 lines
documentation/releases.json new file +18
-0@@ -0,0 +1,623 @@ +[ + { + "series_version": "6.0", + "original_release_date": "", + "latest_release_date": "", + "release_codename": "Wrynose", + "latest_tag": "", + "releases": [ + "6.0_M1" + ], + "status": "Active Development", + "download": "", + "series": "current" + }, + { + "series_version": "5.3", + "original_release_date": "2025-11-26T17:14:07+00:00", + "latest_release_date": "2026-01-09T15:00:43+00:00",
documentation/releases.json line 28
Quoted 10 lines
documentation/releases.json new file +10
-0+ "release_codename": "Whinlatter", + "latest_tag": "5.3.1", + "releases": [ + "5.3", + "5.3.1" + ], + "status": "Stable Release until May 2026", + "download": "https://downloads.yoctoproject.org/releases/yocto/yocto-5.3.1", + "release_notes": "https://downloads.yoctoproject.org/releases/yocto/yocto-5.3.1/RELEASENOTES", + "series": "previous"
Sorry, I sent a modified version of this file that I was using for local testing, and forgot to revert. I will fix this in the next iteration or when merging.
Antonin
Re: [docs] [PATCH v2 1/3] tools/fetch-releases-json: add to fetch and format releases.json
In reply to Antonin GodardHi Antonin,
Quoted 3 lines · Antonin Godard via lists.yoctoproject.org
Add a simple script that can be used to fetch and format the releases.json file from https://dashboard.yoctoproject.org/releases.json.
OK but why do we want this in the tree? It'll still be regularly outdated.
I understand not wanting to rely on a network connection, but we already need that for the bitbake's object.inv we download... so this ain't that much different.
Then, it's never outdated?
[...]
Quoted 23 lines
documentation/tools/fetch-releases-json new file +17
-0@@ -0,0 +1,30 @@ +#!/usr/bin/env python3 +# +# Fetch the releases.json file from the remote endpoint and format it. +# Copyright Linux Foundation +# Author: Antonin Godard <[email protected]> +# +# SPDX-License-Identifier: MIT +# + +import argparse +import json + +from pathlib import Path +from urllib.request import urlopen + + +def main():
documentation/tools/fetch-releases-json line 27
Quoted 10 lines
documentation/tools/fetch-releases-json new file +10
-0+ + parser = argparse.ArgumentParser(description="Fetch and format releases.json") + parser.add_argument("output", type=Path, help="Output releases.json file") + args = parser.parse_args() + + with urlopen("https://dashboard.yoctoproject.org/releases.json") as req: + releases = json.load(req) + with open(args.output, "w") as f: + json.dump(releases, f, indent=2) +
Why not updating https://git.yoctoproject.org/yocto-autobuilder-helper/tree/scripts/release-parser.py#n134 to store with the proper indent already?
json.dumps(data, indent=2)
Then you don't need each consumer to add the indent.
Or even better... why do you even care about a reviewable diff? The diff doesn't matter, it's the file itself that does.
b4 shazam the patch, run the script locally/download the file, check that your git tree is unchanged, merge the patch?
Or even betterer like I mentioned at the beginning of the mail, don't even version this file to begin with.
Cheers,
Quentin
Re: [docs] [PATCH v2 1/3] tools/fetch-releases-json: add to fetch and format releases.json
Hi,
Quoted 7 lines · Quentin Schulz via lists.yoctoproject.org
Hi Antonin,
Quoted 3 lines · Antonin Godard via lists.yoctoproject.org
Add a simple script that can be used to fetch and format the releases.json file from https://dashboard.yoctoproject.org/releases.json.
Quoted 5 lines
OK but why do we want this in the tree? It'll still be regularly outdated.
I understand not wanting to rely on a network connection, but we already need that for the bitbake's object.inv we download... so this ain't that much different.
You're right, I forgot about that inventory file :( made this change with an offline build in mind.
Fetching the file when building seems like a proper solution, although:
- IMO, we need to fallback on fixed values, even if they're outdated, to not block a documentation build if we can't fetch the releases.json file
- on the Autobuilder, we need to do the opposite: block a build if we can't fetch the releases.json file
- avoid fetching the file again if we already did (especially important on the Autobuilder as we don't want the file to be fetched for every tag + we don't want it to change during a build)
With this in mind, I'll work on a v3. Thanks for your insights!
Antonin
Re: [docs] [PATCH v2 1/3] tools/fetch-releases-json: add to fetch and format releases.json
Hi Antonin,
Quoted 16 lines · Antonin Godard
Hi,
Quoted 7 lines · Quentin Schulz via lists.yoctoproject.org
Hi Antonin,
Quoted 3 lines · Antonin Godard via lists.yoctoproject.org
Add a simple script that can be used to fetch and format the releases.json file from https://dashboard.yoctoproject.org/releases.json.
Quoted 5 lines
OK but why do we want this in the tree? It'll still be regularly outdated.
I understand not wanting to rely on a network connection, but we already need that for the bitbake's object.inv we download... so this ain't that much different.
Quoted 8 lines
You're right, I forgot about that inventory file :( made this change with an offline build in mind.
Fetching the file when building seems like a proper solution, although:
- IMO, we need to fallback on fixed values, even if they're outdated, to not block a documentation build if we can't fetch the releases.json file
Makes sense. I actually thought about this a few days ago and I was wondering if we shouldn't simply have a single version as fallback... The current one. There's no reason to show multiple versions in the switcher (and elsewhere?) when there's only one built locally?
So maybe still generate the file from git and not even attempt to download releases.json?
Quoted 7 lines
- on the Autobuilder, we need to do the opposite: block a build if we can't fetch the releases.json file
- avoid fetching the file again if we already did (especially important on the Autobuilder as we don't want the file to be fetched for every tag + we don't want it to change during a build)
Wondering if we can't simply handle releases.json downloading externally. I think we should still have whatever handles releases.json in the git repo(s) (but maybe not?) but we can simply put releases.json somewhere the script in the repo expects one to be present.
Essentially... if there's a releases.json available at location X, you use it, if not, then you use the fallback of the current version. The git repo wouldn't have a releases.json, only the autobuilder downloads it once before building all docs.
I guess the main issue is that we wouldn't know whether the current version is EoL if you don't download releases.json? Is it important? (thinking about people building the docs locally such that their colleagues only look at the documentation for the version they actually use).
What do you think?
Cheers,
Quentin
Re: [docs] [PATCH v2 1/3] tools/fetch-releases-json: add to fetch and format releases.json
Hi,
Quoted 28 lines · Quentin Schulz
Hi Antonin,
Quoted 16 lines · Antonin Godard
Hi,
Quoted 7 lines · Quentin Schulz via lists.yoctoproject.org
Hi Antonin,
Quoted 3 lines · Antonin Godard via lists.yoctoproject.org
Add a simple script that can be used to fetch and format the releases.json file from https://dashboard.yoctoproject.org/releases.json.
Quoted 5 lines
OK but why do we want this in the tree? It'll still be regularly outdated.
I understand not wanting to rely on a network connection, but we already need that for the bitbake's object.inv we download... so this ain't that much different.
Quoted 8 lines
You're right, I forgot about that inventory file :( made this change with an offline build in mind.
Fetching the file when building seems like a proper solution, although:
- IMO, we need to fallback on fixed values, even if they're outdated, to not block a documentation build if we can't fetch the releases.json file
Quoted 7 lines
Makes sense. I actually thought about this a few days ago and I was wondering if we shouldn't simply have a single version as fallback... The current one. There's no reason to show multiple versions in the switcher (and elsewhere?) when there's only one built locally?
So maybe still generate the file from git and not even attempt to download releases.json?
Actually, we can simply have some default values for the following variables:
activereleases = ["whinlatter", "scarthgap", "kirkstone"] devbranch = "wrynose"
ltsseries = ["wrynose", "scarthgap", "kirkstone"]
release_series = collections.OrderedDict({
"wrynose": "6.0",
"whinlatter": "5.3",
"scarthgap": "5.0",
"kirkstone": "4.0",
})And fallback on them when we don't find a releases.json file locally and we aren't able to fetch it remotely. This should happen rarely, but I've added a warning if that happens (working on it right now).
I'd rather keep the switchers version as it is, even in this case where we build locally and we only have one version to display. Just so it sort of matches what we're supposed to get from a releases.json file. I believe there are implications in how we compute the values in poky.yaml.in, which rely on this, so I'd rather not over-complicate it and provide default values in case we can't find a releases.json file, which should happen rarely anyway.
Quoted 18 lines
Quoted 7 lines
- on the Autobuilder, we need to do the opposite: block a build if we can't fetch the releases.json file
- avoid fetching the file again if we already did (especially important on the Autobuilder as we don't want the file to be fetched for every tag + we don't want it to change during a build)
Wondering if we can't simply handle releases.json downloading externally. I think we should still have whatever handles releases.json in the git repo(s) (but maybe not?) but we can simply put releases.json somewhere the script in the repo expects one to be present.
Essentially... if there's a releases.json available at location X, you use it, if not, then you use the fallback of the current version. The git repo wouldn't have a releases.json, only the autobuilder downloads it once before building all docs.
Quoted 5 lines
I guess the main issue is that we wouldn't know whether the current version is EoL if you don't download releases.json? Is it important? (thinking about people building the docs locally such that their colleagues only look at the documentation for the version they actually use).
Not sure I follow exactly, but I'm working on the Autobuilder part too which generates this releases.json on the fly and uses it for each docs build. I hope that will answer most of your questions here.
I think we still want to fetch the releases.json file in yocto-docs though, to give the user building locally an accurate version of what is hosted on docs.yoctoproject.org (and it doesn't cost much). And anyway, as you reminded, if a user cannot fetch the releases.json file from the remote location, they'll fallback on some possibly outdated active releases array (the default values above), but they'll also have a wall of errors due to lack of bitbake inventory.
Antonin
PATCH v2 2/3 set_versions.py: build with versions from releases.json
In reply to Antonin GodardBuild using the releases.json file obtained with ./documentation/tools/fetch-releases-json. This file needs to be updated each time a new release is out.
--- documentation/set_versions.py | 81 ++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 39 deletions(-)
documentation/set_versions.py +42 -39
@@ -11,57 +11,60 @@ # +import json import subprocess import collections import sys import os import itertools -# Order matters: most recent to least recent -activereleases = ["whinlatter", "scarthgap", "kirkstone"] -devbranch = "wrynose" -ltsseries = ["wrynose", "scarthgap", "kirkstone"] +from typing import Any, List, Dict, Tuple + +def get_releases(releases: Dict[str, Any]) -> Tuple[List[str], str, List[str], + collections.OrderedDict]: + """ + Go through a releases which is the opened releases.json file as + a dict, and return a tuple containing: + - the activereleases list: list of active release codenames + - the current dev branch + - the list of LTS releases (codenames) + - a dictionary mapping codename to point release series (e.g. "whinlatter": "5.3") + """ + + release_series = collections.OrderedDict() + activereleases = [] + devbranch = "" + ltsseries = [] + + for release in releases: + codename = release["release_codename"].lower() + release_series[codename] = release["series_version"] + if release["status"] == "Active Development": + devbranch = codename + if release["series"] == "current": + activereleases.append(codename) + if "LTS until" in release["status"]: + ltsseries.append(codename) + + activereleases.remove(devbranch) + + return activereleases, devbranch, ltsseries, release_series + +releases = {} + +with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "releases.json"), "r") as f: + releases = json.load(f) + +activereleases, devbranch, ltsseries, release_series = get_releases(releases) # used by run-docs-builds to get the default page if len(sys.argv) > 1 and sys.argv[1] == "getlatest": print(activereleases[0]) sys.exit(0) -release_series = collections.OrderedDict() -release_series["wrynose"] = "6.0" -release_series["whinlatter"] = "5.3" -release_series["walnascar"] = "5.2" -release_series["styhead"] = "5.1" -release_series["scarthgap"] = "5.0" -release_series["nanbield"] = "4.3" -release_series["mickledore"] = "4.2" -release_series["langdale"] = "4.1" -release_series["kirkstone"] = "4.0" -release_series["honister"] = "3.4" -release_series["hardknott"] = "3.3" -release_series["gatesgarth"] = "3.2" -release_series["dunfell"] = "3.1" -release_series["zeus"] = "3.0" -release_series["warrior"] = "2.7" -release_series["thud"] = "2.6" -release_series["sumo"] = "2.5" -release_series["rocko"] = "2.4" -release_series["pyro"] = "2.3" -release_series["morty"] = "2.2" -release_series["krogoth"] = "2.1" -release_series["jethro"] = "2.0" -release_series["jethro-pre"] = "1.9" -release_series["fido"] = "1.8" -release_series["dizzy"] = "1.7" -release_series["daisy"] = "1.6" -release_series["dora"] = "1.5" -release_series["dylan"] = "1.4" -release_series["danny"] = "1.3" -release_series["denzil"] = "1.2" -release_series["edison"] = "1.1" -release_series["bernard"] = "1.0" -release_series["laverne"] = "0.9" - +print(f"activereleases calculated to be {activereleases}") +print(f"devbranch calculated to be {devbranch}") +print(f"ltsseries calculated to be {ltsseries}") bitbake_mapping = { "wrynose" : "2.18",
Signature · 1 line
2.52.0
PATCH v2 3/3 set_versions.py: make it possible to use a different releases.json file
In reply to Antonin GodardMake it possible to use an external releases.json file through the EXTERNAL_RELEASES_JSON environment variable. This will be used on the Autobuilder to fetch the latest releases from
https://dashboard.yoctoproject.org/releases.json. Print a warning in case the external ones has a different list of active releases, and show how to update this file in the yocto-docs repository.
Having this done through an environment variable makes it much easier to make this apply to all builds of the documentation (even older tags).
--- documentation/set_versions.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
documentation/set_versions.py +19 -0
@@ -57,6 +57,25 @@ with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "releases.js activereleases, devbranch, ltsseries, release_series = get_releases(releases) +external_releases_json = os.getenv("EXTERNAL_RELEASES_JSON", None) +if external_releases_json is not None: + print(f"Using external {external_releases_json}") + with open(external_releases_json, "r") as f: + releases = json.load(f) + + activereleases_e, devbranch, ltsseries, release_series = get_releases(releases) + + if activereleases != activereleases_e: + print("WARNING: The external releases.json file has different active releases: " + f"local {activereleases} != external {activereleases_e}") + print("WARNING: Update of this file at" + " https://git.yoctoproject.org/yocto-docs/tree/documentation/releases.json" + " may be needed") + print("WARNING: Update using './documentation/tools/fetch-releases-json" + " documentation/releases.json' in yocto-docs") + + activereleases = activereleases_e + # used by run-docs-builds to get the default page if len(sys.argv) > 1 and sys.argv[1] == "getlatest": print(activereleases[0])
Signature · 1 line
2.52.0