suyanhanx opened a new pull request, #8516:
URL: https://github.com/apache/opendal/pull/8516

   # 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?
   
   - Add `opendal-service-baidu-netdisk`, the `services-baidu-netdisk` facade 
feature, and scheme registration.
   - Support stat, paginated list, ranged reads, directory creation, writes, 
copy, rename and delete.
   - Keep authentication inside the service: access tokens, serialized OAuth 
refresh, single-use refresh-token rotation, and an optional persistence 
callback.
   - Upload complete buffers through precreate, upload-server discovery, 4 MiB 
parts and create, using the actual block hashes. Preserve UTF-8 download 
filenames and allow RetryLayer to reconstruct a copy after temporary 
filemanager failures.
   - Document real-service test setup and explicitly skip the existing emoji 
copy case for Baidu, with a warning and the original filenames unchanged.
   
   ### 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 error 
`errno=111`, and the one-shot future made it persistent. Switched to 
`OneShotCopier::new_with` so RetryLayer can recreate the operation. The 
original focused case then passed against Baidu. **The full suite was not rerun 
after this fix**, and the focused rerun did not establish another occurrence of 
error 111.
   - Service unit tests (4), doctest (1), focused all-target Clippy with `-D 
warnings`, facade behavior compilation, and formatting checks passed.
   
   # Are there any user-facing changes?
   
   A new `baidu-netdisk` service 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 with `on_token_refresh` before 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. Account limits and download speed still apply.
   
   # Breaking changes
   
   # AI Usage Statement
   
   - **Harness:** Codex desktop.
   - **Model:** `gpt-6-astra`.
   - **Effort:** `high`.
   - **Role:** Assisted implementation, real-service probes, failure analysis, 
tests and documentation. The contributor supplied the test application/account 
and actively guided the work.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to