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

Improve tooling installation #24

Merged
merged 4 commits into from
Jan 29, 2023
Merged

Conversation

mrueg
Copy link
Member

@mrueg mrueg commented Jan 26, 2023

  • Update tools to latest version
  • Don't repeat ourselves in the install.sh

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 26, 2023
@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 26, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @mrueg. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 26, 2023
@logicalhan
Copy link

/assign @ehashman
/triage accepted
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 26, 2023
tools/install.sh Outdated
sigs.k8s.io/controller-tools/cmd/controller-gen \
github.com/golangci/golangci-lint/cmd/golangci-lint \
sigs.k8s.io/kustomize/kustomize/v3
cat tools.go | grep _ | awk -F'"' '{print $2}' | xargs -tI % go install %
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand what this does but this sacrifices clarity for reusability, can you add a brief comment explaining what this does? The grep expression is also very broad, might want to scope it down. e.g.

Suggested change
cat tools.go | grep _ | awk -F'"' '{print $2}' | xargs -tI % go install %
# Find import lines matching _, drop the _ and whitespace, pass as arguments to go install
grep '^\s*_' tools.go | awk '{print $2}' | xargs -t go install

Changes I made in the suggestion here:

  • cat isn't necessary
  • reduced scope of grep to only match lines that start with possible whitespace then _
  • no need to set the field separator to ", the shell will handle them fine
  • pass all lines directly to a single go install command rather than installing each dep separately, which preserves the current behaviour of this script

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 26, 2023
This way you only need to add them to tools.go

Co-Authored-By: Elana Hashman <ehashman@apple.com>
// protoc-gen-go v1.28.0
// protoc v3.21.12
// protoc-gen-go v1.28.1
// protoc v3.21.9
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why this downgraded here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@mrueg I set up the CI installer to use 21.21, if this is regenerating locally with a lower version then your local install might be behind? As is this will fail the vet CI job.

PB_VERSION=${PB_VERSION:-21.12}

tools/go.mod Show resolved Hide resolved
@@ -121,46 +111,45 @@ require (
github.com/lufeee/execinquery v1.2.1 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/maratori/testableexamples v1.0.0 // indirect
Copy link
Contributor

Choose a reason for hiding this comment

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

MIT - what is pulling this in?

Copy link
Member Author

Choose a reason for hiding this comment

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

./github.com/golangci/golangci-lint/pkg/golinters/testpackage.go: "github.com/maratori/testpackage/pkg/testpackage"
./github.com/golangci/golangci-lint/pkg/golinters/testableexamples.go: "github.com/maratori/testableexamples/pkg/testableexamples"

tools/go.mod Show resolved Hide resolved
// protoc-gen-go v1.28.0
// protoc v3.21.12
// protoc-gen-go v1.28.1
// protoc v3.21.9
Copy link
Contributor

Choose a reason for hiding this comment

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

@mrueg I set up the CI installer to use 21.21, if this is regenerating locally with a lower version then your local install might be behind? As is this will fail the vet CI job.

PB_VERSION=${PB_VERSION:-21.12}

tools/go.mod Show resolved Hide resolved
Copy link
Contributor

@ndipebot ndipebot left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot
Copy link
Contributor

@ndipebot: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

@pwittrock
Copy link
Contributor

neat trick

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 29, 2023
@pwittrock
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 29, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrueg, ndipebot, pwittrock

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

@k8s-ci-robot k8s-ci-robot merged commit a14f000 into kubernetes-sigs:main Jan 29, 2023
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants