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

Check For Prerequisites For Scaffolded Makefile #1427

Closed

Conversation

dmizelle
Copy link

This commit checks that the prerequisites listed in the Kubebuilder book
are in $PATH before proceeding with any target.

We probably want the user to get better feedback up front instead of
make failing half-way through (possibly)

Fixes #1371


Not part of the commit message, but here's how it works.

devon@DESKTOP-KDNMKJN:~/git/kubebuilder/devon-test$ make
Makefile:13: *** "Unable to find kustomize in your PATH".  Stop.
devon@DESKTOP-KDNMKJN:~/git/kubebuilder/devon-test$ curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv3.5.4/kustomize_v3.5.4
_linux_amd64.tar.gz | tar -xvzf- && mv kustomize ~/bin && chmod +x ~/bin/kustomize
kustomize
devon@DESKTOP-KDNMKJN:~/git/kubebuilder/devon-test$ make
/home/devon/git/go/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
go build -o bin/manager main.go
[...snip for brevity...]

Purposefully removed kustomize from my $PATH, fails as intended, replace it, continues to work.

This commit checks that the prerequisites listed in the Kubebuilder book
are in `$PATH` before proceeding with any target.

We probably want the user to get better feedback up front instead of
`make` failing half-way through (possibly)

Fixes kubernetes-sigs#1371
@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Mar 12, 2020
@k8s-ci-robot
Copy link
Contributor

Keywords which can automatically close issues and at(@) mentions are not allowed in commit messages.

The list of commits with invalid commit messages:

  • babdc42 Check For Prerequisites For Scaffolded Makefile

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. I understand the commands that are listed here.

@k8s-ci-robot
Copy link
Contributor

Welcome @dmizelle!

It looks like this is your first PR to kubernetes-sigs/kubebuilder 🎉. 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-sigs/kubebuilder 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 k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 12, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @dmizelle. 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/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Mar 12, 2020
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Mar 12, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dmizelle
To complete the pull request process, please assign mengqiy
You can assign the PR to them by writing /assign @mengqiy in a comment when ready.

The full list of commands accepted by this bot can be found 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

@Adirio
Copy link
Contributor

Adirio commented Mar 12, 2020

Some comments:

  1. First thing to do to contribute to any k8s-related project is to sign the CLA. Without it, your code cannot be included in the project. @k8s-ci-robot kindly left you the relevant instruction in this Check For Prerequisites For Scaffolded Makefile #1427 (comment).
  2. When you modify any of the scaffolded files, you need to run the generate_golden.sh script. It basically refreshes the testdata directory so that the files over there apply the changes you just did.
  3. Commit messages cannot contain the Fixes #XXXX message, that needs to be in the PR description (you already did that) but not in the commit message.
  4. Travis is failing returning the following error: Makefile:13: *** "Unable to find kustomize in your PATH". Stop. Log

Related to the commit itself, IMO testing it in the Makefile is not the best approach. It is way harder to achieve cross-OS portability.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 12, 2020
@Adirio
Copy link
Contributor

Adirio commented Mar 14, 2020

/hold until #1371 discussion is settled

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 14, 2020
@camilamacedo86
Copy link
Member

HI @dmizelle,

The issue was solved with the makefile solution in #1430 so I understand that has no reason for we keep this PR. In this way, I am casing this one. However, please feel free to re-open if you see anything that should be addressed with. Really tks for your collab. 🥇

/close

@k8s-ci-robot
Copy link
Contributor

@camilamacedo86: Closed this PR.

In response to this:

HI @dmizelle,

The issue was solved with the makefile solution in #1430 so I understand that has no reason for we keep this PR. In this way, I am casing this one. However, please feel free to re-open if you see anything that should be addressed with. Really tks for your collab. 🥇

/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing Kustomize Dependency for make install
4 participants