Skip to content

Commit

Permalink
Merge branch 'main' into cos-list-with-deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuanwo authored Jan 8, 2025
2 parents b786420 + 1c287eb commit 21d7d8f
Show file tree
Hide file tree
Showing 5 changed files with 1,348 additions and 841 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/release_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ jobs:
- { os: windows-latest }
- { os: macos-latest, target: "universal2-apple-darwin" }
- { os: ubuntu-latest, target: "x86_64" }
- { os: ubuntu-latest, target: "aarch64" }
- { os: ubuntu-latest, target: "aarch64", manylinux: "manylinux_2_28" }
- { os: ubuntu-latest, target: "armv7l" }
env:
# Workaround ring 0.17 build issue
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
Expand All @@ -75,15 +72,15 @@ jobs:
command: build
args: --release -o dist -i python3.11 --features=pyo3/extension-module,services-all,abi3
sccache: true
manylinux: auto
manylinux: ${{ matrix.manylinux || 'auto' }}
- uses: PyO3/maturin-action@v1
with:
working-directory: "bindings/python"
target: "${{ matrix.target }}"
command: build
args: --release -o dist -i python3.10 --features=pyo3/extension-module,services-all
sccache: true
manylinux: auto
manylinux: ${{ matrix.manylinux || 'auto' }}
- name: Build free-threaded wheels
# windows free-threading building doesn't work on windows
# https://github.com/apache/opendal/pull/5449#issuecomment-2560469190
Expand All @@ -95,7 +92,7 @@ jobs:
command: build
args: --release -o dist -i python3.13t --features=pyo3/extension-module,services-all
sccache: true
manylinux: auto
manylinux: ${{ matrix.manylinux || 'auto' }}
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand Down
44 changes: 25 additions & 19 deletions core/src/services/s3/lister.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,28 +222,34 @@ impl oio::PageList for S3ObjectVersionsLister {
ctx.entries.push_back(de);
}

if self.args.versions() {
for version_object in output.version {
let mut path = build_rel_path(&self.core.root, &version_object.key);
if path.is_empty() {
path = "/".to_owned();
}
for version_object in output.version {
// `list` must be additive, so we need to include the latest version object
// even if `versions` is not enabled.
//
// Here we skip all non-latest version objects if `versions` is not enabled.
if !(self.args.versions() || version_object.is_latest) {
continue;
}

let mut meta = Metadata::new(EntryMode::from_path(&path));
meta.set_version(&version_object.version_id);
meta.set_is_current(version_object.is_latest);
meta.set_content_length(version_object.size);
meta.set_last_modified(parse_datetime_from_rfc3339(
version_object.last_modified.as_str(),
)?);
if let Some(etag) = version_object.etag {
meta.set_etag(&etag);
meta.set_content_md5(etag.trim_matches('"'));
}
let mut path = build_rel_path(&self.core.root, &version_object.key);
if path.is_empty() {
path = "/".to_owned();
}

let entry = oio::Entry::new(&path, meta);
ctx.entries.push_back(entry);
let mut meta = Metadata::new(EntryMode::from_path(&path));
meta.set_version(&version_object.version_id);
meta.set_is_current(version_object.is_latest);
meta.set_content_length(version_object.size);
meta.set_last_modified(parse_datetime_from_rfc3339(
version_object.last_modified.as_str(),
)?);
if let Some(etag) = version_object.etag {
meta.set_etag(&etag);
meta.set_content_md5(etag.trim_matches('"'));
}

let entry = oio::Entry::new(&path, meta);
ctx.entries.push_back(entry);
}

if self.args.deleted() {
Expand Down
Loading

0 comments on commit 21d7d8f

Please sign in to comment.