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

🐛 (go/v3): remove a no longer applied comment from Makefile #2808

Merged

Conversation

erikgb
Copy link
Contributor

@erikgb erikgb commented Jul 7, 2022

I just created a new project with kubebuilder, and got confused over a comment in the scaffolded Makefile:

# This is a requirement for 'setup-envtest.sh' in the test target.

This was added in #2149, but later replaced with go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 7, 2022
Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

I only have one concern with this change. I do agree that the comment stating:
This is a requirement for 'setup-envtest.sh' in the test target should be removed but I am not sure entirely removing the block that sets the SHELL is a good idea due to some potential issues.

# Setting SHELL to bash allows bash commands to be executed by recipes.
# This is a requirement for 'setup-envtest.sh' in the test target.
# Options are set to exit when a recipe line exits non-zero or a piped command fails.
SHELL = /usr/bin/env bash -o pipefail
Copy link
Contributor

Choose a reason for hiding this comment

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

My only concern with this change is that while the comment states that This is a requirement for 'setup-envtest.sh' in the test target., are there any other scripts or anything of the sort used throughout the Makefile that uses bash specific syntax? A quick check shows that the script used to install Kustomize is a bash script and likely uses bash specific syntax:

KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"

It's also my understanding that it is best practice to specify the SHELL in a Makefile.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I am not a shell expert, nor on makefiles. Ref. my comment in the PR description:

I think at least the comment should be deleted, but I suggest to remove the whole block.

Should I just remove the misleading comment then?

Copy link
Contributor

Choose a reason for hiding this comment

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

@erikgb I am all for removing just the comment. If that is the only change then I think it is pretty trivial and I would be happy to approve the PR after that! Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about the manual migration docs? Leave it as is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the PR to just remove the misleading comment. PTAL!

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like the manual migration docs is okay to leave as is.

Will re-review the new changes now.

Copy link
Member

@camilamacedo86 camilamacedo86 Jul 7, 2022

Choose a reason for hiding this comment

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

@erikgb,

The PR only removes
> # This is a requirement for 'setup-envtest.sh' in the test target.

We no longer use the 'setup-envtest.sh' so I think that is 100 fine to move forward. 👍
I think we cannot remove the SHELL code for the reasons pointed out by @everettraven.
We are using the shell to install the kustomize.

@erikgb erikgb force-pushed the fix/makefile-setup-envtest branch from e54e190 to 1e2b4b6 Compare July 7, 2022 15:03
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 7, 2022
@erikgb erikgb requested a review from everettraven July 7, 2022 15:03
Copy link
Contributor

@everettraven everettraven left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @erikgb ! This looks good to me!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2022
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

HI @erikgb,

Good catcher one this one 👍

The only thing is that change the scaffolds so would be better to change the title like

🐛 (go/v3): remove a comment that is no longer applied from Makefile.

I hope that you do not mind I will update the title for we get this one merged.

/approved

@camilamacedo86 camilamacedo86 changed the title 🌱 fix: cleanup setup-envtest.sh from Makefile scaffolding 🐛 (go/v3): remove a comment that is no longer applied from Makefile Jul 7, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, erikgb, everettraven

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 7, 2022
@camilamacedo86 camilamacedo86 changed the title 🐛 (go/v3): remove a comment that is no longer applied from Makefile 🐛 (go/v3): remove a no longer applied comment from Makefile Jul 7, 2022
@k8s-ci-robot k8s-ci-robot merged commit 95f55fc into kubernetes-sigs:master Jul 7, 2022
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/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.

None yet

4 participants