Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

environment updates for the username userid split #420

Merged
merged 6 commits into from
Aug 14, 2020

Conversation

butonic
Copy link
Member

@butonic butonic commented Jul 31, 2020

We updated the owncloud storage driver in reva to properly look up users by userid or username using the userprovider instead of taking the path segment as is. This requires the user service address as well as changing the default layout to the userid instead of the username. The latter is not considered a stable and persistent identifier.

requires a replace of reva for the PR cs3org/reva#1033

@PVince81
Copy link
Contributor

"/srv/app/testrunner/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature:63" is not supposed to run with OC-Storage, and yet it does here https://github.com/owncloud/core/blob/reva-tests/tests/acceptance/features/apiWebdavUpload1/uploadFile.feature#L63

@individual-it test setup issue ?

@PVince81
Copy link
Contributor

the test has these tags: @skipOnOcV10 @skipOnOcis-OC-Storage @issue-ocis-reva-265`
maybe missing @skipOnOcis or the exclusion files need update

@phil-davis
Copy link
Contributor

There are no skipOnOcV10 test scenarios any more in core. owncloud/core#37773

I guess this PR needs a rebase to latest master here in ocis-reva

@PVince81
Copy link
Contributor

reva updated to get the sharing fixes from #439

@PVince81
Copy link
Contributor

merging blocked by unexpected failing tests:

  • apiOcisSpecific/apiShareManagementBasic-createShare.feature:116
  • apiOcisSpecific/apiShareManagementBasic-createShare.feature:117

not sure if these are legit failures or intended to skip ? @individual-it

@phil-davis
Copy link
Contributor

Those are local test scenarios that (were) demonstrating a bug.
https://cloud.drone.io/owncloud/ocis-reva/897/2/7

  @issue-ocis-reva-372 @issue-ocis-reva-243
  Scenario Outline: sharing subfolder of already shared folder, GET result is correct                                      # /drone/src/tests/acceptance/features/apiOcisSpecific/apiShareManagementBasic-createShare.feature:88
    Given using OCS API version "<ocs_api_version>"                                                                        # FeatureContext::usingOcsApiVersion()
    And these users have been created with default attributes and without skeleton files:                                  # FeatureContext::theseUsersHaveBeenCreatedWithDefaultAttributesAndWithoutSkeletonFiles()
      | username |
      | Brian    |
      | Carol    |
      | David    |
      | Emily    |
    And user "Alice" has created folder "/folder1"                                                                         # FeatureContext::userHasCreatedFolder()
    And user "Alice" has shared folder "/folder1" with user "Brian"                                                        # FeatureContext::userHasSharedFileWithUserUsingTheSharingApi()
    And user "Alice" has shared folder "/folder1" with user "Carol"                                                        # FeatureContext::userHasSharedFileWithUserUsingTheSharingApi()
    And user "Alice" has created folder "/folder1/folder2"                                                                 # FeatureContext::userHasCreatedFolder()
    And user "Alice" has shared folder "/folder1/folder2" with user "David"                                                # FeatureContext::userHasSharedFileWithUserUsingTheSharingApi()
    And user "Alice" has shared folder "/folder1/folder2" with user "Emily"                                                # FeatureContext::userHasSharedFileWithUserUsingTheSharingApi()
    When user "Alice" sends HTTP method "GET" to OCS API endpoint "/apps/files_sharing/api/v1/shares"                      # OCSContext::userSendsToOcsApiEndpoint()
    Then the OCS status code should be "<ocs_status_code>"                                                                 # OCSContext::theOCSStatusCodeShouldBe()
    And the HTTP status code should be "<http_status_code>"                                                                # FeatureContext::thenTheHTTPStatusCodeShouldBe()
    And user "Alice" sends HTTP method "GET" to OCS API endpoint "/apps/files_sharing/api/v1/shares?path=/folder1/folder2" # OCSContext::userSendsToOcsApiEndpoint()
    And the response should contain 2 entries                                                                              # FeatureContext::checkingTheResponseEntriesCount()
    And folder "/folder1" should not be included as path in the response                                                   # FeatureContext::checkSharedFileAsPathNotInResponse()
    And folder "/folder2" should be included as path in the response                                                       # FeatureContext::checkSharedFileAsPathInResponse()

    Examples:
      | ocs_api_version | http_status_code | ocs_status_code |
      | 1               | 200              | 996             |
        OCS status code is not the expected value 996 got 100
        Failed asserting that two strings are equal.
        --- Expected
        +++ Actual
        @@ @@
        -'996'
        +'100'
      | 2               | 500              | 996             |
        OCS status code is not the expected value 996 got 200
        Failed asserting that two strings are equal.
        --- Expected
        +++ Actual
        @@ @@
        -'996'
        +'200'

It looks like the codes are better. So stuff has been fixed in cs3org/reva and now we are importing the fixed code from there.

I hope that there are "unexpected passes" in the Core-API tests - but they seem to have passed as they are. So there is no failing scenario from there that is now passing.

So maybe the local scenario here is improved but not going to fully pass every step yet.

For that, adjust the test scenario in this PR to expect the better status codes.

butonic and others added 5 commits August 13, 2020 21:37
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
@phil-davis phil-davis force-pushed the username-userid-split-adjustments branch 2 times, most recently from e35e0bb to 6911261 Compare August 13, 2020 16:03
@phil-davis phil-davis force-pushed the username-userid-split-adjustments branch from 6911261 to b1b712a Compare August 13, 2020 16:13
@ownclouders
Copy link

Codacy Here is an overview of what got changed by this pull request:

Clones added
============
- pkg/flagset/storageoc.go  2
- pkg/command/storagehome.go  1
- pkg/flagset/storagehome.go  3
- pkg/flagset/storageeosdata.go  1
- pkg/command/storageocdata.go  2
- pkg/flagset/storagehomedata.go  4
- pkg/command/storageoc.go  1
- pkg/flagset/storageocdata.go  2
- pkg/command/storagehomedata.go  2
         

Clones removed
==============
+ pkg/flagset/storageroot.go  -2
+ pkg/flagset/storageeos.go  -1
         

See the complete overview on Codacy

@phil-davis
Copy link
Contributor

phil-davis commented Aug 13, 2020

I have adjusted the test scenario to the improved status codes, so that it now reads the same as in cs3org/reva.
CI should pass - someone can review, and IMO this can be merged.


&cli.StringFlag{
Name: "users-url",
Value: "localhost:9144",
Copy link
Member

Choose a reason for hiding this comment

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

I remember people complaining here, that a URL should always have http(s)://. Please adjust. ;-)


&cli.StringFlag{
Name: "users-url",
Value: "localhost:9144",
Copy link
Member

Choose a reason for hiding this comment

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

Please add http(s):// (see first comment)


&cli.StringFlag{
Name: "users-url",
Value: "localhost:9144",
Copy link
Member

Choose a reason for hiding this comment

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

Please add http(s):// (see first comment)


&cli.StringFlag{
Name: "users-url",
Value: "localhost:9144",
Copy link
Member

Choose a reason for hiding this comment

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

Please add http(s):// (see first comment)

@PVince81
Copy link
Contributor

I started adjusting locally and saw that other unrelated URLs are also not prefixed. I'd rather not risk more side effects now and leave it be, unless @butonic thinks it is safe to adjust them all...

@PVince81
Copy link
Contributor

I've raised https://github.com/owncloud/ocis-reva/issues/440 for addressing the https thing

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍

@PVince81 PVince81 merged commit 6361bb5 into master Aug 14, 2020
@phil-davis phil-davis deleted the username-userid-split-adjustments branch August 27, 2020 11:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants