Compare commits

..

5 Commits

Author SHA1 Message Date
overtrue c269a1233d style(e2e): format sts_query_compat_test PutObjectTagging check 2026-11-26 17:53:21 +08:00
overtrue 986fb4269b chore(deps): bump rustfs/gateway pin to b4ea5ca3 2026-11-26 17:52:41 +08:00
overtrue 567b11079c fix(ecstore): return InvalidVersionID for invalid version-id-marker
Map VersionMarker::parse failures in list_objects::parse_version_marker to StorageError::InvalidVersionID instead of propagating uuid::Error as StorageError::Other, which mapped to HTTP 500 InternalError.

StorageError::InvalidVersionID maps to S3ErrorCode::InvalidArgument (HTTP 400) across ListObjectVersions, metadata version listings, and table-isolated version listings. Add regression tests for invalid version-id-marker rejection and control-character delimiter handling.
2026-11-26 17:52:41 +08:00
overtrue eefac8595c fix(server): avoid needless collect in ssec_transport unit test 2026-11-26 17:52:41 +08:00
overtrue 961b0c79c8 test(e2e): record PutObjectTagging on tagged writes
#9646 authorizes s3:PutObjectTagging after s3:PutObject when the
request carries object tags. The bucket-tag OPA contract still
consumed only PutObject, so the next GetObjectVersion check saw the
tagging decision. Keep the existing checks and record the tagging
decision for the tagged put and each successful copy.
2026-11-26 17:46:08 +08:00
17 changed files with 266 additions and 746 deletions
-21
View File
@@ -1301,27 +1301,6 @@
"origin": "baseline",
"alert_contract": "independent"
},
{
"workflow": ".github/workflows/package-deb-rpm.yml",
"name": "Package DEB/RPM",
"roles": [
"release"
],
"events": [
"workflow_run",
"workflow_dispatch"
],
"cadence": "event",
"timezone": "UTC",
"schedule": [],
"owner": "@overtrue",
"policy": "active",
"monitor": "none",
"result_owner": "package-deb-rpm.yml",
"disposition": "After a successful tag push of Build and Release, wrap the published Linux zips as deb and rpm assets and refresh SHA256SUMS and SHA512SUMS. Dispatch with a tag backfills an existing release. manual-main-packages.yml still only uploads workflow artifacts.",
"monitor_reason": "Event-driven release packaging has no periodic freshness obligation.",
"origin": "package-deb-rpm"
},
{
"workflow": ".github/workflows/package.yml",
"name": "Build candidate packages",
+1 -1
View File
@@ -81,6 +81,6 @@ Rows using `macos-latest-xlarge` or a label starting with `sm-`, `dind-`, `ubicl
## Release stages
The [candidate release pipeline](../../docs/operations/release-pipeline.md) builds Linux first and defers paid desktop capacity until acceptance. The daily `build.yml` schedule selects Linux; the Sunday 16:17 UTC schedule selects macOS and Windows. Manual dispatch can still select any platform list. All six platforms remain required before publication. The pipeline records and promotes the exact tested bytes. Reusable builder workflows have no public-release credentials. `package-deb-rpm.yml` is the default-branch listener that attaches deb and rpm assets after a legacy tag-triggered Build and Release run; it does not compile the server. Keep periodic development builds, PR verification and field-test chains separate when their contracts differ; do not re-enable disabled workflows as part of a source-file migration.
The [candidate release pipeline](../../docs/operations/release-pipeline.md) builds Linux first and defers paid desktop capacity until acceptance. The daily `build.yml` schedule selects Linux; the Sunday 16:17 UTC schedule selects macOS and Windows. Manual dispatch can still select any platform list. All six platforms remain required before publication. The pipeline records and promotes the exact tested bytes. Builder workflows have no public-release credentials. Keep periodic development builds, PR verification and field-test chains separate when their contracts differ; do not re-enable disabled workflows as part of a source-file migration.
Larger runners remain billed for public repositories; see [GitHub runner billing](https://docs.github.com/en/actions/concepts/runners/larger-runners#billing). Actual spending comes from organization billing, not runner labels or an estimated build duration.
-380
View File
@@ -1,380 +0,0 @@
# Copyright 2026 RustFS Team
# SPDX-License-Identifier: Apache-2.0
# Attach the eight Linux deb/rpm packages to a tag release built by
# Build and Release. GitHub reads workflow_run only from the default
# branch, so this file has to live on main even when the tag workflow
# itself runs from a release branch. It wraps that build's Linux zip
# artifact with build_deb.sh and build_rpm.sh after the zip matches
# the release SHA256SUMS. It does not compile RustFS and it does not
# replace an existing package asset.
#
# Dispatch with the tag to backfill a release while the build artifacts
# still exist. That upload is a live release write; run it from main
# only after this workflow is merged.
name: Package DEB/RPM
on:
workflow_run:
workflows: ["Build and Release"]
types: [completed]
workflow_dispatch:
inputs:
tag:
description: "Release tag to package, such as 1.0.7. No leading v."
required: true
type: string
build_run_id:
description: "Successful Build and Release run ID for that tag. Leave empty to select the newest successful run."
required: false
type: string
default: ""
permissions:
contents: write
actions: read
concurrency:
group: package-deb-rpm-${{ github.event.workflow_run.head_branch || github.event.inputs.tag || github.run_id }}
cancel-in-progress: false
jobs:
resolve:
name: Resolve release build
if: >-
github.repository == 'rustfs/rustfs' &&
(github.event_name == 'workflow_dispatch' ||
(github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch != 'main'))
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
version: ${{ steps.resolve.outputs.version }}
build_type: ${{ steps.resolve.outputs.build_type }}
build_run_id: ${{ steps.resolve.outputs.build_run_id }}
tag: ${{ steps.resolve.outputs.tag }}
steps:
- name: Resolve build run
id: resolve
shell: bash
env:
GH_TOKEN: ${{ github.token }}
EVENT_NAME: ${{ github.event_name }}
REPOSITORY: ${{ github.repository }}
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
WORKFLOW_RUN_ID: ${{ github.event.workflow_run.id }}
INPUT_TAG: ${{ github.event.inputs.tag }}
INPUT_RUN_ID: ${{ github.event.inputs.build_run_id }}
run: |
set -euo pipefail
fail() {
printf '%s\n' "$1" >&2
exit 1
}
tag=""
build_run_id=""
case "$EVENT_NAME" in
workflow_run)
tag="${HEAD_BRANCH}"
build_run_id="${WORKFLOW_RUN_ID}"
;;
workflow_dispatch)
tag="${INPUT_TAG}"
build_run_id="${INPUT_RUN_ID}"
;;
*) fail "unsupported event: ${EVENT_NAME}" ;;
esac
semver_core='(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)'
prerelease_id='(alpha|beta|rc)\.(0|[1-9][0-9]*)'
if [[ "$tag" =~ ^${semver_core}(-${prerelease_id})?-preview\.(0|[1-9][0-9]*)$ ]]; then
build_type=preview
elif [[ "$tag" =~ ^${semver_core}-${prerelease_id}$ ]]; then
build_type=prerelease
elif [[ "$tag" =~ ^${semver_core}$ ]]; then
build_type=release
else
fail "tag is not a supported strict package version"
fi
if [[ -n "$build_run_id" ]]; then
[[ "$build_run_id" =~ ^[1-9][0-9]*$ ]] || fail "build run ID must be a positive decimal integer"
else
build_run_id=$(gh api --method GET \
"repos/${REPOSITORY}/actions/workflows/build.yml/runs" \
-f branch="$tag" -f status=success -F per_page=1 \
--jq '.workflow_runs[0].id // empty')
[[ "$build_run_id" =~ ^[1-9][0-9]*$ ]] || fail "no successful build run found for tag"
fi
run_json=$(gh api "repos/${REPOSITORY}/actions/runs/${build_run_id}")
run_id=$(jq -r '.id // empty' <<<"$run_json")
run_status=$(jq -r '.status // empty' <<<"$run_json")
run_conclusion=$(jq -r '.conclusion // empty' <<<"$run_json")
run_event=$(jq -r '.event // empty' <<<"$run_json")
run_path=$(jq -r '.path // empty' <<<"$run_json")
head_sha=$(jq -r '.head_sha // empty' <<<"$run_json")
run_head_branch=$(jq -r '.head_branch // empty' <<<"$run_json")
[[ "$run_id" == "$build_run_id" ]] || fail "run metadata ID mismatch"
[[ "$run_status" == completed && "$run_conclusion" == success ]] || fail "selected build run is not successful"
[[ "$run_event" == push ]] || fail "selected build run is not a tag push"
[[ "$run_path" == .github/workflows/build.yml ]] || fail "selected run is not Build and Release"
[[ "$head_sha" =~ ^[0-9a-f]{40}$ ]] || fail "selected build run has an invalid head SHA"
[[ "$run_head_branch" == "$tag" ]] || fail "tag and build run head branch do not match"
tag_json=$(gh api "repos/${REPOSITORY}/git/ref/tags/${tag}")
tag_type=$(jq -r '.object.type // empty' <<<"$tag_json")
tag_sha=$(jq -r '.object.sha // empty' <<<"$tag_json")
depth=0
while [[ "$tag_type" == tag && "$depth" -lt 5 ]]; do
tag_json=$(gh api "repos/${REPOSITORY}/git/tags/${tag_sha}")
tag_type=$(jq -r '.object.type // empty' <<<"$tag_json")
tag_sha=$(jq -r '.object.sha // empty' <<<"$tag_json")
depth=$((depth + 1))
done
[[ "$tag_type" == commit && "$tag_sha" == "$head_sha" ]] || fail "release tag commit and build run head SHA do not match"
{
printf 'version=%s\n' "$tag"
printf 'build_type=%s\n' "$build_type"
printf 'build_run_id=%s\n' "$build_run_id"
printf 'tag=%s\n' "$tag"
} >> "$GITHUB_OUTPUT"
package:
name: Package (${{ matrix.arch }}-${{ matrix.libc }})
needs: resolve
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
libc: gnu
deb_arch: amd64
deb_depends: "libc6 (>= 2.31)"
rpm_depends: "glibc >= 2.31"
- arch: aarch64
libc: gnu
deb_arch: arm64
deb_depends: "libc6 (>= 2.31)"
rpm_depends: "glibc >= 2.31"
- arch: x86_64
libc: musl
deb_arch: amd64
deb_depends: ""
rpm_depends: ""
- arch: aarch64
libc: musl
deb_arch: arm64
deb_depends: ""
rpm_depends: ""
steps:
- name: Checkout packaging recipe
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
with:
persist-credentials: false
- name: Install DEB and RPM tools
shell: bash
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y ruby ruby-dev build-essential rpm fakeroot cpio
sudo gem install fpm --version 1.17.0 --no-document
- name: Download the build artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: rustfs-linux-${{ matrix.arch }}-${{ matrix.libc }}-v${{ needs.resolve.outputs.version }}
path: binary-artifact
run-id: ${{ needs.resolve.outputs.build_run_id }}
github-token: ${{ github.token }}
- name: Check the artifact against the published checksum
shell: bash
env:
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
TAG: ${{ needs.resolve.outputs.tag }}
ARCH: ${{ matrix.arch }}
LIBC: ${{ matrix.libc }}
VERSION: ${{ needs.resolve.outputs.version }}
run: |
set -euo pipefail
zip_name="rustfs-linux-${ARCH}-${LIBC}-v${VERSION}.zip"
[[ "$zip_name" =~ ^rustfs-linux-(x86_64|aarch64)-(gnu|musl)-v[0-9A-Za-z.-]+[.]zip$ ]]
[[ -f "binary-artifact/${zip_name}" ]]
mkdir -p "$RUNNER_TEMP/source"
gh release download "$TAG" --repo "$REPOSITORY" \
--pattern SHA256SUMS --dir "$RUNNER_TEMP/source"
digest=$(sha256sum "binary-artifact/${zip_name}" | awk '{print $1}')
python3 scripts/release/refresh_release_checksums.py verify \
--checksum "$RUNNER_TEMP/source/SHA256SUMS" \
--name "$zip_name" \
--digest "$digest" \
--digest-length 64
mkdir -p ./bin
unzip -q "binary-artifact/${zip_name}" -d ./bin
[[ -f ./bin/rustfs ]]
chmod 755 ./bin/rustfs
- name: Build deb and rpm
shell: bash
env:
BUILD_TYPE: ${{ needs.resolve.outputs.build_type }}
VERSION: ${{ needs.resolve.outputs.version }}
ARCH: ${{ matrix.arch }}
LIBC: ${{ matrix.libc }}
DEB_ARCH: ${{ matrix.deb_arch }}
DEB_DEPENDS: ${{ matrix.deb_depends }}
RPM_DEPENDS: ${{ matrix.rpm_depends }}
run: |
set -euo pipefail
normalized=$(./scripts/release/package_versions.sh "$BUILD_TYPE" "$VERSION" "" "$ARCH" "$LIBC")
declare -A meta=()
while IFS= read -r line; do
key=${line%%=*}
value=${line#*=}
case "$key" in
deb_version|rpm_version|rpm_release|deb_file|rpm_file) meta[$key]="$value" ;;
*) printf 'unexpected package metadata %s\n' "$key" >&2; exit 1 ;;
esac
done <<<"$normalized"
[[ "${#meta[@]}" -eq 5 ]]
export DEB_VERSION="${meta[deb_version]}"
export RPM_VERSION="${meta[rpm_version]}"
export RPM_RELEASE="${meta[rpm_release]}"
export DEB_FILE="${meta[deb_file]}"
export RPM_FILE="${meta[rpm_file]}"
export RPM_ARCH="$ARCH"
bash scripts/release/build_deb.sh
bash scripts/release/build_rpm.sh
expected=$(sha256sum ./bin/rustfs | awk '{print $1}')
unpack=$(mktemp -d)
dpkg-deb --extract "$DEB_FILE" "$unpack"
[[ "$(sha256sum "$unpack/usr/bin/rustfs" | awk '{print $1}')" == "$expected" ]]
rm -rf "$unpack"
unpack=$(mktemp -d)
rpm2cpio "$RPM_FILE" | (cd "$unpack" && cpio --extract --make-directories --quiet ./usr/bin/rustfs)
[[ "$(sha256sum "$unpack/usr/bin/rustfs" | awk '{print $1}')" == "$expected" ]]
rm -rf "$unpack"
printf '%s\n%s\n' "$DEB_FILE" "$RPM_FILE" > "$RUNNER_TEMP/package-names"
- name: Upload packages to the GitHub release
shell: bash
env:
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
TAG: ${{ needs.resolve.outputs.tag }}
run: |
set -euo pipefail
mapfile -t names < "$RUNNER_TEMP/package-names"
[[ "${#names[@]}" -eq 2 ]]
for file in "${names[@]}"; do
[[ -f "$file" && "$file" =~ ^[A-Za-z0-9._-]+$ ]]
digest=$(sha256sum "$file" | awk '{print $1}')
existing=$(gh api "repos/${REPOSITORY}/releases/tags/${TAG}" \
--jq ".assets[] | select(.name == \"${file}\") | .digest")
if [[ -z "$existing" ]]; then
gh release upload "$TAG" "$file" --repo "$REPOSITORY"
elif [[ "$existing" == "sha256:${digest}" ]]; then
printf 'release already has %s\n' "$file"
else
printf 'existing release asset %s has a different digest\n' "$file" >&2
exit 1
fi
done
- name: Upload package artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: packages-${{ matrix.arch }}-${{ matrix.libc }}
path: |
*.deb
*.rpm
if-no-files-found: error
retention-days: 30
checksums:
name: Refresh release checksums
needs: [resolve, package]
if: github.repository == 'rustfs/rustfs' && needs.resolve.result == 'success' && needs.package.result == 'success'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout checksum helper
uses: actions/checkout@f548e57e544e1ff5a4c46bf1e1b8685f8e4a348a # v7
with:
persist-credentials: false
- name: Download built packages
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: packages-*
merge-multiple: true
path: packages
- name: Rewrite SHA256SUMS and SHA512SUMS
shell: bash
env:
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
TAG: ${{ needs.resolve.outputs.tag }}
BUILD_TYPE: ${{ needs.resolve.outputs.build_type }}
VERSION: ${{ needs.resolve.outputs.version }}
run: |
set -euo pipefail
mapfile -t files < <(find packages -type f \( -name '*.deb' -o -name '*.rpm' \) | sort)
[[ "${#files[@]}" -eq 8 ]]
declare -A present=()
for file in "${files[@]}"; do
present["$(basename "$file")"]=1
done
for arch in x86_64 aarch64; do
for libc in gnu musl; do
normalized=$(./scripts/release/package_versions.sh "$BUILD_TYPE" "$VERSION" "" "$arch" "$libc")
while IFS= read -r line; do
key=${line%%=*}
value=${line#*=}
case "$key" in
deb_file|rpm_file)
[[ -n "${present[$value]:-}" ]] || { printf 'missing package %s\n' "$value" >&2; exit 1; }
;;
esac
done <<<"$normalized"
done
done
mkdir -p "$RUNNER_TEMP/checksums"
gh release download "$TAG" --repo "$REPOSITORY" \
--pattern SHA256SUMS --pattern SHA512SUMS \
--dir "$RUNNER_TEMP/checksums"
python3 scripts/release/refresh_release_checksums.py refresh \
--checksum "$RUNNER_TEMP/checksums/SHA256SUMS" \
--output "$RUNNER_TEMP/checksums/SHA256SUMS.next" \
--algorithm sha256 --digest-length 64 \
"${files[@]}"
python3 scripts/release/refresh_release_checksums.py refresh \
--checksum "$RUNNER_TEMP/checksums/SHA512SUMS" \
--output "$RUNNER_TEMP/checksums/SHA512SUMS.next" \
--algorithm sha512 --digest-length 128 \
"${files[@]}"
# Checksums are the only assets this workflow replaces. Package
# bytes uploaded above are left in place.
mv "$RUNNER_TEMP/checksums/SHA256SUMS.next" "$RUNNER_TEMP/checksums/SHA256SUMS"
mv "$RUNNER_TEMP/checksums/SHA512SUMS.next" "$RUNNER_TEMP/checksums/SHA512SUMS"
gh release upload "$TAG" \
"$RUNNER_TEMP/checksums/SHA256SUMS" \
"$RUNNER_TEMP/checksums/SHA512SUMS" \
--repo "$REPOSITORY" --clobber
verify=$(mktemp -d)
gh release download "$TAG" --repo "$REPOSITORY" \
--pattern SHA256SUMS --pattern SHA512SUMS --dir "$verify" --clobber
cmp "$RUNNER_TEMP/checksums/SHA256SUMS" "$verify/SHA256SUMS"
cmp "$RUNNER_TEMP/checksums/SHA512SUMS" "$verify/SHA512SUMS"
Generated
+29 -38
View File
@@ -255,7 +255,7 @@ version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc"
dependencies = [
"windows-sys 0.61.2",
"windows-sys 0.60.2",
]
[[package]]
@@ -266,7 +266,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d"
dependencies = [
"anstyle",
"once_cell_polyfill",
"windows-sys 0.61.2",
"windows-sys 0.60.2",
]
[[package]]
@@ -2015,7 +2015,7 @@ dependencies = [
"maybe-owned",
"rustix",
"rustix-linux-procfs",
"windows-sys 0.61.2",
"windows-sys 0.60.2",
"winx",
]
@@ -4186,7 +4186,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
"windows-sys 0.59.0",
"windows-sys 0.60.2",
]
[[package]]
@@ -4507,7 +4507,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e35d6e78f4cebb90e51d543db8fe41528851d6deeef6ef21ebd4bfdc1e784776"
dependencies = [
"libc",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -4701,7 +4701,7 @@ checksum = "94e7099f6313ecacbe1256e8ff9d617b75d1bcb16a6fddef94866d225a01a14a"
dependencies = [
"io-lifetimes 2.0.4",
"rustix",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -5892,7 +5892,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20fd6de4ccfcc187e38bc21cfa543cb5a302cb86a8b114eb7f0bf0dc9f8ac00f"
dependencies = [
"io-lifetimes 3.0.1",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -7196,7 +7196,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
"windows-sys 0.59.0",
"windows-sys 0.60.2",
]
[[package]]
@@ -9149,7 +9149,7 @@ dependencies = [
"once_cell",
"socket2",
"tracing",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -9483,7 +9483,7 @@ dependencies = [
"cfg-if",
"libc",
"rustix",
"windows-sys 0.61.2",
"windows-sys 0.60.2",
]
[[package]]
@@ -10434,7 +10434,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway"
version = "0.67.0"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"arc-swap",
"bytes",
@@ -10481,7 +10481,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway-core"
version = "0.64.0"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"bytes",
"futures-core",
@@ -10502,7 +10502,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway-corpus"
version = "0.1.0"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"serde",
"serde_json",
@@ -10512,7 +10512,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway-corpus-recorder"
version = "0.1.0"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"bytes",
"http 1.5.0",
@@ -10527,7 +10527,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway-dialect-rustfs-admin"
version = "0.13.0"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"bytes",
"form_urlencoded",
@@ -10541,7 +10541,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway-http"
version = "0.1.4"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"hmac 0.13.0",
"http 1.5.0",
@@ -10559,7 +10559,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway-macros"
version = "0.1.4"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"proc-macro2",
"quote",
@@ -10569,7 +10569,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway-sig"
version = "0.16.0"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"hmac 0.13.0",
"http 1.5.0",
@@ -10584,7 +10584,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway-stream"
version = "0.2.0"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"bitflags 2.13.2",
"bytes",
@@ -10595,7 +10595,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway-types"
version = "0.42.0+aws.2026-10-02"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"bytes",
"crc-fast",
@@ -10617,7 +10617,7 @@ dependencies = [
[[package]]
name = "rustfs-gateway-xml"
version = "0.4.0"
source = "git+https://github.com/rustfs/gateway.git?rev=095d4763a3f58a5e1d22fe7a231bf1c105473de8#095d4763a3f58a5e1d22fe7a231bf1c105473de8"
source = "git+https://github.com/rustfs/gateway.git?rev=b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b#b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b"
dependencies = [
"quick-xml 0.41.0",
]
@@ -11873,7 +11873,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -11955,7 +11955,7 @@ dependencies = [
"security-framework",
"security-framework-sys",
"webpki-root-certs",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -12779,7 +12779,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4"
dependencies = [
"libc",
"windows-sys 0.61.2",
"windows-sys 0.60.2",
]
[[package]]
@@ -12930,7 +12930,7 @@ dependencies = [
"cfg-if",
"libc",
"psm",
"windows-sys 0.61.2",
"windows-sys 0.60.2",
]
[[package]]
@@ -13241,7 +13241,7 @@ dependencies = [
"getrandom 0.3.4",
"once_cell",
"rustix",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -14354,7 +14354,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -14509,15 +14509,6 @@ dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.59.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b"
dependencies = [
"windows-targets 0.52.6",
]
[[package]]
name = "windows-sys"
version = "0.60.2"
@@ -14690,7 +14681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f3fd376f71958b862e7afb20cfe5a22830e1963462f3a17f49d82a6c1d1f42d"
dependencies = [
"bitflags 2.13.2",
"windows-sys 0.59.0",
"windows-sys 0.52.0",
]
[[package]]
@@ -14962,7 +14953,7 @@ dependencies = [
"sha1 0.11.0",
"time",
"typed-path",
"windows-sys 0.61.2",
"windows-sys 0.60.2",
"zeroize",
"zopfli",
"zstd 0.14.4",
+7 -7
View File
@@ -153,17 +153,17 @@ rustfs-utils = { path = "crates/utils", version = "1.0.5" }
rustfs-zip = { path = "./crates/zip", version = "1.0.5" }
# Pin the gateway and its protocol crates to the same revision.
rustfs-gateway-types = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.42.0", default-features = false }
rustfs-gateway-stream = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.2.0", default-features = false }
rustfs-gateway-types = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.42.0", default-features = false }
rustfs-gateway-stream = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.2.0", default-features = false }
# The gateway framework itself, consumed for its extension traits by the ring-2
# adapter. `default-features = false` keeps the `server` feature, and with it the
# server crate, out of the build.
rustfs-gateway = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.67.0", default-features = false }
rustfs-gateway = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.67.0", default-features = false }
# Test-only: builds the `EffectiveHost` a host-resolution test queries with.
rustfs-gateway-http = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", default-features = false }
rustfs-gateway-core = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.64.0", default-features = false }
rustfs-gateway-corpus-recorder = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.1.0", default-features = false }
rustfs-gateway-dialect-rustfs-admin = { git = "https://github.com/rustfs/gateway.git", rev = "095d4763a3f58a5e1d22fe7a231bf1c105473de8", version = "0.13.0", default-features = false }
rustfs-gateway-http = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", default-features = false }
rustfs-gateway-core = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.64.0", default-features = false }
rustfs-gateway-corpus-recorder = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.1.0", default-features = false }
rustfs-gateway-dialect-rustfs-admin = { git = "https://github.com/rustfs/gateway.git", rev = "b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b", version = "0.13.0", default-features = false }
# Async Runtime and Networking
async-channel = "2.5.0"
@@ -829,6 +829,8 @@ async fn test_bucket_tags_opa_contract() -> TestResult {
.send()
.await?;
opa.expect_bucket_tags("s3:PutObject", source, Some("finance")).await?;
// A non-empty x-amz-tagging header is authorized after PutObject.
opa.expect_bucket_tags("s3:PutObjectTagging", source, Some("finance")).await?;
let version = written.version_id().ok_or("versioned PUT must return a version ID")?;
let read = client
.get_object()
@@ -904,6 +906,8 @@ async fn test_bucket_tags_opa_contract() -> TestResult {
opa.expect_versioned_tag_permission(source, "report", version).await?;
}
opa.expect_bucket_tags("s3:PutObject", destination, Some("finance")).await?;
opa.expect_bucket_tags("s3:PutObjectTagging", destination, Some("finance"))
.await?;
}
let tags = admin.get_object_tagging().bucket(destination).key("copied").send().await?;
assert_eq!(tags.tag_set().len(), 1);
+115 -12
View File
@@ -1079,8 +1079,9 @@ fn clamp_ask_disks_to_available(ask_disks: i32, available_disks: usize) -> i32 {
ask_disks.min(bounded_usize_to_i32(available_disks))
}
fn parse_version_marker(marker: String) -> Result<VersionMarker> {
Ok(VersionMarker::parse(marker)?)
fn parse_version_marker(bucket: &str, key_marker: Option<&str>, marker: String) -> Result<VersionMarker> {
VersionMarker::parse(&marker)
.map_err(|_| StorageError::InvalidVersionID(bucket.to_owned(), key_marker.unwrap_or_default().to_owned(), marker))
}
fn version_marker_for_entries(
@@ -1498,11 +1499,9 @@ impl ECStore {
}
let has_version_marker = version_marker.is_some();
let version_marker = if let Some(marker) = version_marker {
Some(parse_version_marker(marker)?)
} else {
None
};
let version_marker = version_marker
.map(|raw| parse_version_marker(bucket, marker.as_deref(), raw))
.transpose()?;
let effective_max_keys = list_versions_scan_limit(max_keys, has_version_marker);
let opts = ListPathOptions {
@@ -2987,7 +2986,9 @@ impl SetDisks {
}
let has_version_marker = version_marker.is_some();
let version_marker = version_marker.map(parse_version_marker).transpose()?;
let version_marker = version_marker
.map(|raw| parse_version_marker(bucket, marker.as_deref(), raw))
.transpose()?;
let effective_max_keys = list_versions_scan_limit(max_keys, has_version_marker);
let opts = ListPathOptions {
bucket: bucket.to_owned(),
@@ -5356,6 +5357,87 @@ mod test {
assert!(resumed.next_continuation_token.is_none());
}
#[tokio::test]
async fn list_object_versions_rejects_invalid_version_id_marker_and_accepts_control_delimiter() {
use crate::storage_api_contracts::bucket::BucketOperations as _;
use crate::storage_api_contracts::object::ObjectIO as _;
let bucket = "invalid-version-marker";
let (_dirs, store) = crate::bucket::metadata_sys::test_support::isolated_store_over_temp_disks().await;
crate::bucket::metadata_sys::init_bucket_metadata_sys(store.clone(), Vec::new()).await;
store
.make_bucket(bucket, &crate::storage_api_contracts::bucket::MakeBucketOptions::default())
.await
.expect("create bucket");
store
.put_object(
bucket,
"obj-a",
&mut crate::object_api::PutObjReader::from_vec(vec![1]),
&crate::object_api::ObjectOptions::default(),
)
.await
.expect("seed object");
let err = store
.clone()
.inner_list_object_versions(bucket, "", Some("k".to_string()), Some("v".to_string()), Some("\x0f".to_string()), 8)
.await
.expect_err("non-UUID version-id-marker must be rejected");
assert!(
matches!(
&err,
StorageError::InvalidVersionID(err_bucket, err_key, err_version)
if err_bucket == bucket && err_key == "k" && err_version == "v"
),
"expected InvalidVersionID, got: {err:?}"
);
let delete_err = store.pools[0].disk_set[0]
.clone()
.inner_list_object_versions_for_recursive_delete(bucket, "", Some("k".to_string()), Some("v".to_string()), 8)
.await
.expect_err("recursive-delete listing must reject non-UUID version-id-marker");
assert!(
matches!(
&delete_err,
StorageError::InvalidVersionID(err_bucket, err_key, err_version)
if err_bucket == bucket && err_key == "k" && err_version == "v"
),
"expected InvalidVersionID, got: {delete_err:?}"
);
let control_delim_page = store
.clone()
.inner_list_object_versions(bucket, "", None, None, Some("\x0f".to_string()), 8)
.await
.expect("control-character delimiter without version-id-marker must succeed");
assert_eq!(
control_delim_page
.objects
.iter()
.map(|object| object.name.as_str())
.collect::<Vec<_>>(),
vec!["obj-a"]
);
assert!(control_delim_page.prefixes.is_empty());
let valid_null_marker_page = store
.clone()
.inner_list_object_versions(bucket, "", Some("k".to_string()), Some("null".to_string()), Some("\x0f".to_string()), 8)
.await
.expect("valid null version-id-marker with control-character delimiter must succeed");
assert_eq!(
valid_null_marker_page
.objects
.iter()
.map(|object| object.name.as_str())
.collect::<Vec<_>>(),
vec!["obj-a"]
);
assert!(valid_null_marker_page.prefixes.is_empty());
}
// ECA-03 / #944: a page whose raw keys fully collapse into fewer than max_keys
// common prefixes must still report truncation and carry a continuation marker,
// otherwise every key beyond the scan window is silently dropped.
@@ -8445,12 +8527,33 @@ mod test {
#[test]
fn test_null_version_marker_handling() {
let parsed = parse_version_marker("null".to_string()).expect("null marker should parse");
let parsed = parse_version_marker("bucket", Some("key"), "null".to_string()).expect("null marker should parse");
assert_eq!(parsed, VersionMarker::Null);
let valid_uuid = "550e8400-e29b-41d4-a716-446655440000";
let parsed = parse_version_marker(valid_uuid.to_string()).expect("uuid marker should parse");
let parsed = parse_version_marker("bucket", Some("key"), valid_uuid.to_string()).expect("uuid marker should parse");
assert_eq!(parsed, VersionMarker::Version(Uuid::parse_str(valid_uuid).unwrap()));
let invalid = parse_version_marker("bkt", Some("k"), "v".to_string()).expect_err("invalid marker should fail");
assert!(
matches!(
&invalid,
StorageError::InvalidVersionID(bucket, key, version)
if bucket == "bkt" && key == "k" && version == "v"
),
"expected InvalidVersionID, got: {invalid:?}"
);
let invalid_without_key =
parse_version_marker("bkt", None, "v".to_string()).expect_err("invalid marker without key should fail");
assert!(
matches!(
&invalid_without_key,
StorageError::InvalidVersionID(bucket, key, version)
if bucket == "bkt" && key.is_empty() && version == "v"
),
"expected InvalidVersionID with empty key, got: {invalid_without_key:?}"
);
}
/// Test that next_version_idmarker returns "null" for non-versioned objects
@@ -8476,7 +8579,7 @@ mod test {
// Server parses "null" as an explicit null-version marker
let server_response = "null";
let client_request = server_response;
let parsed = parse_version_marker(client_request.to_string()).expect("null marker should parse");
let parsed = parse_version_marker("bucket", Some("key"), client_request.to_string()).expect("null marker should parse");
assert_eq!(parsed, VersionMarker::Null);
// Scenario 2: Versioned object
@@ -8486,7 +8589,7 @@ mod test {
let uuid_str = "550e8400-e29b-41d4-a716-446655440000";
let server_response = uuid_str;
let client_request = server_response;
let parsed = parse_version_marker(client_request.to_string()).expect("uuid marker should parse");
let parsed = parse_version_marker("bucket", Some("key"), client_request.to_string()).expect("uuid marker should parse");
assert_eq!(parsed, VersionMarker::Version(Uuid::parse_str(uuid_str).unwrap()));
}
-2
View File
@@ -74,8 +74,6 @@ Cross-registry publication is not atomic. A channel job can fail after some veri
Finish any in-flight legacy tag release, including its downstream Docker/package/Helm jobs, before enabling this cutover on main. Existing tags and Releases retain their identities. Do not feed a legacy public preview binary into the new promotion path: it embeds a different version and was not built from the frozen-input contract.
Release branches that still publish with the tag-triggered Build and Release workflow upload zip archives, provenance, an SBOM, and checksums. They do not build deb or rpm packages. GitHub runs a `workflow_run` listener from the default branch only, so `.github/workflows/package-deb-rpm.yml` is that listener: after a successful tag push it downloads that build's Linux zip artifacts, checks each zip against `SHA256SUMS`, wraps that binary with `scripts/release/build_deb.sh` and `scripts/release/build_rpm.sh`, and uploads the eight `rustfs-linux-{x86_64,aarch64}-{gnu,musl}-v<version>.{deb,rpm}` assets. It then rewrites `SHA256SUMS` and `SHA512SUMS` so the package lines match those assets. An existing package asset with a different digest is left unchanged and fails the job. Dispatch the same workflow from `main` with the release tag to backfill a release that is missing those packages; that dispatch writes to the live release, so run it only after this workflow is on `main`. `manual-main-packages.yml` can compile the same filenames for a tag, including `1.0.7`, but it only stores workflow artifacts and does not attach them. The certification publisher above still seals and publishes the same package names when a release goes through `release-complete.yml`.
All workflow responsibilities, triggers and schedule ownership remain registered in `.github/scheduled-validations.json`. The migration does not re-enable workflows disabled in GitHub. PR checks, cache warming, nightly development builds, functional chains, lab tests and monitoring retain their distinct purposes; shared source or cache does not make different feature/platform tests redundant. The watchdog allocates a runner only for relevant unsuccessful scheduled/chained runs, while its registry still determines ownership.
Run `actionlint`, the release contract suite and the workflow registry validator after changes. The Security Audit workflow also exercises actual GitHub artifact transport, DEB/RPM package extraction, both multi-platform OCI builders, local registry promotion and archive scanning. Native packaging jobs run only for relevant changes or a manual audit. Their payloads are explicit transport fixtures, not product release acceptance. See the [release skill](../../.agents/skills/rustfs-release-publish/SKILL.md) for field acceptance, human confirmation and post-release follow-up.
+1 -1
View File
@@ -16,4 +16,4 @@ The gateway release serves S3 with rustfs/gateway. Remove `RUSTFS_S3_STACK` from
| `PutBucketPolicy` (`#2684`, `8f81762a6`) | For a malformed JSON policy body, both versions return HTTP 400. The gateway returns the XML error code `MalformedPolicy` (matching AWS S3). RustFS `1.0.5` returns `InvalidArgument`. Clients that classify bucket-policy validation errors by code need to handle both during a rollout. |
| `CreateBucket` (`#2684`, `8676d2f3b`) | For a successful default-region `CreateBucket` (`200 OK`), the gateway returns HTTP `Location: /<bucket>` (matching AWS S3 and `c-bkt-0001`). RustFS `1.0.5` omits the `Location` header. Clients that inspect `Location` on bucket creation need to handle its presence on gateway nodes and absence on `1.0.5` nodes during a rollout. |
`c-sig-0598` is recorded in the [pinned gateway conformance rulings](https://github.com/rustfs/gateway/blob/095d4763a3f58a5e1d22fe7a231bf1c105473de8/conformance/rulings/rustfs-profile.toml); host-assembled conformance rulings are tracked in [`.config/conformance-rulings.toml`](../../.config/conformance-rulings.toml), and the signed `PutBucketPolicy` and `CreateBucket` `accepted-change` rulings are recorded in `rustfs/backlog#2684`.
`c-sig-0598` is recorded in the [pinned gateway conformance rulings](https://github.com/rustfs/gateway/blob/b4ea5ca3638dfbb0e3f34a6db99db534433dfe1b/conformance/rulings/rustfs-profile.toml); host-assembled conformance rulings are tracked in [`.config/conformance-rulings.toml`](../../.config/conformance-rulings.toml), and the signed `PutBucketPolicy` and `CreateBucket` `accepted-change` rulings are recorded in `rustfs/backlog#2684`.
+2 -2
View File
@@ -127,7 +127,7 @@ The versioned plan is `.config/release-validation-plan.json` (`schema_version=1`
| Nightly Linux schedule, weekly desktop schedule, or dispatch | `build.yml` `build-rustfs` (development build of that schedule's platform subset, or the dispatch platform list) | build artifacts and the uncertified dev download channel; no release publication |
| Valid release or preview tag | `build.yml` `build-rustfs`, `release-certification`, `create-release`, `upload-release-assets`, `publish-release`, `promote-release-artifacts` | staged binaries, draft release, checksummed assets, then certified publish and promotion of the same bytes |
| Successful non-preview release-tag build (`workflow_run`) | `docker.yml` `release-certification`, `build-docker`, `scan-docker-image` | multi-architecture images staged, verified against the certification and promoted, plus vulnerability report |
| Successful release-tag build (`workflow_run`) | `package-deb-rpm.yml` `resolve`, `package`, `checksums` | eight Linux deb/rpm assets wrapped from the published zips, then SHA256SUMS and SHA512SUMS rewritten to include them |
| Successful release-tag build (`workflow_run`) | `package.yml` `release-certification`, `package`, `promote-packages` | DEB/RPM packages with wrapped-binary verification, staged then promoted with checksums |
| Successful non-preview release-tag build (`workflow_run`) | `helm-package.yml` `release-certification`, `build-helm-package`, `publish-helm-package` | versioned chart and repository index, only over a certified image promotion record |
| Final tag's release published | `build.yml` `cleanup-preview-releases` | deletes every `<target>-preview.<N>` Release for that target; the tags are kept |
@@ -140,7 +140,7 @@ Publication exits and their gate:
| `latest.json` version pointer | `build.yml` `update-latest-version` | transitively through `publish-release` |
| Image channels (Docker Hub, GHCR, Quay tags) | `docker.yml` `build-docker` promotion step | certified input digests, staged image binary identity and `verify-promotion`, then promotion of the same digest with `imagetools create` |
| Official R2 package paths `packages/release` and `packages/latest` | `package.yml` `promote-packages` | `release-certification` and wrapped-binary `verify-promotion`; the package job only stages |
| GitHub release package assets | `package-deb-rpm.yml` `package` and `checksums` | zip digest checked against the published SHA256SUMS, then deb/rpm upload without replacing a different digest; checksum files are rewritten to include the packages |
| GitHub release package assets | `package.yml` `package` | `release-certification` and wrapped-binary `verify-promotion` before upload |
| Helm chart repository (`rustfs/helm` push) | `helm-package.yml` `publish-helm-package` | `release-certification` plus the Docker workflow's image-promotion record bound to the same candidate |
Downstream workflows fail closed when the trusted certification is absent: a manual dispatch without certification fails and pushes no official tag. Only results from the trusted verification sources listed in the plan (currently the `rustfs/s3chaos` `release-gate.yml` envelope runs) carry release authority; a PR-uploaded JSON set cannot certify a release. Retries reuse the same candidate, only the staged bytes are promoted (no rebuild-after-verify), and no downstream step re-resolves a mutable `latest`.
@@ -338,4 +338,109 @@ mod tests {
.expect_err("no store");
assert_eq!(err.code(), &S3ErrorCode::InternalError);
}
#[test]
#[serial_test::serial]
fn list_object_versions_rejects_invalid_version_id_marker_with_bad_request_and_handles_control_delimiter() {
use crate::app::gating_test_env::{run_large_stack_test, shared_gating_ambient, shared_gating_ecstore};
use crate::app::metadata_listing::{MetadataListQuery, VersionsQuery};
use rustfs_gateway::{Limits, MetaView, OperationCodec, ResponseBody, TargetKind, WireRequest};
run_large_stack_test("list-versions-invalid-marker", || async {
let usecase = DefaultBucketUsecase::with_context(Some(shared_gating_ambient().await));
let store = shared_gating_ecstore().await;
let bucket = BucketName::new(format!("list-versions-marker-{}", uuid::Uuid::new_v4().simple())).unwrap();
store
.make_bucket(bucket.as_str(), &MakeBucketOptions::default())
.await
.unwrap();
let err = usecase
.execute_list_object_versions(
owned_envelope(http::Method::GET),
gateway_dto::ListObjectVersionsInput {
bucket: bucket.clone(),
key_marker: Some("k".to_owned()),
version_id_marker: Some(OpaqueString::from("v")),
delimiter: Some("\x0f".to_owned()),
max_keys: Some(8),
..Default::default()
},
)
.await
.expect_err("invalid version-id-marker must be rejected");
assert_eq!(err.code(), &S3ErrorCode::InvalidArgument);
assert_eq!(err.status_code(), Some(StatusCode::BAD_REQUEST));
let metadata_err = usecase
.list_object_versions_metadata(
&owned_envelope(http::Method::GET),
VersionsQuery {
listing: MetadataListQuery {
bucket: bucket.as_str().to_owned(),
delimiter: Some("\x0f".to_owned()),
max_keys: Some(8),
..Default::default()
},
key_marker: Some("k".to_owned()),
version_id_marker: Some("v".to_owned()),
},
)
.await
.expect_err("metadata listing must reject invalid version-id-marker");
assert_eq!(metadata_err.code(), &S3ErrorCode::InvalidArgument);
assert_eq!(metadata_err.status_code(), Some(StatusCode::BAD_REQUEST));
let output = usecase
.execute_list_object_versions(
owned_envelope(http::Method::GET),
gateway_dto::ListObjectVersionsInput {
bucket: bucket.clone(),
key_marker: Some("k".to_owned()),
version_id_marker: Some(OpaqueString::from("null")),
delimiter: Some("\x0f".to_owned()),
max_keys: Some(8),
..Default::default()
},
)
.await
.expect("valid version-id-marker with control delimiter must succeed");
assert_eq!(output.delimiter.as_deref(), Some("\x0f"));
let request = http::Request::get(format!("http://localhost/{}?versions&delimiter=%0F", bucket.as_str()))
.header(http::header::HOST, "localhost")
.body(bytes::Bytes::new())
.unwrap();
let wire = WireRequest::accept(request, &Limits::default()).unwrap();
let view = MetaView::of(&wire, TargetKind::Bucket).unwrap().with_rustfs_response_layout();
let encoded =
gateway_dto::ListObjectVersions::encode(output, &view, 200).expect("control delimiter response must encode");
assert_eq!(encoded.status, StatusCode::OK);
let ResponseBody::Complete(bytes) = encoded.body else {
panic!("ListObjectVersions must return an XML document");
};
let xml = String::from_utf8(bytes).expect("ListObjectVersions XML must be UTF-8");
assert!(xml.contains("<Delimiter>%0F</Delimiter>"), "unexpected XML: {xml}");
let metadata_output = usecase
.list_object_versions_metadata(
&owned_envelope(http::Method::GET),
VersionsQuery {
listing: MetadataListQuery {
bucket: bucket.as_str().to_owned(),
delimiter: Some("\x0f".to_owned()),
max_keys: Some(8),
..Default::default()
},
key_marker: Some("k".to_owned()),
version_id_marker: None,
},
)
.await
.expect("metadata listing with control delimiter must succeed");
metadata_output
.to_xml()
.expect("metadata listing XML with control delimiter must serialize");
});
}
}
+2 -5
View File
@@ -389,11 +389,8 @@ mod tests {
"every plaintext POST Object SSE-C form upload must increment the counter"
);
let logs = String::from_utf8(buffer.0.lock().expect("log buffer").clone()).expect("UTF-8 logs");
let warning_lines: Vec<_> = logs
.lines()
.filter(|line| line.contains("ssec_request_without_tls"))
.collect();
assert_eq!(warning_lines.len(), 1, "the plaintext SSE-C warning must fire once per process");
let warning_count = logs.lines().filter(|line| line.contains("ssec_request_without_tls")).count();
assert_eq!(warning_count, 1, "the plaintext SSE-C warning must fire once per process");
}
#[test]
-6
View File
@@ -77,12 +77,6 @@ fakeroot dpkg-deb --build "${PKG_DIR}" "$DEB_FILE"
[[ $(dpkg-deb -f "$DEB_FILE" Version) == "$DEB_VERSION" ]]
[[ $(dpkg-deb -f "$DEB_FILE" Architecture) == "$DEB_ARCH" ]]
dpkg-deb --fsys-tarfile "$DEB_FILE" | tar -tf - | grep -Fx './usr/bin/rustfs' >/dev/null
# dpkg keeps a locally modified conffile on upgrade. The path stays
# /etc/default/rustfs; this only records that file as a conffile.
control_dir=$(mktemp -d)
dpkg-deb --control "$DEB_FILE" "$control_dir"
grep -Fx '/etc/default/rustfs' "$control_dir/conffiles" >/dev/null
rm -rf "$control_dir"
stat --printf='%n %s bytes\n' "$DEB_FILE"
echo "deb_file=$DEB_FILE" >> "$GITHUB_OUTPUT"
echo "✅ DEB built: $DEB_FILE"
-5
View File
@@ -64,11 +64,6 @@ RPM_METADATA=$(rpm -qp --qf '%{NAME}\n%{VERSION}\n%{RELEASE}\n%{ARCH}\n' "$RPM_F
EXPECTED_METADATA=$(printf 'rustfs\n%s\n%s\n%s' "$RPM_VERSION" "$RPM_RELEASE" "$RPM_ARCH")
[[ "$RPM_METADATA" == "$EXPECTED_METADATA" ]]
rpm -qpl "$RPM_FILE" | grep -Fx '/usr/bin/rustfs' >/dev/null
# fpm 1.17 writes %config(noreplace). RPMFILE_CONFIG is 1 and
# RPMFILE_NOREPLACE is 16. Without noreplace, rpm replaces a modified
# /etc/default/rustfs and keeps the operator file only as .rpmsave.
config_flags=$(rpm -qp --qf '[%{filenames} %{fileflags}\n]' "$RPM_FILE" | awk '$1 == "/etc/default/rustfs" { print $2; found = 1 } END { if (!found) exit 1 }')
[[ $((config_flags & 17)) -eq 17 ]]
stat --printf='%n %s bytes\n' "$RPM_FILE"
echo "rpm_file=$RPM_FILE" >> "$GITHUB_OUTPUT"
echo "✅ RPM built: $RPM_FILE"
@@ -1,122 +0,0 @@
#!/usr/bin/env python3
# Copyright 2026 RustFS Team
# SPDX-License-Identifier: Apache-2.0
"""Keep a release checksum file aligned with Linux deb and rpm assets.
The legacy tag publisher writes SHA256SUMS and SHA512SUMS before packages
exist. This module preserves every unrelated line and replaces the package
lines with digests of the files just built. GitHub stores ``~`` in an asset
name as ``.``; checksum names use that stored form.
"""
from __future__ import annotations
import argparse
import hashlib
from pathlib import Path
import re
import sys
ASSET_NAME = re.compile(r"[A-Za-z0-9][A-Za-z0-9._+-]{0,200}")
def github_asset_name(filename: str) -> str:
name = Path(filename).name.replace("~", ".")
if ASSET_NAME.fullmatch(name) is None or name in {"SHA256SUMS", "SHA512SUMS"}:
raise ValueError(f"refusing checksum name {filename!r}")
return name
def parse_checksums(text: str, digest_length: int) -> list[tuple[str, str]]:
if digest_length not in (64, 128):
raise ValueError("checksum digest length must be 64 or 128")
rows: list[tuple[str, str]] = []
seen: set[str] = set()
for line_number, line in enumerate(text.splitlines(), 1):
if line.strip() == "":
continue
digest, separator, name = line.partition(" ")
if separator != " " or len(digest) != digest_length or any(character not in "0123456789abcdef" for character in digest):
raise ValueError(f"malformed checksum line {line_number}")
if ASSET_NAME.fullmatch(name) is None or name in seen:
raise ValueError(f"invalid checksum name on line {line_number}")
seen.add(name)
rows.append((digest, name))
if not rows:
raise ValueError("checksum file has no entries")
return rows
def lookup(text: str, name: str, digest_length: int) -> str:
asset = github_asset_name(name)
matches = [digest for digest, entry in parse_checksums(text, digest_length) if entry == asset]
if len(matches) != 1:
raise ValueError(f"checksum file has no single entry for {asset}")
return matches[0]
def refresh(text: str, packages: list[tuple[str, str]], digest_length: int) -> str:
if not packages:
raise ValueError("refusing to rewrite checksums with no packages")
rows = parse_checksums(text, digest_length)
replacements: dict[str, str] = {}
for filename, digest in packages:
asset = github_asset_name(filename)
if len(digest) != digest_length or any(character not in "0123456789abcdef" for character in digest):
raise ValueError(f"invalid digest for {asset}")
if asset in replacements and replacements[asset] != digest:
raise ValueError(f"conflicting digests for {asset}")
replacements[asset] = digest
# Keep every non-package line, including zip aliases, in its original
# order. Package lines are replaced or appended.
kept = [f"{digest} {name}" for digest, name in rows if name not in replacements]
if not kept:
raise ValueError("refusing to drop every existing checksum entry")
kept.extend(f"{digest} {name}" for name, digest in sorted(replacements.items()))
return "\n".join(kept) + "\n"
def file_digest(path: Path, algorithm: str) -> str:
hasher = hashlib.new(algorithm)
with path.open("rb") as stream:
for chunk in iter(lambda: stream.read(1024 * 1024), b""):
hasher.update(chunk)
return hasher.hexdigest()
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description=__doc__)
sub = parser.add_subparsers(dest="mode", required=True)
verify = sub.add_parser("verify")
verify.add_argument("--checksum", type=Path, required=True)
verify.add_argument("--name", required=True)
verify.add_argument("--digest", required=True)
verify.add_argument("--digest-length", type=int, required=True)
rewrite = sub.add_parser("refresh")
rewrite.add_argument("--checksum", type=Path, required=True)
rewrite.add_argument("--output", type=Path, required=True)
rewrite.add_argument("--algorithm", choices=("sha256", "sha512"), required=True)
rewrite.add_argument("--digest-length", type=int, required=True)
rewrite.add_argument("packages", nargs="+", type=Path)
args = parser.parse_args(argv)
if args.mode == "verify":
text = args.checksum.read_text(encoding="utf-8")
found = lookup(text, args.name, args.digest_length)
if found != args.digest:
print(f"checksum mismatch for {args.name}", file=sys.stderr)
return 1
return 0
length = args.digest_length
if (args.algorithm, length) not in {("sha256", 64), ("sha512", 128)}:
print("algorithm and digest length disagree", file=sys.stderr)
return 1
packages = [(github_asset_name(str(path)), file_digest(path, args.algorithm)) for path in args.packages]
args.output.write_text(refresh(args.checksum.read_text(encoding="utf-8"), packages, length), encoding="utf-8")
return 0
if __name__ == "__main__":
try:
raise SystemExit(main())
except (OSError, ValueError) as error:
print(error, file=sys.stderr)
raise SystemExit(1) from error
@@ -1,128 +0,0 @@
#!/usr/bin/env python3
# Copyright 2026 RustFS Team
# SPDX-License-Identifier: Apache-2.0
"""Checksum refresh and the legacy deb/rpm release follow-up."""
from __future__ import annotations
from pathlib import Path
import subprocess
import sys
import tempfile
import unittest
ROOT = Path(__file__).resolve().parents[2]
sys.path.insert(0, str(ROOT / "scripts"))
sys.path.insert(0, str(ROOT / "scripts" / "release"))
from ci_gate import workflow_document # noqa: E402
import refresh_release_checksums as checksums # noqa: E402
import validation_registry as registry # noqa: E402
WORKFLOW = ROOT / ".github" / "workflows" / "package-deb-rpm.yml"
def step_runs(job):
return [step.get("run", "") for step in job.get("steps", [])]
class ChecksumRefreshTests(unittest.TestCase):
def test_packages_are_appended_and_zip_lines_stay(self):
existing = "\n".join([
"a" * 64 + " rustfs-linux-x86_64-gnu-latest.zip",
"a" * 64 + " rustfs-linux-x86_64-gnu-v1.0.7.zip",
"b" * 64 + " rustfs-linux-x86_64-gnu-v1.0.7.deb",
"",
])
updated = checksums.refresh(existing, [
("dist/rustfs-linux-x86_64-gnu-v1.0.7.rpm", "c" * 64),
("dist/rustfs-linux-x86_64-gnu-v1.0.7.deb", "d" * 64),
], 64)
lines = updated.splitlines()
self.assertEqual(lines[0], "a" * 64 + " rustfs-linux-x86_64-gnu-latest.zip")
self.assertEqual(lines[1], "a" * 64 + " rustfs-linux-x86_64-gnu-v1.0.7.zip")
self.assertEqual(lines[2:], [
"d" * 64 + " rustfs-linux-x86_64-gnu-v1.0.7.deb",
"c" * 64 + " rustfs-linux-x86_64-gnu-v1.0.7.rpm",
])
self.assertTrue(updated.endswith("\n"))
def test_github_tilde_asset_names_match_the_stored_release_name(self):
self.assertEqual(
checksums.github_asset_name("rustfs-linux-x86_64-gnu-v1.0.0~rc.5.deb"),
"rustfs-linux-x86_64-gnu-v1.0.0.rc.5.deb")
def test_malformed_or_empty_checksums_are_rejected(self):
with self.assertRaises(ValueError):
checksums.parse_checksums("not-a-checksum\n", 64)
with self.assertRaises(ValueError):
checksums.refresh("aa only-one-space\n", [("pkg.deb", "d" * 64)], 64)
with self.assertRaises(ValueError):
checksums.refresh("", [("pkg.deb", "d" * 64)], 64)
def test_cli_verifies_a_published_zip_and_rewrites_packages(self):
with tempfile.TemporaryDirectory() as temp:
root = Path(temp)
package = root / "rustfs-linux-x86_64-musl-v1.0.7.deb"
package.write_bytes(b"package-bytes")
digest = checksums.file_digest(package, "sha256")
checksum = root / "SHA256SUMS"
checksum.write_text("e" * 64 + " rustfs-linux-x86_64-musl-v1.0.7.zip\n", encoding="utf-8")
script = ROOT / "scripts" / "release" / "refresh_release_checksums.py"
verified = subprocess.run(
[sys.executable, str(script), "verify", "--checksum", str(checksum),
"--name", "rustfs-linux-x86_64-musl-v1.0.7.zip", "--digest", "e" * 64,
"--digest-length", "64"],
capture_output=True, text=True, check=False)
self.assertEqual(verified.returncode, 0, verified.stderr)
mismatch = subprocess.run(
[sys.executable, str(script), "verify", "--checksum", str(checksum),
"--name", "rustfs-linux-x86_64-musl-v1.0.7.zip", "--digest", "f" * 64,
"--digest-length", "64"],
capture_output=True, text=True, check=False)
self.assertEqual(mismatch.returncode, 1)
output = root / "next"
rewritten = subprocess.run(
[sys.executable, str(script), "refresh", "--checksum", str(checksum),
"--output", str(output), "--algorithm", "sha256", "--digest-length", "64",
str(package)],
capture_output=True, text=True, check=False)
self.assertEqual(rewritten.returncode, 0, rewritten.stderr)
self.assertIn("e" * 64 + " rustfs-linux-x86_64-musl-v1.0.7.zip", output.read_text(encoding="utf-8"))
self.assertIn(digest + " rustfs-linux-x86_64-musl-v1.0.7.deb", output.read_text(encoding="utf-8"))
class PackageWorkflowTests(unittest.TestCase):
def test_tag_releases_attach_packages_and_refresh_checksums(self):
text = WORKFLOW.read_text(encoding="utf-8")
document = workflow_document(text)
events = document.get("on", document.get(True))
self.assertEqual(list(events), ["workflow_run", "workflow_dispatch"])
self.assertEqual(events["workflow_run"]["workflows"], ["Build and Release"])
self.assertEqual(events["workflow_run"]["types"], ["completed"])
self.assertEqual(events["workflow_dispatch"]["inputs"]["tag"]["required"], "true")
self.assertEqual(document["permissions"], {"contents": "write", "actions": "read"})
self.assertIn("github.repository == 'rustfs/rustfs'", document["jobs"]["resolve"]["if"])
self.assertIn("github.event.workflow_run.event == 'push'", document["jobs"]["resolve"]["if"])
self.assertIn("head_branch != 'main'", document["jobs"]["resolve"]["if"])
package_runs = "\n".join(step_runs(document["jobs"]["package"]))
self.assertIn("scripts/release/build_deb.sh", package_runs)
self.assertIn("scripts/release/build_rpm.sh", package_runs)
self.assertIn("fpm --version 1.17.0", package_runs)
self.assertIn("refresh_release_checksums.py verify", package_runs)
self.assertNotIn("--clobber", package_runs)
self.assertIn("different digest", package_runs)
checksum_runs = "\n".join(step_runs(document["jobs"]["checksums"]))
self.assertIn("refresh_release_checksums.py refresh", checksum_runs)
self.assertIn("SHA256SUMS", checksum_runs)
self.assertIn("SHA512SUMS", checksum_runs)
self.assertEqual(checksum_runs.count("--clobber"), 2)
self.assertIn('"${#files[@]}" -eq 8', checksum_runs)
self.assertEqual(
{item["arch"] + "-" + item["libc"] for item in document["jobs"]["package"]["strategy"]["matrix"]["include"]},
{"x86_64-gnu", "x86_64-musl", "aarch64-gnu", "aarch64-musl"})
item = registry.workflow_entry(".github/workflows/package-deb-rpm.yml")
self.assertEqual(item["name"], "Package DEB/RPM")
self.assertEqual(item["events"], ["workflow_run", "workflow_dispatch"])
if __name__ == "__main__":
unittest.main()
-16
View File
@@ -41,22 +41,6 @@ class PackageIntegrationTests(unittest.TestCase):
self.assertEqual(record["binary_sha256"], expected)
self.assertEqual(record["inputs_sha256"], c.digest(value))
self.assertEqual({Path(item["name"]).suffix for item in record["files"]}, {".deb", ".rpm"})
output = root / "output"
deb = next(output.glob("*.deb"))
rpm_package = next(output.glob("*.rpm"))
control = root / "control"
control.mkdir()
subprocess.run(["dpkg-deb", "--control", str(deb), str(control)], check=True)
self.assertIn("/etc/default/rustfs", (control / "conffiles").read_text(encoding="utf-8").splitlines())
listing = subprocess.check_output(
["rpm", "-qp", "--qf", "[%{filenames} %{fileflags}\\n]", str(rpm_package)], text=True)
flags = {}
for line in listing.splitlines():
path, bits = line.rsplit(" ", 1)
flags[path] = int(bits)
# RPMFILE_CONFIG (1) and RPMFILE_NOREPLACE (16). A modified
# /etc/default/rustfs must stay in place across an upgrade.
self.assertEqual(flags["/etc/default/rustfs"] & 17, 17)
def test_real_package_with_substituted_payload_is_rejected(self):
with tempfile.TemporaryDirectory() as temp: