Skip to content

Commit f60e2e5

Browse files
authored
Merge pull request #3437 from opencloud-eu/feat/driveitem-pending-operations
graph: expose pendingOperations on driveItems
2 parents 249d105 + 000c99c commit f60e2e5

9 files changed

Lines changed: 324 additions & 2 deletions

File tree

‎go.mod‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ require (
6363
github.com/onsi/gomega v1.42.1
6464
github.com/open-policy-agent/opa v1.19.1
6565
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89
66-
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260818063016-69f82a7dde55
66+
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260901070651-08a5330ce57d
6767
github.com/opencloud-eu/reva/v2 v2.49.0
6868
github.com/opensearch-project/opensearch-go/v4 v4.7.3
6969
github.com/orcaman/concurrent-map v1.0.0

‎go.sum‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,8 @@ github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89 h1:W1ms+l
942942
github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89/go.mod h1:vigJkNss1N2QEceCuNw/ullDehncuJNFB6mEnzfq9UI=
943943
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260818063016-69f82a7dde55 h1:dzYZ5iA6i0QoFUap9l6sZ4Ts2HXiXVfsOoiRYToYgm8=
944944
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260818063016-69f82a7dde55/go.mod h1:lTM8JeGblNpoMySTW7Lui2+c5TTLI95mwxtdUIHHrhU=
945+
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260901070651-08a5330ce57d h1:3zbb31655ZvqwLMWMIiUAhYer6YcFnv/oguujnX7aOU=
946+
github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260901070651-08a5330ce57d/go.mod h1:lTM8JeGblNpoMySTW7Lui2+c5TTLI95mwxtdUIHHrhU=
945947
github.com/opencloud-eu/reva/v2 v2.49.0 h1:AwECMDDth3NUaihZRf9bI9HNpWutvaRijOCvQyQfTT4=
946948
github.com/opencloud-eu/reva/v2 v2.49.0/go.mod h1:Frg+UWnVcSy+412UB3l2LcD0KY8ZNu1samimwkNywbg=
947949
github.com/opencloud-eu/secure v0.0.0-20260312082735-b6f5cb2244e4 h1:l2oB/RctH+t8r7QBj5p8thfEHCM/jF35aAY3WQ3hADI=

‎services/graph/pkg/service/v0/driveitems.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,13 @@ func cs3ResourceToDriveItem(logger *log.Logger, publicBaseURL *url.URL, res *sto
490490
}
491491
}
492492

493+
if utils.IsProcessing(res) {
494+
// queuedDateTime stays absent, we do not track when postprocessing started
495+
driveItem.PendingOperations = &libregraph.PendingOperations{
496+
PendingContentUpdate: &libregraph.PendingOperationsPendingContentUpdate{},
497+
}
498+
}
499+
493500
return driveItem, nil
494501
}
495502

‎services/graph/pkg/service/v0/driveitems_test.go‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,27 @@ var _ = Describe("Driveitems", func() {
339339
Expect(res.Value[0].Location).To(BeNil())
340340
Expect(res.Value[0].LibreGraphMeFollowing).To(BeNil())
341341
Expect(res.Value[0].LibreGraphTags).To(BeNil())
342+
Expect(res.Value[0].PendingOperations).To(BeNil())
343+
})
344+
345+
It("reports a pending content update while the item is being processed", func() {
346+
gatewayClient.On("ListContainer", mock.Anything, mock.Anything).Return(&provider.ListContainerResponse{
347+
Status: status.NewOK(ctx),
348+
Infos: []*provider.ResourceInfo{
349+
{
350+
Type: provider.ResourceType_RESOURCE_TYPE_FILE,
351+
Id: &provider.ResourceId{StorageId: "storageid", SpaceId: "spaceid", OpaqueId: "opaqueid"},
352+
Etag: "etag",
353+
Mtime: utils.TimeToTS(mtime),
354+
Opaque: utils.AppendPlainToOpaque(nil, "status", "processing"),
355+
},
356+
},
357+
}, nil)
358+
359+
res := assertItemsList(1)
360+
Expect(res.Value[0].PendingOperations).ToNot(BeNil())
361+
Expect(res.Value[0].PendingOperations.PendingContentUpdate).ToNot(BeNil())
362+
Expect(res.Value[0].PendingOperations.PendingContentUpdate.QueuedDateTime).To(BeNil())
342363
})
343364

344365
It("returns tags if metadata is available", func() {

‎vendor/github.com/opencloud-eu/libre-graph-api-go/README.md‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎vendor/github.com/opencloud-eu/libre-graph-api-go/model_drive_item.go‎

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎vendor/github.com/opencloud-eu/libre-graph-api-go/model_pending_operations.go‎

Lines changed: 126 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎vendor/github.com/opencloud-eu/libre-graph-api-go/model_pending_operations_pending_content_update.go‎

Lines changed: 128 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎vendor/modules.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ github.com/open-policy-agent/opa/v1/version
13641364
# github.com/opencloud-eu/icap-client v0.0.0-20250930132611-28a2afe62d89
13651365
## explicit; go 1.24.6
13661366
github.com/opencloud-eu/icap-client
1367-
# github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260818063016-69f82a7dde55
1367+
# github.com/opencloud-eu/libre-graph-api-go v1.0.8-0.20260901070651-08a5330ce57d
13681368
## explicit; go 1.23
13691369
github.com/opencloud-eu/libre-graph-api-go
13701370
# github.com/opencloud-eu/reva/v2 v2.49.0

0 commit comments

Comments
 (0)