You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "userzhy (via GitHub)" <gi...@apache.org> on 2025/12/19 15:11:01 UTC
[PR] feat(services/upyun): Add user_metadata support [opendal]
userzhy opened a new pull request, #7068:
URL: https://github.com/apache/opendal/pull/7068
# Which issue does this PR close?
Part of #4842 (partially, upyun part).
# Rationale for this change
This PR implements user-defined metadata support for the upyun service, as tracked in issue #4842. User metadata allows users to store custom key-value pairs along with their files, which is useful for various use cases like storing file metadata such as `tenant`, `catalog`, `database`, `table`, etc.
# What changes are included in this PR?
- Added `X_UPYUN_META_PREFIX` constant (`x-upyun-meta-`) in `core.rs`
- Updated `upload` method to set user metadata headers when writing files
- Updated `initiate_multipart_upload` method to set user metadata headers for multipart uploads
- Added `write_with_user_metadata: true` capability in `backend.rs`
- Updated `stat` method to parse and return user metadata using `parse_prefixed_headers`
# Are there any user-facing changes?
Yes. Users can now use `write_with_user_metadata` to set custom metadata when uploading files to upyun, and retrieve the metadata via `stat` operation.
# AI Usage Statement
This PR was developed with the assistance of GitHub Copilot (Claude Opus 4.5).
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/upyun): Add user_metadata support [opendal]
Posted by "Xuanwo (via GitHub) via commits" <co...@opendal.apache.org>.
Xuanwo commented on code in PR #7068:
URL: https://github.com/apache/opendal/pull/7068#discussion_r4652391129
##########
core/services/upyun/src/backend.rs:
##########
@@ -215,7 +217,17 @@ impl Access for UpyunBackend {
let status = resp.status();
match status {
- StatusCode::OK => parse_info(resp.headers()).map(RpStat::new),
+ StatusCode::OK => {
+ let headers = resp.headers();
+ let mut meta = parse_info(headers)?;
+
+ let user_meta = parse_prefixed_headers(headers, X_UPYUN_META_PREFIX);
Review Comment:
If Upyun returns `x-upyun-meta-cache-control` or `x-upyun-meta-content-disposition` in the `stat` response, this prefix scan would also expose them in `user_metadata` as `cache-control` or `content-disposition`. `parse_info` already maps both headers to dedicated fields. Could you verify which reserved headers Upyun returns and exclude them from `user_metadata` if present? [Header names](https://github.com/apache/opendal/blob/6526bd8b0aee621f6eefda223bb6f04d6b5d57d0/core/services/upyun/src/core.rs#L39-L40) ยท [Field parsing](https://github.com/apache/opendal/blob/6526bd8b0aee621f6eefda223bb6f04d6b5d57d0/core/services/upyun/src/core.rs#L550-L556)
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/upyun): Add user_metadata support [opendal]
Posted by "erickguan (via GitHub)" <gi...@apache.org>.
erickguan commented on PR #7068:
URL: https://github.com/apache/opendal/pull/7068#issuecomment-4760971684
For services that don't have behavior tests, e.g., upyun, we require behavior tests. You can set up your token locally and run:
```shell
OPENDAL_TEST=upyun cargo test behavior --features tests,services-upyun
```
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/upyun): Add user_metadata support [opendal]
Posted by "Xuanwo (via GitHub) via commits" <co...@opendal.apache.org>.
Xuanwo closed pull request #7068: feat(services/upyun): Add user_metadata support
URL: https://github.com/apache/opendal/pull/7068
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(services/upyun): Add user_metadata support [opendal]
Posted by "Xuanwo (via GitHub) via commits" <co...@opendal.apache.org>.
Xuanwo commented on PR #7068:
URL: https://github.com/apache/opendal/pull/7068#issuecomment-7371868844
Feel free to reopen this PR when you have time working on this again! ๐
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org