Skip to content

allow scope by user in troubleshoot transfer - #37950

Merged
phil-davis merged 2 commits into
masterfrom
feature/repair-transfered-shares
Oct 19, 2020
Merged

allow scope by user in troubleshoot transfer#37950
phil-davis merged 2 commits into
masterfrom
feature/repair-transfered-shares

Conversation

@mrow4a

@mrow4a mrow4a commented Sep 27, 2020

Copy link
Copy Markdown
Contributor

Extension of #37860 with additional option for scoping for user

occ files:troubleshoot-transfer-ownership all  --uid <userid>

Related: https://github.com/owncloud/enterprise/issues/4121

@mrow4a
mrow4a requested a review from karakayasemi September 27, 2020 12:03
@mrow4a mrow4a self-assigned this Sep 27, 2020
@mrow4a
mrow4a force-pushed the feature/repair-transfered-shares branch from ae48185 to 814f7ae Compare September 27, 2020 12:09
@mrow4a
mrow4a requested a review from pako81 September 27, 2020 12:16
@mmattel

mmattel commented Sep 27, 2020

Copy link
Copy Markdown
Contributor

doc relevant! pls file a issue/pr in docs when approved/merged.

@mrow4a

mrow4a commented Sep 28, 2020

Copy link
Copy Markdown
Contributor Author

@mmattel there is already owncloud/docs#2794 . Will do after merging this one

@mrow4a
mrow4a force-pushed the feature/repair-transfered-shares branch from 814f7ae to d3fe8f0 Compare September 28, 2020 17:18
@codecov

codecov Bot commented Sep 28, 2020

Copy link
Copy Markdown

Codecov Report

Merging #37950 into master will increase coverage by 0.01%.
The diff coverage is 70.96%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #37950      +/-   ##
============================================
+ Coverage     64.71%   64.72%   +0.01%     
- Complexity    19442    19449       +7     
============================================
  Files          1286     1286              
  Lines         76019    76054      +35     
  Branches       1336     1336              
============================================
+ Hits          49196    49227      +31     
- Misses        26429    26433       +4     
  Partials        394      394              
Flag Coverage Δ Complexity Δ
#javascript 54.06% <ø> (ø) 0.00 <ø> (ø)
#phpunit 65.89% <70.96%> (+0.01%) 19449.00 <25.00> (+7.00)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...iles/lib/Command/TroubleshootTransferOwnership.php 52.65% <70.96%> (+2.65%) 38.00 <25.00> (+4.00)
lib/private/User/SyncService.php 82.85% <0.00%> (-0.29%) 63.00% <0.00%> (+2.00%) ⬇️
lib/private/Log.php 82.03% <0.00%> (-0.14%) 49.00% <0.00%> (ø%)
core/Command/Encryption/Disable.php 100.00% <0.00%> (ø) 5.00% <0.00%> (+1.00%)
.../dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php 96.42% <0.00%> (ø) 9.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce56429...b08e6e6. Read the comment docs.

@mrow4a
mrow4a force-pushed the feature/repair-transfered-shares branch from d3fe8f0 to 426b388 Compare September 30, 2020 19:26
@owncloud owncloud deleted a comment from update-docs Bot Oct 1, 2020
Comment thread apps/files/lib/Command/TroubleshootTransferOwnership.php Outdated
Comment thread apps/files/lib/Command/TroubleshootTransferOwnership.php Outdated
Comment thread apps/files/lib/Command/TroubleshootTransferOwnership.php Outdated
Comment thread apps/files/lib/Command/TroubleshootTransferOwnership.php Outdated
Comment thread apps/files/lib/Command/TroubleshootTransferOwnership.php Outdated
Comment thread apps/files/lib/Command/TroubleshootTransferOwnership.php
@mrow4a
mrow4a requested a review from jvillafanez October 7, 2020 18:45
@phil-davis

Copy link
Copy Markdown
Contributor

https://drone.owncloud.com/owncloud/core/27166/97/18
Needs a rebase to current master - the API acceptance test suites have been split in the last few days.

@mrow4a

mrow4a commented Oct 8, 2020

Copy link
Copy Markdown
Contributor Author

Note: this command was used mostly to solve one-time issue for one of customers. We decided to publish it to broader community (but I think it requires good balance between value and effort).

Comment thread apps/files/lib/Command/TroubleshootTransferOwnership.php
Comment thread apps/files/lib/Command/TroubleshootTransferOwnership.php
Comment thread apps/files/lib/Command/TroubleshootTransferOwnership.php Outdated
@jvillafanez

Copy link
Copy Markdown
Member
	// the wrapping loop is performing very resource intensive tasks of mounting
	// oc filesystem for each of the users, that could cause timeouts,
	// sleep for 5 seconds not to overload

I'm still not fully convinced with this explanation... if we don't want to overload, we should probably apply the same mechanism after a successful loop, not just when an error happens. In addition, it should probably the admin the one to decide how much time he wants to wait; the server might be down for maintenance, so the admin won't likely want to wait.

@mrow4a
mrow4a force-pushed the feature/repair-transfered-shares branch from b08e6e6 to e0e4e7e Compare October 9, 2020 11:00
@mrow4a
mrow4a requested a review from jvillafanez October 9, 2020 11:02
@mrow4a

mrow4a commented Oct 9, 2020

Copy link
Copy Markdown
Contributor Author

@jvillafanez I adjusted to review, good points.

Comment thread apps/files/lib/Command/TroubleshootTransferOwnership.php Outdated
@jvillafanez

Copy link
Copy Markdown
Member

I think that is the last change from my side. Need to check the CI error, but otherwise it looks good.

@phil-davis

Copy link
Copy Markdown
Contributor

https://drone.owncloud.com/owncloud/core/27203/114/14

  Scenario: troubleshoot transfer ownerships for all with share and reshare                                 # /drone/src/tests/acceptance/features/cliMain/transfer-ownership.feature:313
    Given user "Alice" has been created with default attributes and skeleton files                          # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And user "Brian" has been created with default attributes and skeleton files                            # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And user "Carol" has been created with default attributes and skeleton files                            # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And user "David" has been created with default attributes and skeleton files                            # FeatureContext::userHasBeenCreatedWithDefaultAttributes()
    And user "Alice" has created folder "/testByAlice"                                                      # FeatureContext::userHasCreatedFolder()
    And user "Alice" has shared folder "/testByAlice" with user "Brian" with permissions "all"              # FeatureContext::userHasSharedFileWithUserUsingTheSharingApi()
    And user "Brian" has shared folder "/testByAlice" with user "Carol" with permissions "all"              # FeatureContext::userHasSharedFileWithUserUsingTheSharingApi()
    And user "Brian" has created folder "/testByBrian"                                                      # FeatureContext::userHasCreatedFolder()
    And user "Brian" has shared folder "/testByBrian" with user "Carol" with permissions "all"              # FeatureContext::userHasSharedFileWithUserUsingTheSharingApi()
    And the administrator transfers ownership from "Brian" to "David" using the occ command                 # TransferOwnershipContext::theAdministratorTransfersOwnershipFromToUsingTheOccCommand()
    When the administrator troubleshoots transfer of ownerships for "all" using the occ command             # TransferOwnershipContext::theAdministratorTroubleshootsTransferOwnershipUsingTheOccCommand()
    Then the command should have been successful                                                            # OccContext::theCommandShouldHaveBeenSuccessful()
    And the command output should contain the text "Searching for reshares that have invalid uid_initiator" # OccContext::theCommandOutputContainsTheText()
    And the command output should contain the text "Found 0 invalid initiator reshares"                     # OccContext::theCommandOutputContainsTheText()
    And the command output should contain the text "Repaired 0 invalid initiator reshares"                  # OccContext::theCommandOutputContainsTheText()
      The command output did not contain the expected text on stdout 'Repaired 0 invalid initiator reshares'
      The command output on stdout was:
      ==========================
      Searching for reshares that have invalid uid_initiator(resharer), meaning resharer which does not have the received share mounted anymore (that he reshared with other user).
      ==========================
      
      Found 0 invalid initiator reshares
      
      ==========================
      Searching for shares that have invalid uid_owner, meaning share uid_owner that does not match associated file storage id.
      ==========================
      
      Found 0 invalid share owners
      
      
      Failed asserting that 0 is equal to 1 or is greater than 1.

I guess that you removed the output "Repaired 0 invalid initiator reshares" becuase it is not relevant when there 0 shares have been found. The step that checks this just needs to be removed from the scenario.

@micbar

micbar commented Oct 12, 2020

Copy link
Copy Markdown
Contributor

@mrow4a Can we merge this very soon? We are planning a 10.6 release branch this week.

@mrow4a
mrow4a force-pushed the feature/repair-transfered-shares branch from e0e4e7e to 521038e Compare October 13, 2020 17:23
@mrow4a
mrow4a requested a review from jvillafanez October 13, 2020 18:23
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@phil-davis
phil-davis merged commit 0512922 into master Oct 19, 2020
@delete-merged-branch
delete-merged-branch Bot deleted the feature/repair-transfered-shares branch October 19, 2020 08:35
@mmattel

mmattel commented Oct 19, 2020

Copy link
Copy Markdown
Contributor

@mrow4a as it is merged now, pls check: #37950 (comment) to fix docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants