Skip to content

Conversation

@brendandburns
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 27, 2019
@k8s-ci-robot k8s-ci-robot requested a review from drubin April 27, 2019 04:25
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brendandburns

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested a review from mbohlool April 27, 2019 04:25
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 27, 2019
context['cluster'] = find_cluster(context['cluster'])
end
context['user'] = find_user(context['user']) if context['user']
if context['user'] && context['user'].length > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Just FYI you can do context['user'] = find_user(context['user']) if context['user'].blank? Then you should be able to keep the line the same.

https://stackoverflow.com/questions/885414/a-concise-explanation-of-nil-v-empty-v-blank-in-ruby-on-rails

I don't think it matters too much but if you do keep the if block can we remove the 2nd if check its kinda redundant and makes it harder to read.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I think it would solve the rubocop warnings too :)

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 1, 2019
@brendandburns
Copy link
Contributor Author

@drubin looks like blank? is in Rails, but not core Ruby, so we have to keep it like this for now...

(and using an if suffix here makes the line too long.

@brendandburns
Copy link
Contributor Author

@drubin friendly ping on this one if you're around.

Thanks!

@drubin
Copy link
Contributor

drubin commented May 7, 2019

@brendandburns sorry been a busy week. Also sorry about the .blank? being rails only I always forget what they add for you.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 7, 2019
@k8s-ci-robot k8s-ci-robot merged commit ecfaf5b into kubernetes-client:master May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants