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 2b133872e6 fix(release): publish final versions from voted ATR
revisions (#9336)
2b133872e6 is described below
commit 2b133872e63b86a0a5d3942b50a63cbcc7e2b810
Author: tison <[email protected]>
AuthorDate: Sat Nov 28 22:37:46 2026 +0800
fix(release): publish final versions from voted ATR revisions (#9336)
---
.asf.yaml | 7 +
.github/workflows/ci_odev.yml | 3 +
.github/workflows/release-compose.yml | 17 +-
.github/workflows/release_lifecycle.yml | 2 +
.github/workflows/release_publish.yml | 1 +
.github/workflows/weekly_release.yml | 2 +
scripts/compose_atr.py | 187 ++++++++++++++++++
scripts/release_lifecycle.py | 234 ++++++++++++++++-------
scripts/test_compose_atr.py | 213 +++++++++++++++++++++
scripts/test_release_impact.py | 6 +-
scripts/test_release_lifecycle.py | 130 ++++++++++++-
website/community/release/ci-signing-proposal.md | 12 +-
website/community/release/weekly.md | 21 +-
website/src/components/DownloadLink/index.js | 5 +-
14 files changed, 748 insertions(+), 92 deletions(-)
diff --git a/.asf.yaml b/.asf.yaml
index b5718d9f2a..be04b9ae26 100644
--- a/.asf.yaml
+++ b/.asf.yaml
@@ -17,6 +17,13 @@
# All configurations could be found here:
https://github.com/apache/infrastructure-asfyaml/
+project:
+ metadata:
+ key: opendal
+ committee: opendal
+ policy:
+ download_path_suffix: "{{VERSION}}"
+
github:
description: "Apache OpenDAL: One Layer, All Storage."
homepage: https://opendal.apache.org
diff --git a/.github/workflows/ci_odev.yml b/.github/workflows/ci_odev.yml
index 5f9c3ad696..244227d432 100644
--- a/.github/workflows/ci_odev.yml
+++ b/.github/workflows/ci_odev.yml
@@ -30,6 +30,8 @@ on:
- "scripts/verify_source_reproducibility.py"
- "scripts/sign_source_release.py"
- "scripts/test_sign_source_release.py"
+ - "scripts/compose_atr.py"
+ - "scripts/test_compose_atr.py"
- "scripts/release_impact.py"
- "scripts/test_release_impact.py"
- "scripts/release_lifecycle.py"
@@ -72,6 +74,7 @@ jobs:
with:
python-version: '3.12'
- run: python3 -m unittest discover -s scripts -p
'test_sign_source_release.py'
+ - run: python3 -m unittest discover -s scripts -p 'test_compose_atr.py'
- run: python3 -m unittest discover -s scripts -p
'test_release_lifecycle.py'
- run: python3 -m unittest discover -s scripts -p
'test_release_impact.py'
diff --git a/.github/workflows/release-compose.yml
b/.github/workflows/release-compose.yml
index ca478f72cd..2b1f67a94d 100644
--- a/.github/workflows/release-compose.yml
+++ b/.github/workflows/release-compose.yml
@@ -135,18 +135,25 @@ jobs:
permissions:
contents: read
id-token: write
+ statuses: write
steps:
+ - uses: actions/checkout@v7
+ with:
+ persist-credentials: false
+ - uses: actions/setup-python@v7
+ with:
+ python-version: '3.12'
- uses: actions/download-artifact@v8
with:
artifact-ids: ${{ needs.source_sign.outputs.artifact-id }}
path: ${{ runner.temp }}/signed-source
merge-multiple: true
- name: Upload candidate to ATR compose
- uses:
apache/tooling-actions/upload-to-atr@fa721a0b176d713807b574da721b96545b587eea
- with:
- project: opendal
- version: ${{ inputs.rc }}
- src: ${{ runner.temp }}/signed-source
+ env:
+ GH_TOKEN: ${{ github.token }}
+ RC: ${{ inputs.rc }}
+ CANDIDATE: ${{ inputs.candidate }}
+ run: python3 scripts/compose_atr.py "$RC" "$CANDIDATE"
"$RUNNER_TEMP/signed-source"
- name: Record staging handoff
run: |
echo 'Candidate uploaded to ATR compose. Inspect ATR checks and
independently rebuild the downloaded files before starting a vote. This
workflow does not vote or finish a release.' >> "$GITHUB_STEP_SUMMARY"
diff --git a/.github/workflows/release_lifecycle.yml
b/.github/workflows/release_lifecycle.yml
index dbbf10b6df..8b399b9160 100644
--- a/.github/workflows/release_lifecycle.yml
+++ b/.github/workflows/release_lifecycle.yml
@@ -39,6 +39,7 @@ jobs:
permissions:
discussions: write
contents: read
+ statuses: read
outputs:
candidates: ${{ steps.sync.outputs.candidates }}
steps:
@@ -68,6 +69,7 @@ jobs:
discussions: write
pull-requests: write
id-token: write
+ statuses: read
# A reusable workflow preserves the caller's ASF-linked actor for ATR OIDC.
uses: ./.github/workflows/release_publish.yml
with:
diff --git a/.github/workflows/release_publish.yml
b/.github/workflows/release_publish.yml
index 3dfb736abb..b8eb29d7b1 100644
--- a/.github/workflows/release_publish.yml
+++ b/.github/workflows/release_publish.yml
@@ -55,6 +55,7 @@ jobs:
discussions: write
pull-requests: write
id-token: write
+ statuses: read
steps:
- uses: actions/checkout@v7
with:
diff --git a/.github/workflows/weekly_release.yml
b/.github/workflows/weekly_release.yml
index 560d0a651b..f215e5778d 100644
--- a/.github/workflows/weekly_release.yml
+++ b/.github/workflows/weekly_release.yml
@@ -119,6 +119,7 @@ jobs:
permissions:
contents: read
id-token: write
+ statuses: write
uses: ./.github/workflows/release-compose.yml
with:
candidate: ${{ needs.prepare.outputs.sha }}
@@ -168,6 +169,7 @@ jobs:
permissions:
discussions: write
contents: read
+ statuses: read
steps:
- uses: actions/checkout@v7
with:
diff --git a/scripts/compose_atr.py b/scripts/compose_atr.py
new file mode 100644
index 0000000000..6ca883fee1
--- /dev/null
+++ b/scripts/compose_atr.py
@@ -0,0 +1,187 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Stage one complete signed candidate and bind its ATR revision to the Git
RC."""
+
+import argparse
+import hashlib
+import subprocess
+import tempfile
+import time
+from pathlib import Path
+
+from release_lifecycle import (
+ ATR,
+ REPO,
+ Candidate,
+ api,
+ atr_jwt,
+ atr_manifest,
+ atr_release,
+ candidates,
+ ref_sha,
+ request_json,
+ selected_revision,
+)
+
+
+def signed_manifest(directory, version):
+ files = {}
+ for path in directory.iterdir():
+ if path.is_symlink() or not path.is_file():
+ raise ValueError(f"Unexpected entry in the signed bundle:
{path.name}")
+ with path.open("rb") as stream:
+ files[path.name] = (
+ "sha3-256:" + hashlib.file_digest(stream,
"sha3_256").hexdigest()
+ )
+ archives = {name for name in files if name.endswith("-src.tar.gz")}
+ if f"apache-opendal-core-{version}-src.tar.gz" not in archives or
set(files) != {
+ name + suffix for name in archives for suffix in ("", ".asc",
".sha512")
+ }:
+ raise ValueError(
+ "Expected signed source archives with both .asc and .sha512
sidecars"
+ )
+ return files
+
+
+def upload(candidate, directory):
+ with tempfile.TemporaryDirectory(prefix="od-atr-", dir="/tmp") as
temporary:
+ key = Path(temporary) / "key"
+ subprocess.run(
+ ["ssh-keygen", "-q", "-t", "ed25519", "-N", "", "-f", key],
check=True
+ )
+ request_json(
+ f"{ATR}/api/publisher/ssh/register",
+ {
+ "publisher": "github",
+ "jwt": atr_jwt(),
+ "ssh_key": key.with_suffix(".pub").read_text().strip(),
+ "source_commit": candidate.sha,
+ },
+ )
+ subprocess.run(
+ [
+ "rsync",
+ "-av",
+ "--delete",
+ "-e",
+ f"ssh -p 2222 -i {key} -o BatchMode=yes -o IdentitiesOnly=yes
-o StrictHostKeyChecking=accept-new",
+ "--",
+ f"{directory}/",
+ f"[email protected]:/opendal/{candidate.version}/",
+ ],
+ check=True,
+ )
+
+
+def accepted_revision(candidate, files, previous):
+ # ATR may finish archive validation after rsync exits. The old revision
stays visible meanwhile.
+ deadline = time.monotonic() + 20 * 60
+ while time.monotonic() < deadline:
+ release = atr_release(candidate.version, optional=True)
+ if release is not None:
+ if release["phase"] != "release_candidate_draft":
+ raise ValueError(f"ATR {candidate.version} has left the
compose phase")
+ number = release.get("latest_revision_number")
+ if (
+ number
+ and number != previous
+ and release.get("commit_hash") == candidate.sha
+ ):
+ revision = selected_revision(release)
+ remote = atr_manifest(candidate.version, revision)
+ if remote == files:
+ return revision
+ mismatches = sorted(
+ name
+ for name in files.keys() | remote
+ if files.get(name) != remote.get(name)
+ )
+ raise ValueError(
+ f"ATR revision {revision} differs from the signed bundle:
{mismatches}"
+ )
+ time.sleep(10)
+ raise TimeoutError(
+ f"ATR has not accepted the signed bundle for {candidate.rc} at
{candidate.sha}"
+ )
+
+
+def compose(candidate, directory):
+ if ref_sha("tags", f"v{candidate.rc}") != candidate.sha:
+ raise ValueError(f"Git tag v{candidate.rc} does not identify
{candidate.sha}")
+ files = signed_manifest(directory, candidate.version)
+ if atr_release(candidate.rc, optional=True) is not None:
+ raise ValueError(
+ f"Finish or withdraw the existing ATR candidate {candidate.rc}
before preparing a new Git RC"
+ )
+ release = atr_release(candidate.version, optional=True)
+ previous = None
+ revision = None
+ if release is None:
+ if ref_sha("tags", f"v{candidate.version}") is not None:
+ raise ValueError(f"Git already has a final tag for
{candidate.version}")
+ for rc in candidates():
+ if rc != candidate.rc and
rc.startswith(f"{candidate.version}-rc."):
+ legacy = atr_release(rc, optional=True)
+ if legacy and legacy["phase"] != "release_candidate_draft":
+ raise ValueError(
+ f"Resolve the existing ATR release {rc} before
starting {candidate.version}"
+ )
+ else:
+ if release["phase"] != "release_candidate_draft":
+ locked = selected_revision(release)
+ status = candidate.revision_status(locked, files)
+ if (
+ candidate.recorded_revision(status) == status
+ and atr_manifest(candidate.version, locked) == files
+ ):
+ return
+ raise ValueError(
+ f"ATR {candidate.version} is in {release['phase']}; only a
draft can be replaced"
+ )
+ previous = release.get("latest_revision_number")
+ if (
+ previous
+ and release.get("commit_hash") == candidate.sha
+ and atr_manifest(candidate.version, selected_revision(release)) ==
files
+ ):
+ revision = previous
+ if revision is None:
+ upload(candidate, directory)
+ revision = accepted_revision(candidate, files, previous)
+ status = candidate.revision_status(revision, files)
+ recorded = candidate.recorded_revision(status)
+ if recorded is None:
+ api(f"repos/{REPO}/statuses/{candidate.sha}", status)
+ elif recorded != status:
+ raise ValueError(
+ f"ATR revision {revision} already identifies a different candidate
or manifest"
+ )
+ print(f"{candidate.rc} at {candidate.sha}: {status['target_url']}")
+
+
+def main():
+ parser = argparse.ArgumentParser(description=__doc__)
+ parser.add_argument("rc")
+ parser.add_argument("sha")
+ parser.add_argument("directory", type=Path)
+ args = parser.parse_args()
+ compose(Candidate(args.rc, args.sha), args.directory)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/scripts/release_lifecycle.py b/scripts/release_lifecycle.py
index 8888e77763..4796ed4f8e 100644
--- a/scripts/release_lifecycle.py
+++ b/scripts/release_lifecycle.py
@@ -102,6 +102,61 @@ def request_json(url, payload=None, headers=None):
return json.loads(body) if body else None
+def atr_jwt():
+ url = os.environ["ACTIONS_ID_TOKEN_REQUEST_URL"] + f"&audience={ATR}/"
+ headers = {
+ "Authorization": "bearer " +
os.environ["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]
+ }
+ return request_json(url, headers=headers)["value"]
+
+
+def atr_release(version, *, optional=False):
+ try:
+ release =
request_json(f"{ATR}/api/release/get/opendal/{version}")["release"]
+ except urllib.error.HTTPError as error:
+ if optional and error.code == 404:
+ return None
+ raise
+ if release["project_key"] != "opendal" or release["version"] != version:
+ raise ValueError("ATR returned a different release")
+ return release
+
+
+def selected_revision(release):
+ field = (
+ "latest_revision_number"
+ if release["phase"] == "release_candidate_draft"
+ else "voted_revision_number"
+ )
+ number = release.get(field)
+ if not isinstance(number, str) or not re.fullmatch(r"[0-9]+", number):
+ raise ValueError(f"ATR revision is missing: {field}")
+ return number
+
+
+def manifest_url(version, revision):
+ return f"{ATR}/api/release/manifest/opendal/{version}/{revision}"
+
+
+def atr_manifest(version, revision):
+ manifest = request_json(manifest_url(version, revision))
+ if (manifest["project"], manifest["version"], manifest["revision"]) != (
+ "opendal",
+ version,
+ revision,
+ ):
+ raise ValueError("ATR returned a different revision manifest")
+ files = {}
+ for entry in manifest["files"]:
+ path, digest = entry["path"], entry["digest"]
+ if path in files or not re.fullmatch(r"sha3-256:[a-f0-9]{64}", digest
or ""):
+ raise ValueError(f"Ambiguous or missing ATR digest for {path}")
+ files[path] = digest
+ if not files:
+ raise ValueError("Empty ATR revision manifest")
+ return files
+
+
def ref_sha(kind, name):
ref = api(f"repos/{REPO}/git/ref/{kind}/{name}", optional=True)
if ref is None:
@@ -140,11 +195,32 @@ class Candidate:
raise ValueError(f"RC branch and tag disagree: {rc}")
return cls(rc, sha)
+ def revision_status(self, revision, files):
+ encoded = json.dumps(files, sort_keys=True, separators=(",",
":")).encode()
+ return {
+ "state": "success",
+ "context": f"release/atr/{self.version}/{revision}",
+ "description": f"{self.rc} {hashlib.sha256(encoded).hexdigest()}",
+ "target_url": manifest_url(self.version, revision),
+ }
+
+ def recorded_revision(self, status):
+ for recorded in
pages(f"repos/{REPO}/commits/{self.sha}/statuses?per_page=100"):
+ if (
+ recorded["context"] == status["context"]
+ and recorded["creator"]["login"] == "github-actions[bot]"
+ ):
+ return {key: recorded.get(key) for key in status}
+ return None
+
def atr(self):
- release =
request_json(f"{ATR}/api/release/get/opendal/{self.rc}")["release"]
- if release["project_key"] != "opendal" or release["version"] !=
self.rc:
- raise ValueError("ATR returned another candidate")
- return release
+ release = atr_release(self.version, optional=True)
+ if release is None:
+ # Before the transition, each RC owned a separate ATR release and
vote.
+ return atr_release(self.rc)
+ revision = selected_revision(release)
+ status = self.revision_status(revision, atr_manifest(self.version,
revision))
+ return release if self.recorded_revision(status) == status else None
def passed(release):
@@ -229,7 +305,7 @@ def comment_once(discussion_id, marker, text):
)
-def announcement(candidate):
+def announcement(candidate, atr_version):
v = candidate.version
return f"""Hi everyone,
@@ -239,7 +315,7 @@ OpenDAL is an Open Data Access Layer that provides unified
access to storage ser
- [Downloads](https://opendal.apache.org/download)
- [Release notes](https://github.com/{REPO}/releases/tag/v{v})
-- [Approved candidate]({ATR}/vote/opendal/{candidate.rc})
+- [Approved candidate]({ATR}/vote/opendal/{atr_version})
- [Website](https://opendal.apache.org/)
Thanks to everyone who contributed and verified this release.
@@ -260,12 +336,45 @@ def version_notes(candidate):
return render_plan(plan)
+def vote_start_instructions(candidate, atr_version, revision):
+ if atr_version == candidate.rc:
+ return (
+ f"Start this vote using the [ATR
form]({ATR}/voting/opendal/{atr_version}). "
+ f"Set **Publish location** to `{candidate.version}` for this
existing RC-named release."
+ )
+ return f"""After verification, start the vote (do not repeat this if
voting is already open):
+
+```bash
+uv run --python 3.13 --with "apache-trusted-releases @
git+https://github.com/apache/tooling-releases-client" python - <<'PYTHON'
+from atrclient import api
+from atrclient.models.api import VoteStartArgs
+
+task = api.vote_start(VoteStartArgs(
+ project="opendal",
+ version="{atr_version}",
+ revision="{revision}",
+ email_to="[email protected]",
+ automatic_resolve_when_finished=True,
+ automatic_publish_when_resolved=True,
+ notify_when_finished=True,
+)).task
+print(task.model_dump_json(indent=2))
+assert task.task_args["automatic_resolve_when_finished"] is True
+assert task.task_args["automatic_publish_when_resolved"] is True
+PYTHON
+```
+
+This uses the official ATR client and the same credentials as `atr`. It checks
+that the returned task enables both automatic resolution and publication. If a
+check fails, inspect that task in ATR; do not repeat the start command. The
CLI's
+`--auto-publish` option alone does not enable automatic resolution."""
+
+
def notice(candidate, release, status=None):
rc = candidate.rc
+ atr_version = release["version"]
phase = release["phase"]
- revision = release.get("latest_revision_number")
- if phase != "release" and (not revision or not re.fullmatch(r"[0-9]+",
revision)):
- raise ValueError("ATR revision is missing")
+ revision = selected_revision(release)
if status is None:
status = {
"release_candidate_draft": "Candidate uploaded; RM verification is
next.",
@@ -273,6 +382,8 @@ def notice(candidate, release, status=None):
"release_preview": "Vote passed; final publication is being
prepared.",
"release": "ATR announcement sent; checking GitHub publication and
follow-up.",
}[phase]
+ if phase == "release_candidate_draft" and atr_version == rc:
+ status += f" Start voting in the ATR web form with Publish
location set to `{candidate.version}`."
branch = (
f"releases/{candidate.version}"
if release["phase"] == "release"
@@ -282,7 +393,7 @@ def notice(candidate, release, status=None):
f"""**Apache OpenDAL {candidate.version} has been released.**
- [GitHub Release](https://github.com/{REPO}/releases/tag/v{candidate.version})
-- [ATR status]({ATR}/vote/opendal/{rc})
+- [ATR status]({ATR}/vote/opendal/{atr_version})
- [Source branch](https://github.com/{REPO}/tree/{branch}); commit:
`{candidate.sha}`.
Follow the status replies below for optional package distribution and cleanup.
@@ -293,9 +404,9 @@ Follow the status replies below for optional package
distribution and cleanup.
ATR is the release authority. Follow the latest status replies below and the
ATR
vote page for current progress; this opening post contains candidate
instructions.
-- [ATR checks]({ATR}/checks/opendal/{rc}) · [Download
candidate]({ATR}/download/path/opendal/{rc}) · [Vote]({ATR}/vote/opendal/{rc})
+- [ATR checks]({ATR}/checks/opendal/{atr_version}) · [Download
candidate]({ATR}/download/path/opendal/{atr_version}) ·
[Vote]({ATR}/vote/opendal/{atr_version})
- [Candidate branch](https://github.com/{REPO}/tree/{branch}) · [RC
tag](https://github.com/{REPO}/releases/tag/v{rc})
-- Candidate commit: `{candidate.sha}`; ATR revision: `{revision}`.
+- Candidate commit: `{candidate.sha}`; [ATR revision `{revision}`
manifest]({manifest_url(atr_version, revision)}).
- [RC builds](https://github.com/{REPO}/actions?query=branch%3Av{rc}) ·
[Scheduled
publication](https://github.com/{REPO}/actions/workflows/release_lifecycle.yml)
· [Manual
publication](https://github.com/{REPO}/actions/workflows/release_publish.yml)
{version_notes(candidate)}
@@ -310,36 +421,11 @@ vote page for current progress; this opening post
contains candidate instruction
Read-only checks:
```bash
-atr check status opendal {rc} {revision}
-atr vote tabulate opendal {rc}
-```
-
-After verification, start the vote (do not repeat this if voting is already
open):
-
-```bash
-uv run --python 3.13 --with "apache-trusted-releases @
git+https://github.com/apache/tooling-releases-client" python - <<'PYTHON'
-from atrclient import api
-from atrclient.models.api import VoteStartArgs
-
-task = api.vote_start(VoteStartArgs(
- project="opendal",
- version="{rc}",
- revision="{revision}",
- email_to="[email protected]",
- automatic_resolve_when_finished=True,
- automatic_publish_when_resolved=True,
- notify_when_finished=True,
-)).task
-print(task.model_dump_json(indent=2))
-assert task.task_args["automatic_resolve_when_finished"] is True
-assert task.task_args["automatic_publish_when_resolved"] is True
-PYTHON
+atr check status opendal {atr_version} {revision}
+atr vote tabulate opendal {atr_version}
```
-This uses the official ATR client and the same credentials as `atr`. It checks
-that the returned task enables both automatic resolution and publication. If a
-check fails, inspect that task in ATR; do not repeat the start command. The
CLI's
-`--auto-publish` option alone does not enable automatic resolution.
+{vote_start_instructions(candidate, atr_version, revision)}
ATR attempts automatic resolution at the scheduled vote end and publishes the
source archives if the vote passes. Insufficient votes leave the vote open for
@@ -347,7 +433,7 @@ manual follow-up; do not assume later ballots automatically
trigger another
attempt. If manual resolution is needed, review the tally first:
```bash
-atr vote resolve opendal {rc} passed
+atr vote resolve opendal {atr_version} passed
```
These commands change the release state; agents need the RM's authorization
for voting actions. The hourly GitHub workflow follows ATR's resolved result to
create the final branch and tag, publish packages, and finish announcements and
cleanup. It does not tally or resolve votes.
@@ -364,7 +450,7 @@ Download and verify the candidate. During voting, ASF
committers can vote on ATR
<details><summary>Final announcement draft</summary>
-{announcement(candidate)}
+{announcement(candidate, atr_version)}
</details>
"""
)
@@ -376,7 +462,7 @@ Download and verify the candidate. During voting, ASF
committers can vote on ATR
comment_once(
current["id"],
f"<!-- opendal-vote:{rc}:{seq} -->",
- f"Voting is now open: [{rc}]({ATR}/vote/opendal/{rc}). The ATR
page shows the deadline and participation instructions. Follow ATR and these
status replies for current progress; the opening post records candidate
preparation. Other builds and language package staging are optional and do not
block this vote.",
+ f"Voting is now open: [{rc}]({ATR}/vote/opendal/{atr_version}).
The ATR page shows the deadline and participation instructions. Follow ATR and
these status replies for current progress; the opening post records candidate
preparation. Other builds and language package staging are optional and do not
block this vote.",
)
else:
atr_status = (
@@ -386,7 +472,7 @@ Download and verify the candidate. During voting, ASF
committers can vote on ATR
)
progress = f"""**{status}**
-- {atr_status}; [current ATR status]({ATR}/vote/opendal/{rc}).
+- {atr_status}; [current ATR status]({ATR}/vote/opendal/{atr_version}).
- [Source branch](https://github.com/{REPO}/tree/{branch}) · [Scheduled
publication](https://github.com/{REPO}/actions/workflows/release_lifecycle.yml)
· [Manual
publication](https://github.com/{REPO}/actions/workflows/release_publish.yml).
"""
digest = hashlib.sha256(progress.encode()).hexdigest()
@@ -433,18 +519,36 @@ def candidates():
def sync():
- approved = []
+ approved_by_version = {}
+ unbound = set()
+ bound = set()
errors = []
for rc in candidates():
try:
candidate = Candidate.load(rc)
release = candidate.atr()
+ if release is None:
+ unbound.add(candidate.version)
+ continue
+ if release["version"] == candidate.version:
+ bound.add(candidate.version)
if passed(release):
- approved.append(rc)
+ approved_by_version.setdefault(candidate.version,
[]).append(rc)
else:
notice(candidate, release)
except (RuntimeError, ValueError, OSError, KeyError) as error:
errors.append(f"{rc}: {error}")
+ unresolved = unbound - bound
+ for version in sorted(unresolved):
+ errors.append(f"{version}: no Git RC matches the selected ATR
revision")
+ approved = []
+ for version, matches in approved_by_version.items():
+ if version in unresolved:
+ continue
+ if len(matches) == 1:
+ approved.extend(matches)
+ else:
+ errors.append(f"{version}: multiple approved candidates:
{matches}")
with Path(os.environ["GITHUB_OUTPUT"]).open("a") as output:
output.write(f"candidates={json.dumps(approved)}\n")
if errors:
@@ -776,10 +880,13 @@ def cleanup(candidate):
def publish(candidate):
release = candidate.atr()
+ if release is None:
+ raise ValueError(f"{candidate.rc} does not match the selected ATR
revision")
if not passed(release):
raise ValueError("ATR has not resolved this vote as passed")
+ revision = selected_revision(release)
final_refs(candidate)
- body = announcement(candidate)
+ body = announcement(candidate, release["version"])
existing = api(f"repos/{REPO}/releases/tags/v{candidate.version}",
optional=True)
if existing and (existing["draft"] or existing["prerelease"]):
raise ValueError("existing GitHub Release is still draft or
prerelease")
@@ -796,34 +903,26 @@ def publish(candidate):
},
)
if release["phase"] != "release":
- token_url = (
- os.environ["ACTIONS_ID_TOKEN_REQUEST_URL"]
- + "&audience=https://releases.apache.org/"
- )
- jwt = request_json(
- token_url,
- headers={
- "Authorization": "bearer "
- + os.environ["ACTIONS_ID_TOKEN_REQUEST_TOKEN"]
- },
- )["value"]
# This is the endpoint used by apache/tooling-actions/release-on-atr.
# ATR validates publication and download propagation before sending
mail.
request_json(
f"{ATR}/api/publisher/release/announce",
{
"publisher": "github",
- "jwt": jwt,
- "version": candidate.rc,
- "revision": release["latest_revision_number"],
+ "jwt": atr_jwt(),
+ "version": release["version"],
+ "revision": revision,
"email_to": "[email protected]",
"body": body,
- "path_suffix": release.get("download_path_suffix")
- or f"opendal-{candidate.version}",
+ "path_suffix": release.get("download_path_suffix") or None,
},
)
release = candidate.atr()
- if release["phase"] != "release":
+ if (
+ release is None
+ or release["phase"] != "release"
+ or selected_revision(release) != revision
+ ):
raise ValueError("ATR has not confirmed the announcement")
discussion(
f"[ANNOUNCE] Release Apache OpenDAL {candidate.version}", body,
"Announcements"
@@ -888,7 +987,12 @@ def main():
else:
candidate = Candidate.load(args.rc or "")
if args.action == "notify":
- notice(candidate, candidate.atr(), args.status)
+ release = candidate.atr()
+ if release is None:
+ raise ValueError(
+ f"{candidate.rc} does not match the selected ATR revision"
+ )
+ notice(candidate, release, args.status)
else:
publish(candidate)
diff --git a/scripts/test_compose_atr.py b/scripts/test_compose_atr.py
new file mode 100644
index 0000000000..c8cbbf7725
--- /dev/null
+++ b/scripts/test_compose_atr.py
@@ -0,0 +1,213 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import hashlib
+import os
+import subprocess
+import tempfile
+import unittest
+from pathlib import Path
+from unittest.mock import patch
+
+import compose_atr as compose
+import release_lifecycle as lifecycle
+
+
+class ComposeTests(unittest.TestCase):
+ def test_second_upload_replaces_first_revision_including_sidecars(self):
+ first = lifecycle.Candidate("0.60.0-rc.1", "a" * 40)
+ second = lifecycle.Candidate("0.60.0-rc.2", "b" * 40)
+ core = "apache-opendal-core-0.60.0-src.tar.gz"
+ old = "apache-opendal-bindings-c-1.0.0-src.tar.gz"
+ new = "apache-opendal-bindings-c-1.0.1-src.tar.gz"
+ removed = "apache-opendal-bindings-test-0.1.0-src.tar.gz"
+ real_run = subprocess.run
+ with tempfile.TemporaryDirectory() as directory:
+ root = Path(directory)
+ remote = root / "atr"
+ remote.mkdir()
+ registered = []
+ numbers = iter(["00004", "00009"])
+ revisions = {}
+ release = {}
+
+ def register(url, payload):
+ self.assertEqual(url,
f"{lifecycle.ATR}/api/publisher/ssh/register")
+ registered.append(payload["source_commit"])
+
+ def transfer(argv, **options):
+ if argv[0] == "ssh-keygen":
+ return real_run(argv, **options)
+ self.assertEqual(
+ argv[-1], "[email protected]:/opendal/0.60.0/"
+ )
+ real_run(
+ [*argv[:-1], str(remote) + "/"], capture_output=True,
**options
+ )
+ number = next(numbers)
+ revisions[number] = {
+ path.name: "sha3-256:"
+ + hashlib.sha3_256(path.read_bytes()).hexdigest()
+ for path in remote.iterdir()
+ }
+ release.update(
+ phase="release_candidate_draft",
+ latest_revision_number=number,
+ commit_hash=registered[-1],
+ )
+
+ def snapshot(version, *, optional=False):
+ if version == first.version:
+ return release or None
+ return None
+
+ with (
+ patch.object(
+ compose,
+ "ref_sha",
+ side_effect=lambda kind, name: {
+ "v" + first.rc: first.sha,
+ "v" + second.rc: second.sha,
+ }.get(name),
+ ),
+ patch.object(compose, "candidates", return_value=[first.rc,
second.rc]),
+ patch.object(compose, "atr_release", side_effect=snapshot),
+ patch.object(
+ compose,
+ "atr_manifest",
+ side_effect=lambda version, number: revisions[number],
+ ),
+ patch.object(compose, "atr_jwt", return_value="token"),
+ patch.object(compose, "request_json", side_effect=register),
+ patch.object(compose.subprocess, "run", side_effect=transfer),
+ patch.object(lifecycle, "pages", return_value=[]),
+ patch.object(compose, "api") as status,
+ ):
+ for candidate, names, number in [
+ (first, (core, old, removed), "00004"),
+ (second, (core, new), "00009"),
+ ]:
+ bundle = root / candidate.rc
+ bundle.mkdir()
+ for name in names:
+ for suffix in ("", ".asc", ".sha512"):
+ path = bundle / (name + suffix)
+ path.write_text(name + suffix + candidate.sha)
+ os.utime(
+ path,
+ (1700001000, 1700001000)
+ if candidate == first
+ else (1700002000, 1700002000),
+ )
+ compose.compose(candidate, bundle)
+ self.assertEqual(registered[-1], candidate.sha)
+ self.assertEqual(
+ set(revisions[number]), {p.name for p in
bundle.iterdir()}
+ )
+ self.assertEqual(
+ {p.name: p.read_bytes() for p in remote.iterdir()},
+ {p.name: p.read_bytes() for p in bundle.iterdir()},
+ )
+ status.assert_called_with(
+ f"repos/{lifecycle.REPO}/statuses/{candidate.sha}",
+ candidate.revision_status(number, revisions[number]),
+ )
+ self.assertEqual(
+ status.call_args.args[1]["target_url"],
+
f"{lifecycle.ATR}/api/release/manifest/opendal/0.60.0/{number}",
+ )
+
+ def test_first_shared_release_waits_for_existing_long_version_vote(self):
+ candidate = lifecycle.Candidate("0.60.0-rc.2", "b" * 40)
+ with (
+ patch.object(compose, "ref_sha", side_effect=[candidate.sha,
None]),
+ patch.object(
+ compose, "signed_manifest", return_value={"archive": "digest"}
+ ),
+ patch.object(
+ compose,
+ "atr_release",
+ side_effect=[None, None, {"phase": "release_candidate"}],
+ ),
+ patch.object(
+ compose, "candidates", return_value=["0.60.0-rc.1",
candidate.rc]
+ ),
+ patch.object(compose, "upload") as upload,
+ ):
+ with self.assertRaisesRegex(ValueError, "existing ATR release
0.60.0-rc.1"):
+ compose.compose(candidate, Path("bundle"))
+ upload.assert_not_called()
+
+ def
test_retry_records_already_accepted_revision_without_another_upload(self):
+ candidate = lifecycle.Candidate("0.60.0-rc.2", "b" * 40)
+ files = {"archive.asc": "digest"}
+ accepted = {
+ "phase": "release_candidate_draft",
+ "commit_hash": candidate.sha,
+ "latest_revision_number": "00007",
+ }
+ with (
+ patch.object(compose, "ref_sha", return_value=candidate.sha),
+ patch.object(compose, "signed_manifest", return_value=files),
+ patch.object(compose, "atr_release", side_effect=[None, accepted]),
+ patch.object(compose, "atr_manifest", return_value=files),
+ patch.object(lifecycle, "pages", return_value=[]),
+ patch.object(compose, "upload") as upload,
+ patch.object(compose, "api") as status,
+ ):
+ compose.compose(candidate, Path("bundle"))
+ upload.assert_not_called()
+ status.assert_called_once_with(
+ f"repos/{lifecycle.REPO}/statuses/{candidate.sha}",
+ candidate.revision_status("00007", files),
+ )
+
+ def test_unverified_upload_never_gets_a_commit_status(self):
+ candidate = lifecycle.Candidate("0.60.0-rc.2", "b" * 40)
+ files = {"package.asc": "new"}
+ old = {
+ "phase": "release_candidate_draft",
+ "latest_revision_number": "00004",
+ "commit_hash": "a" * 40,
+ }
+ accepted = old | {
+ "latest_revision_number": "00009",
+ "commit_hash": candidate.sha,
+ }
+ with (
+ patch.object(compose, "ref_sha", return_value=candidate.sha),
+ patch.object(compose, "signed_manifest", return_value=files),
+ patch.object(
+ compose, "atr_release", side_effect=[None, old, old, accepted]
+ ),
+ patch.object(compose, "upload"),
+ patch.object(compose.time, "sleep") as wait,
+ patch.object(
+ compose,
+ "atr_manifest",
+ return_value=files | {"withdrawn-package.asc": "old"},
+ ),
+ patch.object(compose, "api") as status,
+ ):
+ with self.assertRaisesRegex(ValueError, "withdrawn-package.asc"):
+ compose.compose(candidate, Path("bundle"))
+ wait.assert_called_once()
+ status.assert_not_called()
+
+
+if __name__ == "__main__":
+ unittest.main()
diff --git a/scripts/test_release_impact.py b/scripts/test_release_impact.py
index 39ad8772b5..02e0ac792c 100644
--- a/scripts/test_release_impact.py
+++ b/scripts/test_release_impact.py
@@ -323,7 +323,11 @@ class ImpactTests(unittest.TestCase):
):
release.notice(
candidate,
- {"phase": "release_candidate_draft", "latest_revision_number":
"00001"},
+ {
+ "version": candidate.version,
+ "phase": "release_candidate_draft",
+ "latest_revision_number": "00001",
+ },
)
body = discussion.call_args.args[1]
self.assertIn("0.60.0", body)
diff --git a/scripts/test_release_lifecycle.py
b/scripts/test_release_lifecycle.py
index ccf3d9f310..471cf125d1 100644
--- a/scripts/test_release_lifecycle.py
+++ b/scripts/test_release_lifecycle.py
@@ -34,9 +34,12 @@ class LifecycleTests(unittest.TestCase):
def setUp(self):
self.candidate = release.Candidate("0.59.3-rc.2", "a" * 40)
self.atr = {
+ "version": self.candidate.rc,
"phase": "release_preview",
"vote_resolved": "2026-09-14T00:00:00",
+ "voted_revision_number": "00003",
"latest_revision_number": "00003",
+ "download_path_suffix": "",
"current_vote_seq": 1,
}
@@ -85,6 +88,125 @@ class LifecycleTests(unittest.TestCase):
release.publish(self.candidate)
refs.assert_not_called()
+ def
test_withdrawn_vote_and_approved_revision_select_only_the_second_git_rc(self):
+ first = release.Candidate("0.60.0-rc.1", "a" * 40)
+ second = release.Candidate("0.60.0-rc.2", "b" * 40)
+ artifacts = {
+ number: {"package.asc": "sha3-256:" + digest * 64}
+ for number, digest in [("00004", "c"), ("00009", "d")]
+ }
+ statuses = {
+ candidate.sha: [
+ candidate.revision_status(number, artifacts[number])
+ | {"creator": {"login": "github-actions[bot]"}}
+ ]
+ for candidate, number in [(first, "00004"), (second, "00009")]
+ }
+ state = self.atr | {
+ "project_key": "opendal",
+ "version": second.version,
+ "phase": "release_candidate",
+ "voted_revision_number": "00004",
+ "latest_revision_number": "00004",
+ "vote_resolved": None,
+ "commit_hash": "f" * 40,
+ }
+
+ def atr_read(url):
+ if url.endswith("/" + second.version):
+ return {"release": state.copy()}
+ if "/manifest/" in url:
+ number = url.rsplit("/", 1)[1]
+ return {
+ "project": "opendal",
+ "version": second.version,
+ "revision": number,
+ "files": [
+ {"path": k, "digest": v} for k, v in
artifacts[number].items()
+ ],
+ }
+ raise urllib.error.HTTPError(
+ url, 404, "No such long-version release", {}, None
+ )
+
+ with (
+ tempfile.TemporaryDirectory() as directory,
+ patch.dict(os.environ, {"GITHUB_OUTPUT": str(Path(directory,
"outputs"))}),
+ patch.object(release, "candidates", return_value=[first.rc,
second.rc]),
+ patch.object(
+ release,
+ "ref_sha",
+ side_effect=lambda kind, name: (
+ first.sha if name.endswith(first.rc) else second.sha
+ ),
+ ),
+ patch.object(release, "request_json", side_effect=atr_read),
+ patch.object(
+ release, "pages", side_effect=lambda path:
statuses[path.split("/")[4]]
+ ),
+ patch.object(release, "notice") as notice,
+ patch.object(
+ release,
+ "final_refs",
+ side_effect=InterruptedError("observed final refs"),
+ ) as refs,
+ ):
+ release.sync()
+ self.assertEqual(notice.call_args.args[0], first)
+ state.update(
+ phase="release_candidate_draft",
+ latest_revision_number="00009",
+ voted_revision_number=None,
+ )
+ release.sync()
+ self.assertEqual(notice.call_args.args[0], second)
+ state.update(
+ phase="release_preview",
+ voted_revision_number="00009",
+ latest_revision_number="00012",
+ vote_resolved="now",
+ )
+ release.sync()
+ with self.assertRaisesRegex(ValueError, "does not match"):
+ release.publish(first)
+ refs.assert_not_called()
+ with self.assertRaises(InterruptedError):
+ release.publish(second)
+ refs.assert_called_once_with(second)
+ state.update(phase="release", latest_revision_number=None)
+ release.sync()
+ self.assertEqual(
+ Path(directory, "outputs").read_text().splitlines(),
+ [
+ "candidates=[]",
+ "candidates=[]",
+ 'candidates=["0.60.0-rc.2"]',
+ 'candidates=["0.60.0-rc.2"]',
+ ],
+ )
+ artifacts["00009"]["extra.asc"] = "sha3-256:" + "0" * 64
+ with self.assertRaisesRegex(RuntimeError, "no Git RC matches"):
+ release.sync()
+ with self.assertRaisesRegex(ValueError, "does not match"):
+ release.publish(second)
+ self.assertEqual(refs.call_count, 1)
+
+ def test_existing_long_version_uses_its_own_vote(self):
+ legacy = self.atr | {"project_key": "opendal", "commit_hash": "f" * 40}
+ shared =
f"{release.ATR}/api/release/get/opendal/{self.candidate.version}"
+ with patch.object(
+ release,
+ "request_json",
+ side_effect=[
+ urllib.error.HTTPError(shared, 404, "Not found", {}, None),
+ {"release": legacy},
+ ],
+ ) as get:
+ self.assertEqual(self.candidate.atr(), legacy)
+ get.assert_called_with(
+ f"{release.ATR}/api/release/get/opendal/{self.candidate.rc}"
+ )
+
def test_conflicting_final_ref_cannot_be_replaced(self):
with (
patch.object(release, "ref_sha", side_effect=["b" * 40, None]),
@@ -245,7 +367,12 @@ class LifecycleTests(unittest.TestCase):
):
release.notice(
self.candidate,
- self.atr | {"phase": phase, "latest_revision_number":
None},
+ self.atr
+ | {
+ "phase": phase,
+ "latest_revision_number": None,
+ "voted_revision_number": None,
+ },
)
def test_sync_pr_can_recover_after_branch_push(self):
@@ -393,6 +520,7 @@ class LifecycleTests(unittest.TestCase):
self.assertEqual(payload["version"], self.candidate.rc)
self.assertEqual(payload["revision"], "00003")
self.assertEqual(payload["email_to"], "[email protected]")
+ self.assertIsNone(payload["path_suffix"])
self.assertNotIn("commit_hash", payload)
cleanup.assert_called_once()
diff --git a/website/community/release/ci-signing-proposal.md
b/website/community/release/ci-signing-proposal.md
index 83c6858367..03fabcfa2f 100644
--- a/website/community/release/ci-signing-proposal.md
+++ b/website/community/release/ci-signing-proposal.md
@@ -15,7 +15,7 @@ start votes, finish releases, or publish language packages.
Dispatch the workflow from the release branch with a full reviewed candidate
commit SHA and an `X.Y.Z-rc.N` candidate version. The candidate must be
reachable
from the workflow commit, and its core package version must equal `X.Y.Z`.
-Merge the version bump PR into the release branch before preparing the
candidate.
+The Git tag `vX.Y.Z-rc.N` must point to the reviewed SHA before compose can
replace the ATR draft. Weekly preparation creates this tag. Merge the version
bump PR into the release branch before preparing the candidate.
After the release succeeds, merge the release branch back into `main` to carry
the version updates forward. Automatic version selection is not implemented.
@@ -31,17 +31,11 @@ Three jobs separate credentials and responsibilities:
scripts run only in the build job, without the key. The public
key must already be in OpenDAL KEYS. Each generated signature is verified
against the configured primary fingerprint before the signed bundle is
saved.
-3. The upload job downloads the signed bundle by ID and uses the commit-pinned
- `apache/tooling-actions/upload-to-atr` action. GitHub OIDC authorizes a
temporary
- SSH key, and rsync transfers the bundle to ATR compose. This job receives
- `id-token: write`, but no GPG private key. No SVN credentials or persistent
ATR
- token are needed.
+3. The upload job downloads the signed bundle by ID. GitHub OIDC authorizes an
ephemeral SSH key and declares the reviewed source SHA. The job uses `rsync -av
--delete` to replace the ATR draft under the final version, verifies every
uploaded file against the accepted revision manifest, and writes a GitHub
commit status linking the Git RC to that revision. Its permissions are
`contents: read`, `id-token: write` and `statuses: write`.
The signed bundle contains only source `.tar.gz`, `.sha512` and `.asc` files.
Build logs and reproduction reports stay in Actions. An upload success does not
mean ATR checks passed: inspect the candidate revision and check results in
ATR.
-The upstream upload action is experimental; its pinned implementation must be
-reviewed again before upgrading.
## Prerequisites
@@ -115,4 +109,4 @@ layout before publication so it matches OpenDAL's release
directory conventions.
- [ATR staging and voting](https://releases.apache.org/docs/staging-and-voting)
- [ATR publication and KEYS
management](https://releases.apache.org/docs/promoting-to-release)
- [ASF automated signing
procedure](https://infra.apache.org/release-signing.html#automated-release-signing)
-- [Official upload
action](https://github.com/apache/tooling-actions/tree/fa721a0b176d713807b574da721b96545b587eea/upload-to-atr)
+- [ATR rsync and revision
semantics](https://releases.apache.org/docs/uploading-files#rsync)
diff --git a/website/community/release/weekly.md
b/website/community/release/weekly.md
index 424d1cd269..bfc76839a4 100644
--- a/website/community/release/weekly.md
+++ b/website/community/release/weekly.md
@@ -150,20 +150,24 @@ checks passed. The RM independently verifies the
candidate before opening voting
## Vote and community notification
+ATR uses the final version, such as `0.60.0`, as the release name. Each Git RC
keeps its own tag and commit. After a vote is withdrawn, the next compose
replaces the entire draft with the next signed bundle, including signatures and
checksums. Compose verifies the paths and digests in ATR's accepted revision
and records that revision on the Git RC commit. The project publish location is
`{{VERSION}}`, so the approved files land directly under
`downloads.apache.org/opendal/0.60.0/`.
+
+For an existing ATR draft registered as `X.Y.Z-rc.N`, continue using its full
ATR name. When starting its vote in the ATR web form, set **Publish location**
to `X.Y.Z`. To replace an older candidate with a new Git RC, withdraw any
active vote first. Once the final-version ATR record exists, the lifecycle
follows its revisions for that version.
+
Use the [official ATR
CLI](https://github.com/apache/tooling-releases-client/blob/main/RELEASE-PROCESS.md)
-or ATR's browser controls. The candidate Discussion substitutes the real RC and
+or ATR's browser controls. The candidate Discussion substitutes the ATR
release name and
revision into these commands:
```bash
-atr check status opendal 0.59.3-rc.1 00001
+atr check status opendal 0.60.0 00004
uv run --python 3.13 --with "apache-trusted-releases @
git+https://github.com/apache/tooling-releases-client" python - <<'PYTHON'
from atrclient import api
from atrclient.models.api import VoteStartArgs
task = api.vote_start(VoteStartArgs(
project="opendal",
- version="0.59.3-rc.1",
- revision="00001",
+ version="0.60.0",
+ revision="00004",
email_to="[email protected]",
automatic_resolve_when_finished=True,
automatic_publish_when_resolved=True,
@@ -193,8 +197,8 @@ count as ATR Trusted Vote ballots; follow ATR's
instructions to cast a ballot.
For manual recovery, inspect the tally and resolve according to the result:
```bash
-atr vote tabulate opendal 0.59.3-rc.1
-atr vote resolve opendal 0.59.3-rc.1 passed
+atr vote tabulate opendal 0.60.0
+atr vote resolve opendal 0.60.0 passed
```
Use ATR's browser controls to cancel a vote or inspect the tally if the CLI is
@@ -268,10 +272,7 @@ one.
For new `releases/<version>-rc.N` candidates, the hourly workflow calls
`release_publish.yml` once ATR reports a resolved passing vote. It:
-1. Verifies the RC branch and tag identify the same commit. Creates the
retained
- `releases/<version>` branch and signed `v<version>` tag at that commit.
Existing
- final refs must agree; they are never moved. ATR's OIDC `commit_hash` is not
- used because the upload workflow starts on main before generating the RC.
+1. Matches the vote's locked revision and its full file manifest to the
compose status on the Git RC commit. The RC branch and tag must point to that
commit. Creates the retained `releases/<version>` branch and signed
`v<version>` tag there, or verifies existing final refs on a retry.
2. Creates the GitHub Release and asks ATR to send the announcement to
`[email protected]`. ATR checks source publication and download
propagation.
Posts the reviewed announcement in GitHub Announcements, which the
repository
diff --git a/website/src/components/DownloadLink/index.js
b/website/src/components/DownloadLink/index.js
index 1b27a33201..3f6f55048d 100644
--- a/website/src/components/DownloadLink/index.js
+++ b/website/src/components/DownloadLink/index.js
@@ -30,7 +30,10 @@ export default function DownloadLink() {
);
}
- const artifact = `opendal/apache-opendal-core-${version}-src.tar.gz`;
+ // These releases published their archives directly in the project directory.
+ const flatRelease = ["0.59.2", "0.59.3", "0.59.4",
"0.59.5"].includes(version);
+ const directory = flatRelease ? "opendal" : `opendal/${version}`;
+ const artifact = `${directory}/apache-opendal-core-${version}-src.tar.gz`;
const source =
`https://www.apache.org/dyn/closer.lua/${artifact}?action=download`;
const download = `https://downloads.apache.org/${artifact}`;
return (