feat(graph): add the driveItem versions API - #3479
Draft
dschmidt wants to merge 1 commit into
Draft
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 87 |
🟢 Coverage 74.14% diff coverage · +0.13% coverage variation
Metric Results Coverage variation ✅ +0.13% coverage variation (-1.00%) Diff coverage ✅ 74.14% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (5807eea) 88461 20882 23.61% Head commit (be8cd46) 88692 (+231) 21056 (+174) 23.74% (+0.13%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#3479) 232 172 74.14% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
dschmidt
force-pushed
the
feat/driveitem-versions
branch
from
September 7, 2026 09:38
80f3400 to
38975ad
Compare
dschmidt
force-pushed
the
feat/driveitem-versions
branch
from
September 7, 2026 09:39
38975ad to
a685d5f
Compare
dschmidt
force-pushed
the
feat/driveitem-versions
branch
from
September 7, 2026 10:05
a685d5f to
b6acc1c
Compare
Implements the MS Graph driveItemVersion operations on files:
- GET .../items/{id}/versions lists the versions, newest first
- GET .../versions/{version-id} returns one version, "current" describes the file itself
- GET .../versions/{version-id}/content redirects to a signed download url for the version
- POST .../versions/{version-id}/restoreVersion makes the version the current content
The operations map onto ListFileVersions and RestoreFileVersion of the
gateway. Version downloads point at the WebDAV meta endpoint, signed the
same way as the driveItem download url. The download url is only added
when requested via $select.
The driveItemVersion models are vendored from the regenerated client of
opencloud-eu/libre-graph-api#73 until that spec change is merged and the
dependency can be bumped.
dschmidt
force-pushed
the
feat/driveitem-versions
branch
from
September 7, 2026 11:00
b6acc1c to
be8cd46
Compare
7 tasks
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.
Implements the driveItemVersion operations from opencloud-eu/libre-graph-api#73 in the graph service, under
/v1.0/drives/{drive-id}/items/{item-id}/versions:GET .../versionslists the versions of a file, newest first. The storage does not guarantee an order, so the handler sorts by mtime and key.GET .../versions/{version-id}returns one version.currentdescribes the file itself, as in MS Graph.GET .../versions/{version-id}/contentanswers with a 302 to a signed, short-lived URL of the WebDAV meta endpoint (/dav/meta/{id}/v/{key}), the same endpoint the web UI downloads versions from.currentredirects to the file itself.POST .../versions/{version-id}/restoreVersionreturns 204, or 423 when the file is locked.All four stat the item first and answer 404 for folders, like MS Graph.
@microsoft.graph.downloadUrlon versions is opt-in via$select, mirroring the driveItem behaviour.lastModifiedBystays empty, the storage does not record who created a version.Stacked on #3248, which provides the URL signer and the
/contentredirect for driveItems.The two
driveItemVersionmodels are vendored from the regenerated Go client of the spec PR for now. Once opencloud-eu/libre-graph-api#73 is merged, that commit gets replaced by a regularlibre-graph-api-gobump.