etcd-io / etcd

Distributed reliable key-value store for the most critical data of a distributed system
https://etcd.io
Apache License 2.0
46.77k stars 9.64k forks source link

etcd 3.4: install shellcheck and report if not installed. #18216

Closed thedtripp closed 10 hours ago

thedtripp commented 5 days ago

Looking into https://github.com/etcd-io/etcd/issues/17472, it appears that shellcheck is not installed. I added some code to install it, though I'm not sure if this is the correct place to do this.

At the very least, I think we should add an else block to inform that shellcheck isn't installed:

if command -v shellcheck >/dev/null; then
    shellcheckResult=$(shellcheck -fgcc build test scripts/*.sh 2>&1 || true)
    if [ -n "${shellcheckResult}" ]; then
        echo -e "shellcheck checking failed:\\n${shellcheckResult}"
        exit 255
    fi
else
    echo "Skipping shellcheck..."
fi
k8s-ci-robot commented 5 days ago

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](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
idnandre commented 4 days ago

Hi @thedtripp @jmhbnz. In "Tests / test (linux-amd64-fmt)" workflows there is still exists skipping revive message. Are we need to install revive also?

thedtripp commented 4 days ago

Hey @thedtripp - Thanks for proposing this, agree shellcheck should be automatically installed if not already present.

We do already have this functionality in main, refer: #14872.

We should backport the approach from that pull request to release-3.5 then release-3.4 so all branches managed shellcheck the same way.

Hey @jmhbnz. I submitted another PR for 3.5 here: https://github.com/etcd-io/etcd/pull/18229 If it looks good, I will repeat for 3.4. Thanks.

thedtripp commented 4 days ago

Hi @thedtripp @jmhbnz. In "Tests / test (linux-amd64-fmt)" workflows there is still exists skipping revive message. Are we need to install revive also?

Hey @idnandre, Thanks for your review. I plan to address revive in a separate PR.

jmhbnz commented 10 hours ago

Closing in favor of #18248