Skip to content

feat(graph): add the v1beta1 endpoints for a single drive - #3941

Merged
micbar merged 2 commits into
opencloud-eu:mainfrom
pbleser-oc:feat/graph-drive-v1beta1-aliases
Nov 13, 2026
Merged

micbar merged 2 commits into
opencloud-eu:mainfrom
pbleser-oc:feat/graph-drive-v1beta1-aliases

Conversation

@pbleser-oc

@pbleser-oc pbleser-oc commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Under /graph/v1beta1, drives can only be listed so far. This adds the v1beta1 counterparts of the v1.0 endpoints for a single drive: GET, PATCH and DELETE on /graph/v1beta1/drives/{driveID}, and POST on /graph/v1beta1/drives.

  • They take the same requests as their v1.0 counterparts.
  • GET, POST and PATCH return the drive in the v1beta1 format, like the v1beta1 list of drives does. With $expand=root($expand=permissions), the permissions carry the IDs of the unified roles and grantedToV2, instead of the old role names and grantedToIdentities. DELETE behaves the same in both versions.
  • The handlers for getting, creating and updating a drive now take the API version as a parameter.

Tests:

  • Unit tests for both versions.
  • A new acceptance feature, apiSpaces/spaceApiVersions.feature, which creates, gets, renames, disables and deletes a project space through each version.
  • The space helpers of the acceptance tests can now use either version, with v1.0 as the default.

API spec: opencloud-eu/libre-graph-api#85 adds these operations to the spec, so that clients can use them once they're regenerated. This PR doesn't depend on it.

Merge order: this changes CreateDrive, as does #3899, so it should be merged after #3899. I'll rebase it once that one is in.

AI assistance: Claude Code (claude-opus-5-5) wrote the first draft of the code, the tests and this description.

@codacy-production

codacy-production Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 5 complexity

Metric Results
Complexity 5

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.03% coverage variation

Metric Results
Coverage variation ✅ +0.03% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (55b5e7d) 94131 27913 29.65%
Head commit (dd93fd4) 94153 (+22) 27946 (+33) 29.68% (+0.03%)

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 (#3941) 25 25 100.00%

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.

@micbar micbar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@micbar

micbar commented Nov 13, 2026

Copy link
Copy Markdown
Member

That pr is good, just needs a rebase

@pbleser-oc
pbleser-oc force-pushed the feat/graph-drive-v1beta1-aliases branch from db601d6 to 8f5dc2e Compare November 13, 2026 15:41
@butonic
butonic deleted the branch opencloud-eu:workpagages November 13, 2026 16:53
@butonic butonic closed this Nov 13, 2026
@butonic butonic reopened this Nov 13, 2026
@butonic
butonic changed the base branch from workpagages to main November 13, 2026 17:06
@micbar
micbar enabled auto-merge November 13, 2026 17:53
Under /graph/v1beta1, drives could only be listed. Getting, creating,
updating and deleting a single drive was only possible under v1.0,
which returns the permissions of a drive's root with the old role names
instead of the IDs of the unified roles.

Add GET, PATCH and DELETE on /graph/v1beta1/drives/{driveID}, and POST
on /graph/v1beta1/drives. They take the same requests as their v1.0
counterparts. GET, POST and PATCH return the drive in the v1beta1
format, like the v1beta1 list of drives does: with
$expand=root($expand=permissions), the permissions carry the unified
role IDs and grantedToV2. DELETE behaves the same in both versions.

The handlers for getting, creating and updating a drive now take the
API version as a parameter, and the v1.0 and v1beta1 routes call them
with their own version.

The acceptance test helpers for spaces can now use either version of
the Graph API.

Assisted-by: Claude Code:claude-opus-5-5
A space image can be assigned with a PATCH of the drive on the v1beta1
route as well, and the size limit applies there the same way. Say so in
the README, and cover the refusal of a too large image on that route in
the tests.

Assisted-by: Claude Code:claude-opus-5-5
@pbleser-oc
pbleser-oc force-pushed the feat/graph-drive-v1beta1-aliases branch from 8f5dc2e to dd93fd4 Compare November 13, 2026 18:17
@micbar
micbar merged commit 309f9d6 into opencloud-eu:main Nov 13, 2026
61 checks passed
@pbleser-oc
pbleser-oc deleted the feat/graph-drive-v1beta1-aliases branch November 13, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants