-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix idp schema, add virtual setup #2219
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
@ishank011 @labkode what kind of tests should we run on the
@phil-davis can you recommend a set of features we can use in drone to test etag and size propagation? For now I have a basic test working: https://drone.cernbox.cern.ch/cs3org/reva/3916/8/5 It sets up two storage providers with the local driver and mounts them at
|
177259c
to
924682d
Compare
15b3f76
to
3606c52
Compare
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
ok, I am now checking if the etage of Unfortunately, not even this basic test works, I assume becaus I am using the local driver which
when doing a PROPFIND against the virtual folder I should see the etag thet corresponds to the later provider entry, like this: diff --git a/internal/grpc/services/gateway/storageprovider.go b/internal/grpc/services/gateway/storageprovider.go
index dcfd7be3..5292ac30 100644
--- a/internal/grpc/services/gateway/storageprovider.go
+++ b/internal/grpc/services/gateway/storageprovider.go
@@ -1334,7 +1334,14 @@ func (s *svc) statAcrossProviders(ctx context.Context, req *provider.StatRequest
}
if resp.Info != nil {
info.Size += resp.Info.Size
- info.Mtime = utils.LaterTS(info.Mtime, resp.Info.Mtime)
+ if utils.TSToUnixNano(resp.Info.Mtime) > utils.TSToUnixNano(info.Mtime) {
+ info.Mtime = resp.Info.Mtime
+ info.Etag = resp.Info.Etag
+ info.Checksum = resp.Info.Checksum
+ }
+ if info.Etag == "" && info.Etag != resp.Info.Etag {
+ info.Etag = resp.Info.Etag
+ }
}
}
@@ -1705,7 +1712,14 @@ func (s *svc) listContainerAcrossProviders(ctx context.Context, req *provider.Li
}
// TODO(ishank011): aggregrate properties such as etag, checksum, etc.
p.Size += info.Size
- p.Mtime = utils.LaterTS(p.Mtime, info.Mtime)
+ if utils.TSToUnixNano(info.Mtime) > utils.TSToUnixNano(p.Mtime) {
+ p.Mtime = info.Mtime
+ p.Etag = info.Etag
+ p.Checksum = info.Checksum
+ }
+ if p.Etag == "" && p.Etag != info.Etag {
+ p.Etag = info.Etag
+ }
p.Type = provider.ResourceType_RESOURCE_TYPE_CONTAINER
p.MimeType = "httpd/unix-directory"
} else { right @ishank011 ? Anyway, we should add the expectations to this PRs feature. Hopefully, it can be mimicked using the localfs. |
without the above diff I get
with it I can get rid of the last etag not changing:
In any case, I was under the impression that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these tests reva specific or should they be moved/copied to ocis?
They are reva specific. The 'virtual views' feature allows merging multiple storage providers to serve a single folder. Not something owncloud 10 can do. |
Co-authored-by: Artur Neumann <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
@ishank011 I think we have a passing test! 🤞 |
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest not to use "einstein" as user in the tests but create a new user as we do everywhere else
@individual-it I did not want to make an ldap server necessary as I don't want to test managing users. I would actually like to reduce this test to a point where we only register the storage providers and don't even have users ... but I would have to test further if disabling user home creation on login is enough. |
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
hm ... we could change the config of the default test suite to start two storage providers for /users .... but that would make the setup even more complex ... |
This just adds a config for the virtual views. The local integration tests now have two storage providers mounted at
/virtual
with the local driver. They can be accessed via the frontent-global service.