This is an automated email from the ASF dual-hosted git repository.
Xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 86b637f851 ci(release): record Zig breaking changes in weekly plans
(#9033)
86b637f851 is described below
commit 86b637f8513b82ed208dd9c820e38e8937e0e59e
Author: Xuanwo <[email protected]>
AuthorDate: Wed Nov 25 03:34:52 2026 +0800
ci(release): record Zig breaking changes in weekly plans (#9033)
---
.github/pull_request_template.md | 7 ++-
scripts/release_impact.py | 22 ++++++--
scripts/test_release_impact.py | 109 ++++++++++++++++++++++++++++--------
scripts/test_release_lifecycle.py | 36 +++++++++---
website/community/release/weekly.md | 27 ++++++---
5 files changed, 153 insertions(+), 48 deletions(-)
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index e8204ff0e1..40460553ca 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -37,9 +37,10 @@ Affected packages: core, bindings/java
Migration:
- Replace `old_api()` with `new_api()`.
-Use package names from dev/src/release/package.rs. Include bindings affected by
-behavior changes even when their source files are unchanged. Explain how users
-can migrate, or explain the removal and available alternatives.
+Use package names from dev/src/release/package.rs. You can also list
bindings/zig
+for migration notes. Include bindings affected by behavior changes even when
+their source files are unchanged. Explain how users can migrate, or explain the
+removal and available alternatives.
-->
# AI Usage Statement
diff --git a/scripts/release_impact.py b/scripts/release_impact.py
index a4288867ae..4512ed3216 100644
--- a/scripts/release_impact.py
+++ b/scripts/release_impact.py
@@ -26,6 +26,7 @@ import tempfile
from pathlib import Path
PLAN_PATH = ".release/plan.json"
+NON_STANDALONE_COMPONENTS = {"bindings/zig"}
def package_names():
@@ -87,9 +88,10 @@ def breaking_declaration(pull, packages):
"expected Affected packages: <comma-separated names> followed by
Migration: <instructions>"
)
affected = [name.strip().strip("`") for name in match[1].split(",")]
- if not affected or len(affected) != len(set(affected)) or set(affected) -
packages:
+ allowed = packages | NON_STANDALONE_COMPONENTS
+ if not affected or len(affected) != len(set(affected)) or set(affected) -
allowed:
raise ValueError(
- f"invalid affected packages: {match[1]}; allowed: {',
'.join(sorted(packages))}"
+ f"invalid affected packages: {match[1]}; allowed: {',
'.join(sorted(allowed))}"
)
migration = match[2].strip()
if not re.search(r"[a-zA-Z0-9]", migration) or migration.lower().strip("
.-") in {
@@ -160,18 +162,20 @@ def prepare(baseline, source):
path = Path(PLAN_PATH)
source = command("git", "rev-parse", f"{source}^{{commit}}")
+ packages = package_names()
if path.exists():
plan = json.loads(path.read_text())
if (plan["baseline"], plan["source"]) != (baseline, source):
- plan = collect_plan(baseline, source, package_names())
+ plan = collect_plan(baseline, source, packages)
else:
- plan = collect_plan(baseline, source, package_names())
+ plan = collect_plan(baseline, source, packages)
breaking = sorted(
{
package
for pull in plan["pulls"]
if pull["breaking"]
for package in pull["breaking"]["packages"]
+ if package in packages
}
)
with tempfile.TemporaryDirectory(prefix="opendal-release-plan-") as
directory:
@@ -228,11 +232,17 @@ def render_plan(plan):
f"| {version['package']} | {version['previous'] or 'New package'}
| {version['target']} | {'; '.join(reasons)} |"
)
lines += ["", "### Breaking changes and migration", ""]
+ released = {version["package"] for version in plan["versions"]}
for pull in plan["pulls"]:
if pull["breaking"]:
- names = ", ".join(f"`{name}`" for name in
pull["breaking"]["packages"])
+ names = []
+ for package in pull["breaking"]["packages"]:
+ name = f"`{package}`"
+ if package not in released:
+ name += " (no standalone artifact in this release)"
+ names.append(name)
lines += [
- f"#### [#{pull['number']}]({pull['url']}) — {names}",
+ f"#### [#{pull['number']}]({pull['url']}) — {',
'.join(names)}",
"",
pull["breaking"]["migration"],
"",
diff --git a/scripts/test_release_impact.py b/scripts/test_release_impact.py
index 5f554a6e22..39ad8772b5 100644
--- a/scripts/test_release_impact.py
+++ b/scripts/test_release_impact.py
@@ -95,24 +95,35 @@ class ImpactTests(unittest.TestCase):
)
def test_check_command_handles_real_event_file(self):
+ declaration = "# Breaking changes\nAffected packages:
{}\nMigration:\nUse the new API."
with tempfile.TemporaryDirectory() as directory:
event = Path(directory) / "event.json"
- event.write_text(json.dumps({"pull_request": self.pull()}))
env = os.environ | {"GITHUB_EVENT_PATH": str(event)}
- subprocess.run(
- ["python3", "scripts/release_impact.py", "check"],
- env=env,
- check=True,
- capture_output=True,
- )
- event.write_text(json.dumps({"pull_request":
self.pull(labeled=True)}))
- result = subprocess.run(
- ["python3", "scripts/release_impact.py", "check"],
- env=env,
- check=False,
- capture_output=True,
- )
- self.assertNotEqual(result.returncode, 0)
+ for pull, error in (
+ (self.pull(), None),
+ (self.pull(declaration.format("bindings/zig"), True), None),
+ (
+ self.pull(declaration.format("bindings/go"), True),
+ "invalid affected packages: bindings/go",
+ ),
+ (
+ self.pull(labeled=True),
+ "breaking-changes requires affected packages and migration
instructions",
+ ),
+ ):
+ with self.subTest(pull=pull):
+ event.write_text(json.dumps({"pull_request": pull}))
+ result = subprocess.run(
+ ["python3", "scripts/release_impact.py", "check"],
+ env=env,
+ capture_output=True,
+ text=True,
+ )
+ if error is None:
+ self.assertEqual(result.returncode, 0, result.stderr)
+ else:
+ self.assertNotEqual(result.returncode, 0)
+ self.assertIn(error, result.stderr)
def test_collection_uses_exact_merged_main_commit(self):
sha = "a" * 40
@@ -184,6 +195,57 @@ class ImpactTests(unittest.TestCase):
impact.source_commits(baseline, sync), (sync, [fix,
sync])
)
+ def test_prepare_collects_zig_and_scopes_breaking_versions(self):
+ sha = "a" * 40
+ migration = "- Update imports.\n\n```zig\nconst od =
@import(\"opendal\");\n```"
+ for affected, breaking_args in (
+ ("bindings/zig", []),
+ ("bindings/zig, bindings/python", ["--breaking",
"bindings/python"]),
+ ("bindings/go", None),
+ ):
+ pull = self.pull(
+ f"# Breaking changes\nAffected packages:
{affected}\nMigration:\n{migration}",
+ True,
+ ) | {
+ "number": 7,
+ "html_url": "https://github.com/apache/opendal/pull/7",
+ "merged_at": "now",
+ "merge_commit_sha": sha,
+ "base": {"ref": "main", "repo": {"full_name": release.REPO}},
+ }
+
+ def write_report(args, **kwargs):
+ report_index = args.index("--report") + 1
+ self.assertEqual(args[report_index + 1 :], breaking_args)
+ Path(args[report_index]).write_text("[]")
+
+ with (
+ self.subTest(affected=affected),
+ tempfile.TemporaryDirectory() as directory,
+ patch.object(impact, "PLAN_PATH", str(Path(directory) /
impact.PLAN_PATH)),
+ patch.object(release, "command", return_value=sha),
+ patch.object(impact, "source_commits", return_value=(sha,
[sha])),
+ patch.object(release, "pages", return_value=[pull]),
+ patch.object(impact.subprocess, "run",
side_effect=write_report) as update,
+ ):
+ path = Path(impact.PLAN_PATH)
+ if breaking_args is None:
+ with self.assertRaisesRegex(
+ ValueError, "PR #7: invalid affected packages:
bindings/go"
+ ):
+ impact.prepare("v0.59.1", sha)
+ update.assert_not_called()
+ self.assertFalse(path.exists())
+ continue
+
+ impact.prepare("v0.59.1", sha)
+ update.assert_called_once()
+ plan = json.loads(path.read_text())
+ self.assertEqual(
+ plan["pulls"][0]["breaking"],
+ {"packages": sorted(affected.split(", ")), "migration":
migration},
+ )
+
def
test_prepare_passes_scoped_breaking_and_reuses_frozen_declarations(self):
with tempfile.TemporaryDirectory() as directory:
path = Path(directory) / "plan.json"
@@ -245,20 +307,15 @@ class ImpactTests(unittest.TestCase):
"number": 12,
"url": "https://github.com/apache/opendal/pull/12",
"breaking": {
- "packages": ["core"],
+ "packages": ["bindings/zig", "core"],
"migration": "Use `new()` instead.",
},
}
],
}
content = {"content":
base64.b64encode(json.dumps(plan).encode()).decode()}
- with patch.object(release, "api", return_value=content) as api:
- notes = release.version_notes(candidate)
- self.assertIn("0.60.0", notes)
- self.assertIn("Use `new()` instead.", notes)
- self.assertIn(candidate.sha, api.call_args.args[0])
with (
- patch.object(release, "version_notes", return_value=notes),
+ patch.object(release, "api", return_value=content) as api,
patch.object(
release, "discussion", return_value={"id": "discussion"}
) as discussion,
@@ -268,7 +325,13 @@ class ImpactTests(unittest.TestCase):
candidate,
{"phase": "release_candidate_draft", "latest_revision_number":
"00001"},
)
- self.assertIn(notes, discussion.call_args.args[1])
+ body = discussion.call_args.args[1]
+ self.assertIn("0.60.0", body)
+ self.assertIn("Use `new()` instead.", body)
+ self.assertIn(
+ "`bindings/zig` (no standalone artifact in this release),
`core`", body
+ )
+ self.assertIn(candidate.sha, api.call_args.args[0])
if __name__ == "__main__":
diff --git a/scripts/test_release_lifecycle.py
b/scripts/test_release_lifecycle.py
index 0a0f4fd5c9..ccf3d9f310 100644
--- a/scripts/test_release_lifecycle.py
+++ b/scripts/test_release_lifecycle.py
@@ -17,6 +17,7 @@
"""Release lifecycle contracts at GitHub/ATR and Git boundaries."""
+import base64
import json
import os
import subprocess
@@ -329,6 +330,29 @@ class LifecycleTests(unittest.TestCase):
def
test_new_announcement_uses_approved_atr_revision_and_waits_for_confirmation(
self,
):
+ plan = {
+ "versions": [
+ {
+ "package": "core",
+ "previous": "0.59.2",
+ "configured": "0.59.2",
+ "target": "0.59.3",
+ "breaking": False,
+ "public_dependency_reason": None,
+ }
+ ],
+ "pulls": [
+ {
+ "number": 7,
+ "url": "https://github.com/apache/opendal/pull/7",
+ "breaking": {
+ "packages": ["bindings/zig"],
+ "migration": "Update Zig imports.\n\nThen rebuild the
application.",
+ },
+ }
+ ],
+ }
+ content = {"content":
base64.b64encode(json.dumps(plan).encode()).decode()}
with (
patch.object(
release.Candidate,
@@ -338,10 +362,7 @@ class LifecycleTests(unittest.TestCase):
patch.object(release, "final_refs"),
patch.object(release, "publish_builds", return_value=True),
patch.object(release, "nexus_release", return_value=True),
- patch.object(release, "api", return_value=None) as github,
- patch.object(
- release, "version_notes", return_value="Frozen migration
instructions"
- ),
+ patch.object(release, "api", side_effect=[None, content, None]) as
github,
patch.object(
release, "request_json", side_effect=[{"value": "test-jwt"},
{}]
) as http,
@@ -364,9 +385,10 @@ class LifecycleTests(unittest.TestCase):
self.assertEqual(
http.call_args.args[0],
f"{release.ATR}/api/publisher/release/announce"
)
- self.assertIn(
- "Frozen migration instructions",
github.call_args.args[1]["body"]
- )
+ notes = github.call_args.args[1]["body"]
+ self.assertIn("`bindings/zig` (no standalone artifact in this
release)", notes)
+ self.assertIn("Update Zig imports.\n\nThen rebuild the
application.", notes)
+ self.assertIn("| core | 0.59.2 | 0.59.3 | Weekly patch |", notes)
payload = http.call_args.args[1]
self.assertEqual(payload["version"], self.candidate.rc)
self.assertEqual(payload["revision"], "00003")
diff --git a/website/community/release/weekly.md
b/website/community/release/weekly.md
index 87bb6c5677..424d1cd269 100644
--- a/website/community/release/weekly.md
+++ b/website/community/release/weekly.md
@@ -32,14 +32,16 @@ is queued.
Weekly preparation reads the merged PRs between the last published source
commit
and the fixed cutoff. It validates their optional breaking change declarations,
-then calls `update-version --patch --breaking <package>` for each affected
package.
-Unmarked PRs require no release metadata and retain the normal patch policy.
+then calls `update-version --patch` and adds `--breaking <package>` for each
+affected package in `dev/src/release/package.rs`. Unmarked PRs require no
release
+metadata and retain the normal patch policy.
Each package receives at least a patch increment from the latest published
final
-GitHub Release. Declared breaking changes require an incompatible increment:
-minor for `0.x` packages, major for stable `1.x` and later packages (`0.0.x`
follows
-Cargo's patch compatibility boundary). Multiple breaking PRs increment a
package
-only once. Higher configured versions and new package versions are preserved.
+GitHub Release. For a declared breaking change to a release package, the weekly
+plan increments the minor version for `0.x` packages and the major version for
+stable `1.x` and later packages. Packages at `0.0.x` follow Cargo's patch
+compatibility boundary. Multiple breaking PRs increment a package only once.
+Higher configured versions and new package versions are preserved.
Public dependency compatibility changes also raise affected integration
versions;
a core breaking change does not automatically require an incompatible binding
version. Existing manifest and dependency update code applies the resulting
plan.
@@ -68,9 +70,16 @@ Migration:
- Replace `old_api()` with `new_api()`.
```
-Use comma-separated package names from `dev/src/release/package.rs`. Include
-bindings whose public behavior changes even when their source files do not.
-Explain the migration or the available alternatives for removed functionality.
+Use comma-separated package names from `dev/src/release/package.rs`. You can
also
+declare `bindings/zig` on its own or alongside those packages. The candidate
plan
+records the Zig migration instructions, and the candidate discussion and final
+release notes identify Zig as a component with no standalone artifact in the
+release. A Zig-only declaration keeps the normal patch policy. A mixed
+declaration applies breaking increments to the listed release packages.
+
+Include bindings whose public behavior changes even when their source files do
+not. Explain the migration or the available alternatives for removed
+functionality.
The **Breaking change declaration** CI check provides feedback on the label,
package names and migration text on PR changes and label/description edits. It
does not add a required merge check. Weekly preparation validates declarations