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

Grouping Health Checks – squashed commits #123

Merged
merged 1 commit into from
Jan 8, 2016

Conversation

DrSchimke
Copy link
Contributor

This is an alternative PR for issue #113.

In original PR #115 it was recommended to put all changes into one commit. So, here it is...

@lsmith77
Copy link
Contributor

@DrSchimke ah ok thx .. you can actually force push the same branch to just update your existing PR.

$runner = $this->getContainer()->get('liip_monitor.runner');
$group = $input->getOption('group');

if (is_null($group)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

symfony syle is to use null === $group instead

DrSchimke added a commit to Postcon/LiipMonitorBundle that referenced this pull request Jan 2, 2016
DrSchimke added a commit to Postcon/LiipMonitorBundle that referenced this pull request Jan 2, 2016
DrSchimke added a commit to Postcon/LiipMonitorBundle that referenced this pull request Jan 3, 2016
DrSchimke added a commit to Postcon/LiipMonitorBundle that referenced this pull request Jan 4, 2016
DrSchimke added a commit to Postcon/LiipMonitorBundle that referenced this pull request Jan 4, 2016
@DrSchimke DrSchimke force-pushed the grouping-squashed branch 4 times, most recently from 1371126 to 5e8be23 Compare January 4, 2016 17:53
@DrSchimke
Copy link
Contributor Author

Hi Lukas, please have a look. We made some changes, regarding your review comments.

$checkCollectionServices = $container->findTaggedServiceIds('liip_monitor.check_collection');

$groups = array($defaultGroup);
$groups = array_merge($groups, $this->getGroups($checkServices));
Copy link
Contributor

Choose a reason for hiding this comment

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

array_merge takes any number of parameters http://php.net/manual/en/function.array-merge.php

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know, but I like this

$groups = array($defaultGroup);
$groups = array_merge($groups, $this->getGroups($checkServices));
$groups = array_merge($groups, $this->getGroups($checkCollectionServices));
$groups = array_merge($groups, $this->getGroupsFromParameter($container));

more than that:

$groups = array_merge(
    array($defaultGroup),
    $this->getGroups($checkServices),
    $this->getGroups($checkCollectionServices),
    $this->getGroupsFromParameter($container)
);

For me, it is better readable: a bit shorter (in terms of line count) and these four quite uniform statements are simpler than one large statement, containing more parts.

Ok, in the end, the difference is quite small. say, and I will change it.

Copy link
Contributor

Choose a reason for hiding this comment

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

I find the later more readable because I have just one function name to "parse" when reading.

@lsmith77
Copy link
Contributor

lsmith77 commented Jan 4, 2016

This all looks great to me .. the main thing still left is to explain some where (in the code or dev docs section in the README ..) this %% thing for the parameters.

@DrSchimke
Copy link
Contributor Author

In Postcon@5e8be23#diff-3f5582b5992ee90b21e0ad051df6c184R56 we tried to explain this thing.

DrSchimke added a commit to Postcon/LiipMonitorBundle that referenced this pull request Jan 4, 2016
@lsmith77
Copy link
Contributor

lsmith77 commented Jan 4, 2016

@kbond do you have some feedback or all good from your side?

@kbond
Copy link
Collaborator

kbond commented Jan 4, 2016

Haven't looked at this yet but I will in the next day or so.

*
* @return null|Runner
*/
public function getRunner($group)
Copy link
Contributor

Choose a reason for hiding this comment

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

so my last open question is if we should allow null here as a parameter and in that case use the default group

@kbond
Copy link
Collaborator

kbond commented Jan 4, 2016

I tested this PR on a project and all looks good. Fully BC and the group feature works well.

A few suggestions for the HealthCheckCommand:

  1. What about adding an --all option that will run everything?
  2. The --groups option could benefit from InputOption::VALUE_IS_ARRAY that way I could run app/console monitor:health --group=foo --group=bar

DrSchimke added a commit to Postcon/LiipMonitorBundle that referenced this pull request Jan 5, 2016
@DrSchimke
Copy link
Contributor Author

Hi Kevin,

we like your suggestions for the HealthCheckCommand, but would prefer to merge the current version before implementing these additional features. After this merge, you, we or someone else can make a new PR.

Best regards

@lsmith77
Copy link
Contributor

lsmith77 commented Jan 5, 2016

sounds good to me .. so lets merge? good for you @kbond ?

@kbond
Copy link
Collaborator

kbond commented Jan 5, 2016

Sounds good, merge away!
On 5 Jan 2016 4:39 am, "Lukas Kahwe Smith" notifications@github.com wrote:

sounds good to me .. so lets merge? good for you @kbond
https://github.com/kbond ?


Reply to this email directly or view it on GitHub
#123 (comment)
.

lsmith77 added a commit that referenced this pull request Jan 8, 2016
Grouping Health Checks – squashed commits
@lsmith77 lsmith77 merged commit 5e51011 into liip:master Jan 8, 2016
@lsmith77 lsmith77 removed the in review label Jan 8, 2016
@lsmith77
Copy link
Contributor

lsmith77 commented Jan 8, 2016

wow .. this is so awesome! thanks @DrSchimke !

@lsmith77 lsmith77 mentioned this pull request Jan 8, 2016
@lsmith77
Copy link
Contributor

lsmith77 commented Jan 8, 2016

oops .. I got a bit too excited and released things right away ..
hopefully we can do those tweaks in a BC way :-/

DrSchimke added a commit to Postcon/LiipMonitorBundle that referenced this pull request Jan 10, 2016
DrSchimke added a commit to DrSchimke/LiipMonitorBundle that referenced this pull request Jan 10, 2016
@DrSchimke DrSchimke deleted the grouping-squashed branch January 12, 2016 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants