Skip to content

Commit

Permalink
feat(services/yandex_disk): setup test for yandex disk (#4264)
Browse files Browse the repository at this point in the history
* feat(services/yandex_disk): setup test for yandex disk

* feat(services/yandex_disk): setup test for yandex disk

---------

Co-authored-by: shuai_yang <[email protected]>
  • Loading branch information
hoslo and shuai_yang authored Feb 26, 2024
1 parent a628a52 commit 6df728a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/services/yandex_disk/yandex_disk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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.

name: yandex_disk
description: 'Behavior test for Yandex Disk.'

runs:
using: "composite"
steps:
- name: Setup
uses: 1password/load-secrets-action@v1
with:
export-env: true
env:
OPENDAL_YANDEX_DISK_ACCESS_TOKEN: op://services/yandex_disk/access_token
2 changes: 2 additions & 0 deletions bindings/java/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ services-all = [
"services-b2",
"services-seafile",
"services-upyun",
"services-yandex-disk"
]

# Default services provided by opendal.
Expand Down Expand Up @@ -149,6 +150,7 @@ services-tikv = ["opendal/services-tikv"]
services-upyun = ["opendal/services-upyun"]
services-vercel-artifacts = ["opendal/services-vercel-artifacts"]
services-wasabi = ["opendal/services-wasabi"]
services-yandex-disk = ["opendal/services-yandex-disk"]

[dependencies]
anyhow = "1.0.71"
Expand Down
2 changes: 2 additions & 0 deletions bindings/nodejs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ services-all = [
"services-upyun",
"services-vercel-artifacts",
"services-wasabi",
"services-yandex-disk",
]

# Default services provided by opendal.
Expand Down Expand Up @@ -144,6 +145,7 @@ services-tikv = ["opendal/services-tikv"]
services-upyun = ["opendal/services-upyun"]
services-vercel-artifacts = ["opendal/services-vercel-artifacts"]
services-wasabi = ["opendal/services-wasabi"]
services-yandex-disk = ["opendal/services-yandex-disk"]

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 2 additions & 0 deletions bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ services-all = [
"services-seafile",
"services-upyun",
"services-koofr",
"services-yandex-disk"
]

# Default services provided by opendal.
Expand Down Expand Up @@ -146,6 +147,7 @@ services-tikv = ["opendal/services-tikv"]
services-upyun = ["opendal/services-upyun"]
services-vercel-artifacts = ["opendal/services-vercel-artifacts"]
services-wasabi = ["opendal/services-wasabi"]
services-yandex-disk = ["opendal/services-yandex-disk"]

[lib]
crate-type = ["cdylib"]
Expand Down
2 changes: 2 additions & 0 deletions core/src/services/yandex_disk/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ pub async fn parse_error(resp: Response<IncomingAsyncBody>) -> Result<Error> {
400 => (ErrorKind::InvalidInput, false),
410 | 403 => (ErrorKind::PermissionDenied, false),
404 => (ErrorKind::NotFound, false),
// We should retry it when we get 423 error.
423 => (ErrorKind::RateLimited, true),
499 => (ErrorKind::Unexpected, true),
503 | 507 => (ErrorKind::Unexpected, true),
_ => (ErrorKind::Unexpected, false),
Expand Down

0 comments on commit 6df728a

Please sign in to comment.