Skip to content

Conversation

@shruti2522
Copy link

Which issue does this PR close?

part of #5693 .

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@shruti2522 shruti2522 marked this pull request as ready for review May 27, 2025 12:25
@shruti2522 shruti2522 requested a review from Xuanwo as a code owner May 27, 2025 12:25
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels May 27, 2025
Comment on lines +50 to +60
if let Ok(body_str) = std::str::from_utf8(body) {
if let Ok(json) = serde_json::from_str::<serde_json::Value>(body_str) {
if let Some(content) = json.get("content") {
if let Some(sha) = content.get("sha").and_then(|v| v.as_str()) {
metadata.set_version(sha);
}
} else if let Some(sha) = json.get("sha").and_then(|v| v.as_str()) {
metadata.set_version(sha);
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, version in opendal means that users can read like op.read_with(path).version(version). Is it possibe for github service to do so?

If it does, maybe we can have a strong typed response struct here so that we don't need to handle it at runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants