From a11727beb64086ce1bbef4e0150168d9b0e331f2 Mon Sep 17 00:00:00 2001 From: James Reilly Date: Thu, 10 Sep 2026 10:23:52 +0530 Subject: [PATCH 1/5] fix(renovate): match the freedesktop-sdk series the junction actually tracks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit renovate.json filters freedesktop-sdk tags with "extractVersion": "^freedesktop-sdk-(?25\\.08\\.[0-9]+)$" while elements/freedesktop-sdk.bst has tracked 26.08 since the bump to freedesktop-sdk-26.08.0-0-gdb97cce: track: freedesktop-sdk-26.08* ref: freedesktop-sdk-26.08.0-0-gdb97cce32cecadc7a3e98f06d557ebfa6ba9ad46 No tag upstream publishes can match that rule any more, so Renovate reports no updates rather than an error. The junction silently stops receiving bumps and the track-refs job in build.yml never has a ref to resolve. Nothing in any log says so — the failure looks exactly like "already up to date". Bumps the rule to 26.08, and adds check-renovate-series.py so the pair cannot drift apart again: it reads the series out of each junction's `track:` glob and asserts the matching extractVersion is anchored to the same one, failing closed. Same shape as check-release-version.py and check-k0s-version.py — wired into .pre-commit-config.yaml, and unit-tests.yml now also fires on renovate.json and elements/*.bst so the guard runs when either side moves. tests/unit/test_check_renovate_series.py covers the passing case, the exact regression above, a junction with no packageRule, a junction with no `track:`, the two series helpers, and the checked-in tree itself. $ python3 -m pytest tests/unit -q 207 passed, 1 xfailed in 0.64s Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01VwEniffvKGH7gHfqKneuaJ --- .github/scripts/check-renovate-series.py | 125 +++++++++++++++++++++ .github/workflows/unit-tests.yml | 4 + .pre-commit-config.yaml | 6 ++ renovate.json | 2 +- tests/unit/test_check_renovate_series.py | 132 +++++++++++++++++++++++ 5 files changed, 268 insertions(+), 1 deletion(-) create mode 100755 .github/scripts/check-renovate-series.py create mode 100644 tests/unit/test_check_renovate_series.py diff --git a/.github/scripts/check-renovate-series.py b/.github/scripts/check-renovate-series.py new file mode 100755 index 00000000..016f5014 --- /dev/null +++ b/.github/scripts/check-renovate-series.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 +"""Keep Renovate's version filters on the same release series as the junctions. + +`elements/*.bst` pin a junction with a `track:` glob and a resolved `ref:`: + + track: freedesktop-sdk-26.08* + ref: freedesktop-sdk-26.08.0-0-gdb97cce... + +`renovate.json` decides which upstream tags are candidates for a bump with a +per-package `extractVersion` anchored to that same series: + + "extractVersion": "^freedesktop-sdk-(?26\\.08\\.[0-9]+)$" + +Nothing ties the two together. When a junction moves to a new series and the +Renovate rule does not, the rule stops matching every tag upstream publishes. +Renovate then reports no updates rather than an error, so the junction quietly +stops receiving bumps and the `track-refs` job in build.yml has nothing to +resolve. That is not hypothetical: the freedesktop-sdk rule still read +`25\\.08\\.` after the junction moved to `freedesktop-sdk-26.08.0`. + +This script fails closed on that drift. It reads the series out of each +junction's `track:` glob and asserts the matching `extractVersion` in +renovate.json is anchored to the same one. +""" + +import json +import re +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +RENOVATE_JSON = ROOT / "renovate.json" + +# depName in renovate.json -> the junction whose `track:` is authoritative. +JUNCTIONS = { + "https://gitlab.com/freedesktop-sdk/freedesktop-sdk.git": ( + ROOT / "elements" / "freedesktop-sdk.bst" + ), + "https://gitlab.gnome.org/GNOME/gnome-build-meta.git": ( + ROOT / "elements" / "gnome-build-meta.bst" + ), +} + +TRACK_RE = re.compile(r"^\s*track:\s*[\"']?([^\"'\s]+)[\"']?\s*$", re.MULTILINE) + + +def read(path): + if not path.is_file(): + sys.exit(f"ERROR: expected file not found: {path.relative_to(ROOT)}") + return path.read_text(encoding="utf-8") + + +def series_of(track): + """The literal prefix of a track glob, with the trailing '*' removed. + + `freedesktop-sdk-26.08*` -> `freedesktop-sdk-26.08` + `gnome-50` -> `gnome-50` (no glob; the whole value) + """ + return track.split("*", 1)[0] + + +def digits(text): + """Version-ish digit groups, so an escaped regex and a plain glob compare. + + `^freedesktop-sdk-(?26\\.08\\.[0-9]+)$` -> ['26', '08'] + `freedesktop-sdk-26.08` -> ['26', '08'] + `[0-9]+` is dropped: it is the part Renovate fills in, not a series digit. + """ + stripped = text.replace("\\.", ".").replace("[0-9]+", "") + return [g for g in re.findall(r"\d+", stripped)] + + +def main(): + config = json.loads(read(RENOVATE_JSON)) + rules = config.get("packageRules", []) + failures = [] + checked = 0 + + for dep_name, junction_path in JUNCTIONS.items(): + matching = [ + rule + for rule in rules + if dep_name in rule.get("matchPackageNames", []) + and "extractVersion" in rule + ] + if not matching: + failures.append( + f"renovate.json has no packageRule with an extractVersion for " + f"{dep_name}; {junction_path.relative_to(ROOT)} would never be bumped" + ) + continue + + track_match = TRACK_RE.search(read(junction_path)) + if not track_match: + failures.append( + f"{junction_path.relative_to(ROOT)} declares no `track:`; " + "cannot verify the Renovate series against it" + ) + continue + + series = series_of(track_match.group(1)) + want = digits(series) + + for rule in matching: + checked += 1 + got = digits(rule["extractVersion"]) + if got != want: + failures.append( + f"{junction_path.relative_to(ROOT)} tracks `{track_match.group(1)}` " + f"(series {'.'.join(want) or ''}) but renovate.json filters " + f"{dep_name} with extractVersion {rule['extractVersion']!r} " + f"(series {'.'.join(got) or ''}). Renovate matches no tag, " + "so this junction gets no update PRs." + ) + + if failures: + for failure in failures: + print(f"ERROR: {failure}", file=sys.stderr) + sys.exit(1) + + print(f"OK: {checked} Renovate version filter(s) match their junction `track:` series") + + +if __name__ == "__main__": + main() diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index fc4485d7..d94d5999 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -8,6 +8,8 @@ on: - 'files/**' - 'tests/unit/**' - 'Justfile' + - 'renovate.json' + - 'elements/*.bst' push: branches: [main] paths: @@ -16,6 +18,8 @@ on: - 'files/**' - 'tests/unit/**' - 'Justfile' + - 'renovate.json' + - 'elements/*.bst' permissions: contents: read diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 95cf3104..0a9f61ab 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,6 +18,12 @@ repos: language: system pass_filenames: false files: ^(project\.conf|elements/freedesktop-sdk\.bst|\.github/scripts/check-release-version\.py)$ + - id: check-renovate-series + name: Renovate version filters match the junction track series + entry: python .github/scripts/check-renovate-series.py + language: system + pass_filenames: false + files: ^(renovate\.json|elements/(freedesktop-sdk|gnome-build-meta)\.bst|\.github/scripts/check-renovate-series\.py)$ - id: check-k0s-version name: k0s version derived from include/k0s.yml, not restated entry: python .github/scripts/check-k0s-version.py diff --git a/renovate.json b/renovate.json index 45e9cdfe..953e0c0f 100644 --- a/renovate.json +++ b/renovate.json @@ -18,7 +18,7 @@ { "matchDatasources": ["git-refs"], "matchPackageNames": ["https://gitlab.com/freedesktop-sdk/freedesktop-sdk.git"], - "extractVersion": "^freedesktop-sdk-(?25\\.08\\.[0-9]+)$", + "extractVersion": "^freedesktop-sdk-(?26\\.08\\.[0-9]+)$", "versioning": "semver" }, { diff --git a/tests/unit/test_check_renovate_series.py b/tests/unit/test_check_renovate_series.py new file mode 100644 index 00000000..afda45e9 --- /dev/null +++ b/tests/unit/test_check_renovate_series.py @@ -0,0 +1,132 @@ +"""Unit coverage for .github/scripts/check-renovate-series.py. + +The script guards a silent failure: when a junction moves to a new release +series and renovate.json's extractVersion does not, Renovate matches no tag +and simply reports no updates. The junction then stops receiving bumps with +nothing in any log to say so. +""" + +import importlib.util +import json +import subprocess +import sys +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[2] +SCRIPT = ROOT / ".github" / "scripts" / "check-renovate-series.py" + +# The script's filename is not a valid module name, so load it by path — +# same approach as tests/unit/test_check_k0s_version.py. +_spec = importlib.util.spec_from_file_location("check_renovate_series", SCRIPT) +check_renovate_series = importlib.util.module_from_spec(_spec) +_spec.loader.exec_module(check_renovate_series) + + +def run_against(tmp_path, renovate, junctions): + """Run the script with ROOT redirected at a throwaway tree.""" + (tmp_path / ".github" / "scripts").mkdir(parents=True) + (tmp_path / "elements").mkdir() + (tmp_path / "renovate.json").write_text(json.dumps(renovate)) + for name, body in junctions.items(): + (tmp_path / "elements" / name).write_text(body) + script_copy = tmp_path / ".github" / "scripts" / SCRIPT.name + script_copy.write_text(SCRIPT.read_text()) + return subprocess.run( + [sys.executable, str(script_copy)], capture_output=True, text=True + ) + + +FSDK = "https://gitlab.com/freedesktop-sdk/freedesktop-sdk.git" +GBM = "https://gitlab.gnome.org/GNOME/gnome-build-meta.git" + + +def rule(dep, extract): + return { + "matchDatasources": ["git-refs"], + "matchPackageNames": [dep], + "extractVersion": extract, + "versioning": "semver", + } + + +def junction(track): + return f"kind: junction\n\nsources:\n- kind: git_repo\n track: {track}\n ref: x\n" + + +BOTH_JUNCTIONS = { + "freedesktop-sdk.bst": junction("freedesktop-sdk-26.08*"), + "gnome-build-meta.bst": junction("gnome-50"), +} + + +def test_passes_when_series_agree(tmp_path): + result = run_against( + tmp_path, + { + "packageRules": [ + rule(FSDK, r"^freedesktop-sdk-(?26\.08\.[0-9]+)$"), + rule(GBM, r"^(?50\.[0-9]+)$"), + ] + }, + BOTH_JUNCTIONS, + ) + assert result.returncode == 0, result.stderr + assert "OK: 2" in result.stdout + + +def test_fails_on_the_real_regression(tmp_path): + """The shipped bug: junction on 26.08, Renovate still filtering 25.08.""" + result = run_against( + tmp_path, + { + "packageRules": [ + rule(FSDK, r"^freedesktop-sdk-(?25\.08\.[0-9]+)$"), + rule(GBM, r"^(?50\.[0-9]+)$"), + ] + }, + BOTH_JUNCTIONS, + ) + assert result.returncode == 1 + assert "matches no tag" in result.stderr + assert "freedesktop-sdk.bst" in result.stderr + + +def test_fails_when_a_junction_has_no_rule(tmp_path): + result = run_against( + tmp_path, + {"packageRules": [rule(GBM, r"^(?50\.[0-9]+)$")]}, + BOTH_JUNCTIONS, + ) + assert result.returncode == 1 + assert "no packageRule" in result.stderr + + +def test_fails_when_the_junction_declares_no_track(tmp_path): + result = run_against( + tmp_path, + { + "packageRules": [ + rule(FSDK, r"^freedesktop-sdk-(?26\.08\.[0-9]+)$"), + rule(GBM, r"^(?50\.[0-9]+)$"), + ] + }, + { + "freedesktop-sdk.bst": "kind: junction\n\nsources:\n- kind: git_repo\n ref: x\n", + "gnome-build-meta.bst": junction("gnome-50"), + }, + ) + assert result.returncode == 1 + assert "declares no `track:`" in result.stderr + + +def test_series_helpers_ignore_the_renovate_placeholder(): + assert check_renovate_series.series_of("freedesktop-sdk-26.08*") == "freedesktop-sdk-26.08" + assert check_renovate_series.series_of("gnome-50") == "gnome-50" + assert check_renovate_series.digits(r"^freedesktop-sdk-(?26\.08\.[0-9]+)$") == ["26", "08"] + assert check_renovate_series.digits("freedesktop-sdk-26.08") == ["26", "08"] + + +def test_the_real_repo_is_consistent(): + """Runs the script against the checked-in tree, so drift fails CI.""" + result = subprocess.run([sys.executable, str(SCRIPT)], capture_output=True, text=True) + assert result.returncode == 0, result.stderr From 312e11d0a2c79d145abd5aa7375abbfb9678669d Mon Sep 17 00:00:00 2001 From: Jorge Castro Date: Fri, 18 Sep 2026 13:10:04 -0400 Subject: [PATCH 2/5] ci(just): run the renovate series guard in validate `check-renovate-series.py` was wired into pre-commit and the unit suite but not into `just validate`, unlike its siblings `check-release-version.py` and `check-k0s-version.py`. Since AGENTS.md and docs/skills/ci-tooling.md point contributors at `just validate` as the merge-contract check, the new invariant was effectively unenforced there. Assisted-by: Claude Opus 4.6 via GitHub Copilot Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- Justfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Justfile b/Justfile index f2dc1b23..1bae6d3f 100644 --- a/Justfile +++ b/Justfile @@ -55,6 +55,7 @@ tags: validate: python3 .github/scripts/check-release-version.py python3 .github/scripts/check-k0s-version.py + python3 .github/scripts/check-renovate-series.py just bst show --deps all oci/bluefin-server-ddi.bst just bst show --deps all oci/bluefin-server-installer.bst just bst show --deps all oci/k0s-sysext.bst From 45ca29e266742da3b8e10ab8069f041355131e45 Mon Sep 17 00:00:00 2001 From: mrbobbytables Date: Sat, 19 Sep 2026 14:13:25 +0000 Subject: [PATCH 3/5] ci: expand unit-tests workflow paths trigger Trigger unit tests on changes to elements/**, include/**, project.conf, .pre-commit-config.yaml, and .github/workflows/build.yml, which are read and asserted by the unit test suite. Fixes #187 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables --- .github/workflows/unit-tests.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index fc4485d7..7012df6b 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -4,16 +4,26 @@ on: pull_request: paths: - '.github/scripts/**' + - '.github/workflows/build.yml' - '.github/workflows/unit-tests.yml' + - '.pre-commit-config.yaml' + - 'elements/**' - 'files/**' + - 'include/**' + - 'project.conf' - 'tests/unit/**' - 'Justfile' push: branches: [main] paths: - '.github/scripts/**' + - '.github/workflows/build.yml' - '.github/workflows/unit-tests.yml' + - '.pre-commit-config.yaml' + - 'elements/**' - 'files/**' + - 'include/**' + - 'project.conf' - 'tests/unit/**' - 'Justfile' From a13e40a9237496b4d08fbb06ff6fa8058524e7da Mon Sep 17 00:00:00 2001 From: hive-agent Date: Sat, 19 Sep 2026 14:16:52 +0000 Subject: [PATCH 4/5] fix(ci): pin just tool version in CI workflows taiki-e/install-action resolves just@latest at run time when no version is supplied, so the build tool that drives every job (just validate, just test-unit, DDI/kernel export recipes) was unpinned while every GitHub Action in the repo is SHA-pinned. Pin just to 1.58.0, the version CI already installs, so this changes no runtime behavior. Signed-off-by: hive-agent --- .github/workflows/build.yml | 4 ++-- .github/workflows/kernel.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf99f8ea..ed4cba99 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,7 +39,7 @@ jobs: - name: Set up just uses: taiki-e/install-action@7b8d4719ee4aaa279bdf55df38dacb9ebfe12a6c # v2 with: - tool: just + tool: just@1.58.0 - name: Track and Resolve BuildStream Refs env: @@ -77,7 +77,7 @@ jobs: - name: Set up just uses: taiki-e/install-action@7b8d4719ee4aaa279bdf55df38dacb9ebfe12a6c # v2 with: - tool: just + tool: just@1.58.0 - name: Validate Element Graph run: just validate diff --git a/.github/workflows/kernel.yml b/.github/workflows/kernel.yml index 6d420e86..3d1cf6e4 100644 --- a/.github/workflows/kernel.yml +++ b/.github/workflows/kernel.yml @@ -39,7 +39,7 @@ jobs: - name: Set up just uses: taiki-e/install-action@7b8d4719ee4aaa279bdf55df38dacb9ebfe12a6c # v2 with: - tool: just + tool: just@1.58.0 - name: Validate Element Graph run: just validate diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index fc4485d7..32bbcba1 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -41,7 +41,7 @@ jobs: - name: Set up just uses: taiki-e/install-action@7b8d4719ee4aaa279bdf55df38dacb9ebfe12a6c # v2 with: - tool: just + tool: just@1.58.0 - name: Run unit tests run: just test-unit From 668ffd1a7b68f7aaedd8e87b1a7fe7f57c280ab6 Mon Sep 17 00:00:00 2001 From: ci-maintainer Date: Sat, 19 Sep 2026 20:18:10 -0400 Subject: [PATCH 5/5] docs(ci-tooling): pin the tool version in the canonical just snippet The skill doc's install snippet still showed an unpinned 'tool: just', which is the form issue #188 removed from the workflows. A workflow copied from the doc would have reintroduced it, undoing this PR on the next new job. Update the snippet to 'tool: just@1.58.0', matching all four call sites, and explain that without a version install-action resolves just@latest at run time. Note that the version is repeated per call site so a bump has to change all of them in one commit. Add the half-done pin to Red Flags, add a checklist item for it under Verification, and record the 'tool: just always installs a working version' rationalization. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/skills/ci-tooling.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/skills/ci-tooling.md b/docs/skills/ci-tooling.md index e236f99f..0ef33331 100644 --- a/docs/skills/ci-tooling.md +++ b/docs/skills/ci-tooling.md @@ -42,12 +42,21 @@ before adding an action. ### Installing `just` — taiki-e/install-action, not snap/cargo/apt +Pin the tool version too, not only the action SHA. Without `@`, +`install-action` resolves `just@latest` at run time, so the CI contract +(`just validate`, `just test-unit`, the DDI/kernel export recipes) runs against +a binary chosen by an upstream release rather than by a commit in this repo. + ```yaml - uses: taiki-e/install-action@b6b84cf49ebfe0176417bdce007c624f0db37f20 # v2 with: - tool: just + tool: just@1.58.0 ``` +The version is repeated at each call site — currently `build.yml` (two jobs), +`kernel.yml` and `unit-tests.yml`. Bumping `just` means changing all of them in +one commit, so CI never runs two versions at once. + ### Workflow permissions `.github/workflows/build.yml` defaults to a read-only token: @@ -130,10 +139,13 @@ uploaded to a GitHub Release tagged `installer-v`. |---|---| | "It's just a minor version tag, supply-chain risk is low." | One compromised tag push owns every repo using it. Pin to SHA. | | "I'll check what SHA other repos use later." | Check now — it's one `gh api` call and takes a few seconds. | +| "`tool: just` always installs a working version." | It installs whatever is latest that day. A `just` release can change recipe parsing or `--fmt` output and break CI with no commit in this repo. | ## Red Flags - Any `uses:` line with a mutable ref (`@v2`, `@main`, `@latest`). +- An `install-action` step whose `tool:` has no `@` — the pin is half + done, since the action is fixed but the binary it installs is not. - `sudo podman` in one step and plain `podman` in another step doing the same operation. - A new action not present in any sibling repo — check upstream first. @@ -141,6 +153,7 @@ uploaded to a GitHub Release tagged `installer-v`. ## Verification - [ ] Every `uses:` line has a full 40-character SHA and a `# vX` comment. +- [ ] Every `install-action` `tool:` names an explicit version (`just@1.58.0`). - [ ] `just validate` passes after workflow changes. - [ ] No new mutable action refs introduced. - [ ] The release signing step uploads detached `.gpg` signatures for every