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

[3.4] Install shellcheck if it is not present #18248

Merged

Conversation

thedtripp
Copy link
Member

@thedtripp thedtripp commented Jun 28, 2024

Backporting shellcheck installation method to 3.4 as described here: #18216 (review)

This is based on commit 4f23883 and pull request #14872.

Related issue: #17472

Fixed outstanding shellcheck errors [SC2086] by adding double quotes to variables where needed.

@k8s-ci-robot
Copy link

Hi @thedtripp. Thanks for your PR.

I'm waiting for a etcd-io 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-sigs/prow repository.

@thedtripp
Copy link
Member Author

@jmhbnz @ivanvc, It looks like the CI for 3.4 isn't testing on ARM. Does this mean I should omit the code that will install the ARM version of shellcheck if needed?

if [ "$GOARCH" == "amd64" ]; then
    URL="https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz"
elif [[ "$GOARCH" == "arm" || "$GOARCH" == "arm64" ]]; then
    URL="https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.aarch64.tar.xz"

@jmhbnz
Copy link
Member

jmhbnz commented Jun 28, 2024

/retitle [3.4] Install shellcheck if it is not present

@k8s-ci-robot k8s-ci-robot changed the title etcd 3.4: Install shellcheck if not installed. [3.4] Install shellcheck if it is not present Jun 28, 2024
@jmhbnz
Copy link
Member

jmhbnz commented Jun 28, 2024

@jmhbnz @ivanvc, It looks like the CI for 3.4 isn't testing on ARM. Does this mean I should omit the code that will install the ARM version of shellcheck if needed?

if [ "$GOARCH" == "amd64" ]; then
    URL="https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz"
elif [[ "$GOARCH" == "arm" || "$GOARCH" == "arm64" ]]; then
    URL="https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.aarch64.tar.xz"

arm64 was only added as tier1 support for release-3.5 onwards. I would leave the code in so the commit backport is the same across both branches. If that code path is not used it's not a big deal I don't think.

@ivanvc
Copy link
Member

ivanvc commented Jun 28, 2024

Hi @thedtripp, thanks for the pull request! By looking at the changes, it seems like you're doing two things in a single commit:

  1. The backport
  2. Addressing shellcheck violations, by adding quotes to the environment variables.

I suggest splitting your commit into two commits.

/ok-to-test

@thedtripp
Copy link
Member Author

Hi @thedtripp, thanks for the pull request! By looking at the changes, it seems like you're doing two things in a single commit:

1. The backport

2. Addressing shellcheck violations, by adding quotes to the environment variables.

I suggest splitting your commit into two commits.

/ok-to-test

Ok! I'll split it up.

Include conditional logic to install shellcheck with correct architecture.

This is based on commit 4f23883 and pull request etcd-io#14872.

Signed-off-by: D Tripp <[email protected]>
@thedtripp thedtripp force-pushed the feature/installShellcheckBackport3.4 branch from f71b6c1 to e3c0ac0 Compare June 28, 2024 23:35
Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks @thedtripp

Copy link
Member

@ivanvc ivanvc left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, @thedtripp :)

@jmhbnz jmhbnz merged commit 9873813 into etcd-io:release-3.4 Jun 29, 2024
18 checks passed
@thedtripp thedtripp deleted the feature/installShellcheckBackport3.4 branch June 29, 2024 17:10
@ivanvc ivanvc mentioned this pull request Aug 22, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants