Skip to content
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 processing of multiple groups #144

Merged
merged 4 commits into from
Sep 28, 2018
Merged

Fix processing of multiple groups #144

merged 4 commits into from
Sep 28, 2018

Conversation

phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Sep 28, 2018

Fixes scenarios of issue #143

  1. The erroneous Invalid argument given. message is no longer shown when expiring passwords for a group.

  2. When one of the group names is not a valid group, the command continues processing the remaining groups.

  3. When one of the group names is not a valid group, the command continues processing the remaining groups.

At the end of processing, the totals of any missing groups or users are reported, and the command returns with non-zero status.

@phil-davis phil-davis added this to the development milestone Sep 28, 2018
@phil-davis phil-davis self-assigned this Sep 28, 2018
@phil-davis phil-davis requested a review from PVince81 September 28, 2018 09:22
@@ -170,7 +170,6 @@ protected function execute(InputInterface $input, OutputInterface $output) {
}
} else {
$output->writeln("Ignoring missing group $group");
return 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@PVince81 what should happen here?

Since we may have already processed some groups, I think we should continue on and process any other groups.

But then after looping through all the groups, should we remember that there was a problem with some group, and exit with non-zero status?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, sounds good. continue and report at the end

Copy link
Contributor

Choose a reason for hiding this comment

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

fix now or create ticket for later for the additional reporting ?

@phil-davis
Copy link
Contributor Author

@PVince81 please review.

This makes it try to process any mix of groups and UIDs given on the command line.
Each unknown group or UID is reported as it happens. The totals of unknown groups and UIDs are reported at the end.

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.

Makes sense. Next up would be updating the unit tests

@phil-davis
Copy link
Contributor Author

Is there anyone who can do that quickly? I am not an expert in that area. And I should finish a couple of other password policy manual tests.

@phil-davis
Copy link
Contributor Author

phil-davis commented Sep 28, 2018

@sharidas or whoever does unit tests, it will need to test some of:

  • multiple groups, some of which do not exist
  • multiple UIDs, some of which do not exist
  • multiple groups and UIDs in the one command
  • multiple groups and UIDs in the one command, some of which do not exist

Unit test update to fix processing of multiple groups

Signed-off-by: Sujith H <sharidasan@owncloud.com>
@PVince81 PVince81 modified the milestones: development, QA Sep 28, 2018
@codecov-io
Copy link

Codecov Report

Merging #144 into master will increase coverage by 0.56%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #144      +/-   ##
============================================
+ Coverage     72.26%   72.83%   +0.56%     
- Complexity      217      225       +8     
============================================
  Files            25       25              
  Lines           952      968      +16     
============================================
+ Hits            688      705      +17     
+ Misses          264      263       -1
Impacted Files Coverage Δ Complexity Δ
lib/Command/ExpirePassword.php 100% <100%> (+1.05%) 31 <0> (+8) ⬆️

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 4d9689d...a470435. Read the comment docs.

@PVince81 PVince81 merged commit 2d7dbb4 into master Sep 28, 2018
@PVince81 PVince81 deleted the issue-143 branch September 28, 2018 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants