Skip to content

The agent that grows with you

fix(release): treat any missing stable baseline as no upgrade arm

ethernet25a096f317f7
diff --git a/.github/workflows/stable-release.yml b/.github/workflows/stable-release.yml
index 13ed2158a11..b7e6a8ac8c4 100644
--- a/.github/workflows/stable-release.yml
+++ b/.github/workflows/stable-release.yml
@@ -415,7 +415,7 @@ jobs:
windows-packaged:
name: Windows signed-package acceptance
needs: transitions-win32
- # The first bundle release has no OLD package to upgrade from.
+ # Without a published stable baseline there is no OLD package to upgrade from.
if: needs.transitions-win32.outputs.baseline != 'none'
strategy:
fail-fast: false
@@ -433,7 +433,7 @@ jobs:
macos-packaged-arm64:
name: macOS arm64 signed-package acceptance
needs: transitions-darwin-arm64
- # The first bundle release has no OLD package to upgrade from.
+ # Without a published stable baseline there is no OLD package to upgrade from.
if: needs.transitions-darwin-arm64.outputs.baseline != 'none'
strategy:
fail-fast: false
@@ -451,7 +451,7 @@ jobs:
macos-packaged-x64:
name: macOS x64 signed-package acceptance
needs: transitions-darwin-x64
- # The first bundle release has no OLD package to upgrade from.
+ # Without a published stable baseline there is no OLD package to upgrade from.
if: needs.transitions-darwin-x64.outputs.baseline != 'none'
strategy:
fail-fast: false
diff --git a/scripts/releases/stable.py b/scripts/releases/stable.py
index b9433235ef2..b5c34687eb3 100644
--- a/scripts/releases/stable.py
+++ b/scripts/releases/stable.py
@@ -102,8 +102,8 @@ def require_gate(needs: dict, required: list[str], *, skip_bundles: bool, skip_t
raise ValueError("Invalid required-job list")
expected = gate_expectations(required, skip_bundles=skip_bundles, skip_tests=skip_tests)
for packaged, planner in PACKAGED_BY.items():
- # The first bundle release has no OLD package, so its planner skips the
- # upgrade arm. Only that planner's own successful output can excuse it.
+ # Without a published baseline there is no OLD package, so the planner
+ # skips the upgrade arm. Only that planner's own successful output can excuse it.
planned = needs.get(planner, {})
if (expected.get(packaged) == "success" and planned.get("result") == "success"
and (planned.get("outputs") or {}).get("baseline") == "none"):
@@ -653,35 +653,20 @@ def _stage_transition(env: dict, archive: str, base: str, row: dict) -> dict:
"manifest_sha256": hashlib.sha256(file.read_bytes()).hexdigest()}
-def _bundle_release_shipped() -> bool:
- """True when any final stable tag records a published candidate manifest.
+def _published_baseline(env: dict, base: str) -> dict | None:
+ """The previous stable package manifest, or None when no stable release shipped one.
- Publication writes the stable baseline pointer for exactly these releases.
- Tags from before the claim pipeline carry prose, not a record, and shipped
- no signed packages this pipeline can upgrade from.
+ A release that skipped bundles never writes the pointer, so its absence
+ only means there is no OLD package to upgrade from.
"""
- for tag in output(["git", "tag", "-l", "v*"]).split():
- if not STABLE_TAG_RE.fullmatch(tag):
- continue
- try:
- record = tag_record(output(["git", "tag", "-l", tag, "--format=%(contents)"]))
- except json.JSONDecodeError:
- continue
- if isinstance(record, dict) and record.get("candidateManifestSha256") is not None:
- return True
- return False
-
-
-def _published_baseline(env: dict, base: str) -> dict | None:
- """The previous stable package manifest, or None for the first bundle release."""
try:
previous = read_manifest(env.get("BASELINE_MANIFEST_URL") or f"{base}/releases/stable/release-candidates.json",
expected_origin=base)
except urllib.error.HTTPError as error:
if error.code != 404:
raise
- if env.get("BASELINE_MANIFEST_URL") or _bundle_release_shipped():
- raise ValueError("No published stable package baseline. Supply baseline-manifest for an actual previous stable release; acceptance cannot be skipped.") from error
+ if env.get("BASELINE_MANIFEST_URL"):
+ raise ValueError("The supplied baseline-manifest does not exist") from error
return None
published = json.loads(output(["gh", "release", "view", previous["tag"], "--repo", env["GITHUB_REPOSITORY"], "--json", "tagName,isDraft,isPrerelease"]))
if published["tagName"] != previous["tag"] or published["isDraft"] or published["isPrerelease"]:
@@ -714,7 +699,7 @@ def transitions(env: dict) -> None:
matrices = {"windows": {"include": []}, "macos": {"include": []}}
if previous is None:
# Native smokes still gate this release. Its packages become the
- # baseline that the next release must upgrade from.
+ # baseline that the next bundle release must upgrade from.
validate_receipt(receipt_manifest, receipt, receipt_manifest.get("tag"),
receipt_manifest.get("commit"), base, archive=receipt_manifest.get("archive"))
emit({**matrices, "baseline": "none"}, env)
diff --git a/tests/scripts/test_stable_release.py b/tests/scripts/test_stable_release.py
index e437d111f07..9a8083e8b9f 100644
--- a/tests/scripts/test_stable_release.py
+++ b/tests/scripts/test_stable_release.py
@@ -937,31 +937,24 @@ def test_transitions_from_the_bundle_receipt_emit_two_windows_rows(tmp_path, r2_
assert macos["include"] == []
-def test_first_bundle_release_plans_no_upgrade_arm_until_a_bundle_release_shipped(
+def test_missing_baseline_plans_no_upgrade_arm_but_a_missing_supplied_one_blocks(
tmp_path, r2_server, https_origin, monkeypatch):
from scripts.releases import stable
url, digest = _staged_receipt(tmp_path, r2_server, https_origin, monkeypatch, "darwin-arm64")
env = {**_transitions_env(tmp_path, https_origin.base, "darwin-arm64", url, digest),
"BASELINE_MANIFEST_URL": ""}
- # The latest final tag skipped bundles; an older tag predates the claim pipeline.
- tags = {"v1.2.2": json.dumps({"candidateManifestSha256": None}), "v1.2.1": "Weekly release"}
-
- def git(argv):
- return " ".join(tags) if argv[3] == "v*" else tags[argv[3]]
-
- monkeypatch.setattr(stable, "output", git)
stable.main(["transitions"], env)
emitted = dict(line.split("=", 1)
for line in (tmp_path / "output").read_text(encoding="utf-8").splitlines())
assert emitted["baseline"] == "none"
assert json.loads(emitted["macos"]) == json.loads(emitted["windows"]) == {"include": []}
- tags["v1.2.2"] = json.dumps({"candidateManifestSha256": "3" * 64})
- with pytest.raises(ValueError, match="No published stable package baseline"):
+ env["BASELINE_MANIFEST_URL"] = f"{https_origin.base}/baseline.json"
+ with pytest.raises(ValueError, match="supplied baseline-manifest does not exist"):
stable.main(["transitions"], env)
-def test_gate_excuses_an_upgrade_arm_only_for_its_planners_first_release_output():
+def test_gate_excuses_an_upgrade_arm_only_for_its_planners_no_baseline_output():
from scripts.releases.stable import PACKAGED_BY, require_gate
required = [*PACKAGED_BY, *PACKAGED_BY.values()]
diff --git a/website/docs/developer-guide/stable-releases.md b/website/docs/developer-guide/stable-releases.md
index 3756a4df44f..a2b91581fbe 100644
--- a/website/docs/developer-guide/stable-releases.md
+++ b/website/docs/developer-guide/stable-releases.md
@@ -415,9 +415,9 @@ local helper suite. Never store the bootstrap output as a repo channel list.
The last successful stable release that shipped bundles records
`releases/stable/release-candidates.json` on the configured R2 public origin.
A release that skipped bundles does not replace it.
-The first release that ships bundles has no baseline. It still runs every
-native smoke but skips the signed-package upgrade arms. A missing baseline
-after any final tag records a candidate manifest is a blocker.
+When no baseline exists, the release still runs every native smoke but skips
+the signed-package upgrade arms. A `baseline-manifest` input that does not
+exist is a blocker.
It identifies actual Windows universal MSIX bundles, macOS ZIPs and package
provenance. The next run combines those records with its candidate manifest
and uses the existing native bundled-update drivers.