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

strInSlice cleanup #12825 #12834

Merged
merged 3 commits into from Jun 3, 2019

Conversation

@pswica
Copy link
Contributor

commented Jun 2, 2019

The cleanup mentioned here:
#12825

Please let me know if there's anything here I can improve on

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jun 2, 2019

Welcome @pswica!

It looks like this is your first PR to kubernetes/test-infra 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/test-infra has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jun 2, 2019

Hi @pswica. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@pswica

This comment has been minimized.

Copy link
Contributor Author

commented Jun 2, 2019

/cc @cblecker

@k8s-ci-robot k8s-ci-robot requested a review from cblecker Jun 2, 2019

@cblecker
Copy link
Member

left a comment

You'll also need to run hack/update-bazel.sh and commit the changes

Show resolved Hide resolved prow/plugins/lgtm/lgtm.go Outdated
@cblecker

This comment has been minimized.

Copy link
Member

commented Jun 3, 2019

/ok-to-test

@fejta

fejta approved these changes Jun 3, 2019

Copy link
Contributor

left a comment

Thanks!


"k8s.io/apimachinery/pkg/util/sets"

This comment has been minimized.

Copy link
@fejta

fejta Jun 3, 2019

Contributor

k8s.io/apimachinery != k8s.io/test-infra. Please put it in the non-built-in, non-local repo block where it was previously

This comment has been minimized.

Copy link
@pswica

pswica Jun 3, 2019

Author Contributor

Really good point, and thanks a lot for spotting this. I correct in this PR: #12851 as my last PR was merged before I got home.

@k8s-ci-robot k8s-ci-robot added the lgtm label Jun 3, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jun 3, 2019

LGTM label has been added.

Git tree hash: e34cf5d4cb209c6399bfe52f51cdec570ea4d9f5

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jun 3, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fejta, pswica

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

The pull request process is described here

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

@stevekuznetsov
Copy link
Contributor

left a comment

Thanks for taking this on! When looping over something, prefer to create the set once and just check for Has() in the loop

for i := range config.Lgtm {
if !strInSlice(org, config.Lgtm[i].Repos) && !strInSlice(fullName, config.Lgtm[i].Repos) {
for _, c := range config.Lgtm {
if !sets.NewString(c.Repos...).Has(fullName) {

This comment has been minimized.

Copy link
@stevekuznetsov

stevekuznetsov Jun 3, 2019

Contributor

Make the set once, not on every loop. Might also short-circuit with !HasAny()

This comment has been minimized.

Copy link
@pswica

pswica Jun 3, 2019

Author Contributor

Thanks a lot for spotting this--it definitely seems more efficient and clean. I will correct this in another tiny PR. I really really appreciate your feedback

@k8s-ci-robot k8s-ci-robot merged commit 04c9b8c into kubernetes:master Jun 3, 2019

6 checks passed

cla/linuxfoundation pswica authorized
Details
pull-test-infra-bazel Job succeeded.
Details
pull-test-infra-gubernator Skipped.
pull-test-infra-verify-file-perms Job succeeded.
Details
pull-test-infra-yamllint Job succeeded.
Details
tide In merge pool.
Details

@pswica pswica referenced this pull request Jun 3, 2019

Merged

Fixing location of import #12851

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.