Skip to content

Comments

feat(services/gdrive): Implement write returns metadata#6683

Merged
erickguan merged 7 commits intoapache:mainfrom
yunchipang:gdrive-write-returns-metadata
Oct 17, 2025
Merged

feat(services/gdrive): Implement write returns metadata#6683
erickguan merged 7 commits intoapache:mainfrom
yunchipang:gdrive-write-returns-metadata

Conversation

@yunchipang
Copy link
Contributor

@yunchipang yunchipang commented Oct 16, 2025

Which issue does this PR close?

part of #5693

Rationale for this change

What changes are included in this PR?

Adds the fields parameter which tells the gdrive API to include additional metadata in the response, and now returns id , name, mimeType, size, modifiedTime, md5Checksum, version. Relevant metadata is picked from docs.

Are there any user-facing changes?

@yunchipang yunchipang requested a review from Xuanwo as a code owner October 16, 2025 17:01
@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 Oct 16, 2025
Copy link
Member

@erickguan erickguan left a comment

Choose a reason for hiding this comment

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

Great, thank you! Just some documentation changes.

Optional: if you have made tests, can you add some test cases for models? An example is https://github.com/apache/opendal/blob/main/core/src/services/onedrive/graph_model.rs#L183

Copy link
Member

@erickguan erickguan left a comment

Choose a reason for hiding this comment

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

Nice progress. Some last comments.

@yunchipang yunchipang force-pushed the gdrive-write-returns-metadata branch from dc6c07a to e25e579 Compare October 16, 2025 22:26
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Oct 16, 2025
Copy link
Member

@erickguan erickguan left a comment

Choose a reason for hiding this comment

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

Thank you so much for your contribution!


I noticed the behavior test fails both on main and this PR. Created #6684
Since this is not part of your PR or ticket. Do you want to merge this or do you want to fix the test first?

I will take a closer look if we can set modified time as optional.

@yunchipang yunchipang force-pushed the gdrive-write-returns-metadata branch from fbdfd75 to e07d964 Compare October 17, 2025 14:50
@yunchipang
Copy link
Contributor Author

@erickguan thanks so much for reviewing! yes i'd like to merge this first if possible.

@erickguan
Copy link
Member

Thanks for working on this.

Let me know if you are interested in fixing the service for tests.

@erickguan erickguan self-requested a review October 17, 2025 14:57
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 17, 2025
@erickguan erickguan merged commit 48d9f5f into apache:main Oct 17, 2025
84 checks passed
@Xuanwo
Copy link
Member

Xuanwo commented Oct 17, 2025

Hitting errors like:

---- behavior::test_write_only ----
Unexpected (persistent) at write, context: { service: gdrive, path: 2598aedf-0a47-4feb-9509-0e2be776fae1 } => deserialize json, source: missing field `modifiedTime` at line 8 column 5

---- behavior::test_write_with_special_chars ----
Unexpected (persistent) at write, context: { service: gdrive, path: 6123d42b-5265-4ec7-874b-53167d218067 !@#$%^&()_+-=;',.txt } => deserialize json, source: missing field `modifiedTime` at line 8 column 5

---- behavior::test_write_returns_metadata ----
Unexpected (persistent) at write, context: { service: gdrive, path: 906b4dbb-08fb-4047-a859-ebb5bfcbb34f } => deserialize json, source: missing field `modifiedTime` at line 8 column 5

---- behavior::test_writer_write_with_overwrite ----
Unexpected (persistent) at write, context: { service: gdrive, path: 68b61cb3-9ec0-4c79-9694-83b56d38e9ea } => deserialize json, source: missing field `modifiedTime` at line 8 column 5

---- behavior::test_writer_abort ----
test panicked: assertion `left == right` failed
  left: Unexpected
 right: Unsupported

---- behavior::test_writer_abort_with_concurrent ----
test panicked: assertion `left == right` failed
  left: Unexpected
 right: Unsupported

@erickguan
Copy link
Member

@Xuanwo thanks for noticing. It’s my bad suggesting modified time changes. But I noticed a few more failures so I took the initiative to merge this PR firstly and will address bugs in the follow up ticket #6684. If I didn’t see Yun’s response in half an hour, I’ll start fixing this.

Xuanwo added a commit that referenced this pull request Oct 17, 2025
erickguan pushed a commit that referenced this pull request Oct 17, 2025
@yunchipang
Copy link
Contributor Author

hi @Xuanwo @erickguan thank you both for taking a look and noticing errors! i might not be able to help today (sorry!) but will follow up on the issue later if it has not been fixed yet.

@erickguan
Copy link
Member

I will look over it firstly and ping you back for the PR.

@erickguan
Copy link
Member

erickguan commented Oct 17, 2025

@Xuanwo We have indeed a timing issue from the bug issue (#6684). I would accept this PR with one change: modified_time should remain optional. This still helps the code structure etc.

The PR will pass the CI. I know it means less. We track the bug but not block this one. What do you think?

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

Labels

lgtm This PR has been approved by a maintainer releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants