ocis icon indicating copy to clipboard operation
ocis copied to clipboard

[Sharing NG] Add tests coverage for (enable sync/disable sync) share

Open amrita-shrestha opened this issue 1 year ago • 9 comments

Description

This PR https://github.com/owncloud/ocis/pull/7885 adds api endpoint for accept/decline share. After PR merge, add test coverage

  • default (auto-accept)
    • [x] ~~decline share~~ disable sync of share resource https://github.com/owncloud/ocis/pull/8636
  • disable auto-accept
    • [x] ~~accept share~~ enable sync of share resource https://github.com/owncloud/ocis/pull/8623
  • [x] enable and disable sync feature in group share https://github.com/owncloud/ocis/pull/8734
  • [ ] enable sync twice [ Related issue: https://github.com/owncloud/ocis/issues/8876 ]
    • [ ] Personal
    • [ ] Project
  • [ ] disable sync twice
    • [ ] Personal
    • [ ] Project
  • [x] enable /disable sync of resource from Project to user https://github.com/owncloud/ocis/pull/8789
  • [x] enable /disable sync of resource from Project to group https://github.com/owncloud/ocis/pull/8796
  • [ ] sharer deleted (user/group) when sync enabled
    • [ ] Personal
    • [ ] Project
  • [ ] sharer deleted (user/group) when sync disabled
    • [ ] Personal
    • [ ] Project
  • [ ] sharee deleted (user/group) when sync enabled
    • [ ] Personal
    • [ ] Project
  • [ ] sharee deleted (user/group) when sync disabled
    • [ ] Personal
    • [ ] Project

Edge cases:

  • [x] try to enable sync using:
    • [x] non-existing item id (https://github.com/owncloud/ocis/issues/8724)
      • https://github.com/owncloud/ocis/pull/8875
    • [x] empty id ("") @grgprarup https://github.com/owncloud/ocis/pull/8963
    • [x] not shared item id @grgprarup https://github.com/owncloud/ocis/pull/8991
  • [ ] try to disbale sync using non-existing id @grgprarup https://github.com/owncloud/ocis/pull/8992 https://github.com/owncloud/ocis/issues/9001

Previously, the phrase mount and unmount was used. Currently enable and disable share is used. PR that refactors this change:

  • [x] https://github.com/owncloud/ocis/pull/8786

amrita-shrestha avatar Feb 19 '24 10:02 amrita-shrestha

For ~~declining~~ disabling sync an upcoming share

curl -X DELETE 'https://host.docker.internal:9200/graph/v1beta1/drives/{drive-id}/items/{item-id}' -u username:password

This will change @client.synchronize property of the item to false (disable sync) which refer to declining incoming share

See https://github.com/owncloud/ocis/issues/7792#issuecomment-1827601792 Swagger Reference: driveItem

S-Panta avatar Mar 07 '24 07:03 S-Panta

For ~~accepting pending share~~ enabling share sync

curl -X POST 'https://host.docker.internal:9200/graph/v1beta1/drives/{share-Space-Id}/root/children'  
-d '{
    "remoteItem": {
        "id":"'remote-item-id"
    }
}'

~~This request returns drive item . remote-item-id and permission-id can be received from sharedWithMe object~~ . Only item id is needed See drives.root

S-Panta avatar Mar 07 '24 08:03 S-Panta

Related bug issues for mount and unmount endpoint

  • https://github.com/owncloud/ocis/issues/8724
  • https://github.com/owncloud/ocis/issues/8735
  • https://github.com/owncloud/ocis/issues/8731

S-Panta avatar Mar 26 '24 10:03 S-Panta

@S-Panta @SagarGi @nirajacharya2 Please, check if this can be closed or not

saw-jan avatar Apr 16 '24 06:04 saw-jan

I think there are two bugs reported relating to enable and disable share. Test should be written to cover those scenarios too

S-Panta avatar Apr 16 '24 06:04 S-Panta

I think there are two bugs reported relating to enable and disable share. Test should be written to cover those scenarios too

update the links if test has been added and check if those issues are tracked in other qa tickets or not

saw-jan avatar Apr 16 '24 06:04 saw-jan

  • [ ] sharer deleted (user/group) when sync enabled
    • [ ] Personal
    • [ ] Project
  • [ ] sharer deleted (user/group) when sync disabled
    • [ ] Personal
    • [ ] Project

@amrita-shrestha Could elaborate the scenario for these? Similar to these scenarios or different? https://github.com/owncloud/ocis/blob/582f8b7af887b28ff566dd8ab494f341716d54be/tests/acceptance/features/apiSharingNg/sharedByMe.feature#L1456 https://github.com/owncloud/ocis/blob/582f8b7af887b28ff566dd8ab494f341716d54be/tests/acceptance/features/apiSharingNg/sharedByMe.feature#L1487 https://github.com/owncloud/ocis/blob/582f8b7af887b28ff566dd8ab494f341716d54be/tests/acceptance/features/apiSharingNg/sharedWithMe.feature#L4194 https://github.com/owncloud/ocis/blob/582f8b7af887b28ff566dd8ab494f341716d54be/tests/acceptance/features/apiSharingNg/sharedWithMe.feature#L4405

saw-jan avatar Apr 25 '24 10:04 saw-jan

I am extending coverage in https://github.com/owncloud/ocis/pull/8964 if that's the case

saw-jan avatar Apr 25 '24 11:04 saw-jan

And in https://github.com/owncloud/ocis/pull/8967

saw-jan avatar Apr 25 '24 12:04 saw-jan

@saw-jan @S-Panta, it appears that your PRs cover some scenarios, but there are still some that could be added to the "enable and disable sync" feature file. Those extended scenarios involve checking if the list shared with me lists all resources or not. However, what we need to address in the "enable/disable sync" is whether a user can change the sync state of shared resources whose owner has been deleted. Additionally, we need to consider scenarios where a shared resource's sync state is changed and the sharee(user/group to whom resource is deleted) is deleted. In these cases, the sharer(resource owner) needs to check whether the shared resource contains information about the deleted user in the propfind response or not? similar to mentioned in this issue https://github.com/owncloud/ocis/issues/9119

amrita-shrestha avatar May 09 '24 05:05 amrita-shrestha

I will check on these scenerio.

@saw-jan @S-Panta, it appears that your PRs cover some scenarios, but there are still some that could be added to the "enable and disable sync" feature file. Those extended scenarios involve checking if the list shared with me lists all resources or not. However, what we need to address in the "enable/disable sync" is whether a user can change the sync state of shared resources whose owner has been deleted. Additionally, we need to consider scenarios where a shared resource's sync state is changed and the sharee(user/group to whom resource is deleted) is deleted. In these cases, the sharer(resource owner) needs to check whether the shared resource contains information about the deleted user in the propfind response or not?

S-Panta avatar May 09 '24 06:05 S-Panta

@S-Panta What's the status of the remaining tasks here?

saw-jan avatar May 29 '24 11:05 saw-jan

@S-Panta What's the status of the remaining tasks here?

Beside contract testing, I feel like most of the scenarios for this endpoint is covered.

S-Panta avatar May 29 '24 11:05 S-Panta

Could you add those to the other mentioned issue? Then we can close this one

saw-jan avatar May 29 '24 11:05 saw-jan

I have linked the share in another issue. I think we can close this now

S-Panta avatar May 30 '24 08:05 S-Panta