Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #8481.
Rationale for this change
Add access to Baidu Netdisk through the official Open Platform APIs. The implementation was exercised against a real application and account before and during development.
What changes are included in this PR?
opendal-service-baidu-netdisk, theservices-baidu-netdiskfacade feature, and scheme registration.Validation
Real-account probes covered OAuth refresh and persistence, multipart upload above 4 MiB, exact full/range readback across a block boundary, empty files, and file operations. Test data was cleaned up.
Full behavior run, single-threaded with a 300-second I/O timeout and unchanged random payload sizes: 128 passed, 1 failed, 0 ignored, 0 filtered, in 1190.54 seconds. Of the harness passes, 58 were early returns: the emoji compatibility skip and 57 unsupported-capability guards. The source/capability breakdown is therefore 70 checks passed, 1 failed, 58 early returns.
The failure was
test_copier_completion: filemanager returned busy errorerrno=111, and the one-shot future made it persistent. Switched toOneShotCopier::new_withso RetryLayer can recreate the operation. The original focused case then passed against Baidu. The full suite was not rerun after the copier or directory-operation fixes, and the focused rerun did not establish another occurrence of error 111.Focused all-target Clippy with
-D warnings, facade behavior compilation, and formatting checks passed.Latest real-account regression run: 27 operation checks passed on the updated source, including empty/non-empty destination-directory protection for copy/rename/write, directory-source rejection, non-recursive directory protection, slash-terminated deletion preserving same-named files, and recursive prefix deletion with both missing and existing exact targets. Checks verified preserved source/destination bytes, parent scope, nonmatching siblings, file overwrite, and repeated deletion. The harness exited successfully and its root was independently confirmed absent through the parent listing.
Nine unchanged existing behavior cases passed on the updated source: file, empty-directory, missing-path and recursive deletion; nested and overwrite copy/rename; empty-file write. These ran single-threaded with original random payload sizes and a 300-second I/O timeout. The isolated test root was cleaned and independently confirmed absent.
Are there any user-facing changes?
A new
baidu-netdiskservice is available. Configure a root beneath/apps/<application name>/and an authorized access token; automatic renewal additionally requires the application credentials and refresh token. Persist rotated tokens withon_token_refreshbefore restarting.Writes require the complete file in memory and are limited to 4 GiB; streaming writes and append are unsupported. Rename uses server-side copy followed by delete and is not atomic: live native move/rename rejected existing destinations despite requesting overwrite. Baidu also rejects the tested emoji and some supplementary Unicode filenames at final creation; names are never silently rewritten. Recursive deletion of a path ending in
/selects that directory only; without/, it removes all matching paths in the parent directory and matching directory trees. Non-recursive deletion checks directory emptiness before calling Baidu's recursive delete API. Emptiness checks, path-type checks and mutations are separate requests: concurrently added children or changed path types are not protected atomically. Account limits and download speed still apply.Breaking changes
AI Usage Statement
gpt-6-astra.high.