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

fix shellcheck in hack/... and pkg/... and staging/... #74205

Closed

Conversation

xichengliudui
Copy link
Contributor

@xichengliudui xichengliudui commented Feb 18, 2019

What type of PR is this?
fix shellcheck in hack/... and pkg/... and staging/...
/kind cleanup

What this PR does / why we need it:
fix shellcheck in hack/... and pkg/... and staging/...

Which issue(s) this PR fixes:

Ref #72956

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 18, 2019
@k8s-ci-robot k8s-ci-robot added area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Feb 18, 2019
@xichengliudui
Copy link
Contributor Author

/assign @cblecker @lavalamp @deads2k @piosz

@xichengliudui
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce

…/hack/...

update pull request

update pull request

update pull request

update pull request

update pull request

update pull request

update pull request

update pull request
@xichengliudui
Copy link
Contributor Author

/assign @BenTheElder

${CODEGEN_PKG}/generate-groups.sh client \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt
"${CODEGEN_PKG}"/generate-groups.sh client \
Copy link
Member

Choose a reason for hiding this comment

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

please quote the whole string for these

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your reminding. I have modified it. Thank you

--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
--go-header-file "${SCRIPT_ROOT}"/hack/boilerplate.go.txt
Copy link
Member

Choose a reason for hiding this comment

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

and here please :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Has been completed.

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

@BenTheElder BenTheElder left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@xichengliudui
Copy link
Contributor Author

/test pull-kubernetes-e2e-gce-100-performance

--output-base "$(dirname ${BASH_SOURCE})/../../.." \
--go-header-file ${SCRIPT_ROOT}/hack/boilerplate.go.txt
${CODEGEN_PKG}/generate-groups.sh client \
--output-base "$(dirname "${BASH_SOURCE[0]}")/../../.." \
Copy link
Member

Choose a reason for hiding this comment

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

I would pull this out into its own OUTPUT_BASE var above, so you don't have the weird nested quotes thing going on here, ie:

OUTPUT_BASE=$(dirname "${BASH_SOURCE[0]}")/../../..
#...
--output-base "${OUTPUT_BASE}"

You might also consider using SCRIPT_ROOT instead of redoing the BASH_SOURCE thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Brother, this modification will cause additional problems.
It will look like this:

In ./staging/src/k8s.io/metrics/hack/update-codegen.sh line 35:
  --output-base "${OUTPUT_BASE}"
  ^-----------^ SC2215: This flag is used as a command name. Bad line break or missing [ .. ]?
In ./staging/src/k8s.io/metrics/hack/update-codegen.sh line 36:
  --go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"
  ^--------------^ SC2215: This flag is used as a command name. Bad line break or missing [ .. ]?

did I make a mistake? Do you have a detailed reply? thank you

Copy link
Member

Choose a reason for hiding this comment

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

You are likely missing \ at the end of the line above it and on the end of the line containing --output-base "${OUTPUT_BASE}"

It should look similar to this:

"${CODEGEN_PKG}/generate-internal-groups.sh" deepcopy,conversion \
  k8s.io/metrics/pkg/client k8s.io/metrics/pkg/apis k8s.io/metrics/pkg/apis \
  "metrics:v1alpha1,v1beta1 custom_metrics:v1beta1 external_metrics:v1beta1" \ 
  --output-base "${OUTPUT_BASE}" \
  --go-header-file "${SCRIPT_ROOT}/hack/boilerplate.go.txt"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

--output-base "${OUTPUT_BASE}" \

Appear above problem.

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @mrbobbytables the error really reads like a missing trailing \, shellcheck was happy with my suggested changes locally

Since I can't see the source you're running this against, my advice would be to look above your output-base and go-header-file lines

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 21, 2019
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 21, 2019
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 21, 2019
@xichengliudui
Copy link
Contributor Author

/retest

@xichengliudui
Copy link
Contributor Author

/assign @cblecker @lavalamp @deads2k @piosz

@spiffxp
Copy link
Member

spiffxp commented Feb 22, 2019

needs rebase

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Feb 22, 2019
@cblecker cblecker added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 22, 2019
@xichengliudui xichengliudui force-pushed the fixshellcheck19021803 branch 2 times, most recently from db8ff08 to bc6bff4 Compare February 23, 2019 09:37
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 23, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BenTheElder, xichengliudui
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: lavalamp

If they are not already assigned, you can assign the PR to them by writing /assign @lavalamp in a comment when ready.

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

@xichengliudui
Copy link
Contributor Author

/retest

@xichengliudui xichengliudui force-pushed the fixshellcheck19021803 branch 2 times, most recently from 9be1273 to ca2bc4b Compare February 23, 2019 09:50
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 23, 2019
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Feb 23, 2019

@xichengliudui: The following tests failed for commit ca2bc4b, say /retest to rerun them:

Test name Details Rerun command
pull-kubernetes-e2e-gce link /test pull-kubernetes-e2e-gce
pull-kubernetes-godeps link /test pull-kubernetes-godeps
pull-kubernetes-bazel-test link /test pull-kubernetes-bazel-test
pull-kubernetes-node-e2e link /test pull-kubernetes-node-e2e
pull-kubernetes-integration link /test pull-kubernetes-integration
pull-kubernetes-kubemark-e2e-gce-big link /test pull-kubernetes-kubemark-e2e-gce-big
pull-kubernetes-e2e-gce-100-performance link /test pull-kubernetes-e2e-gce-100-performance
pull-kubernetes-e2e-gce-device-plugin-gpu link /test pull-kubernetes-e2e-gce-device-plugin-gpu
pull-kubernetes-verify link /test pull-kubernetes-verify
pull-kubernetes-typecheck link /test pull-kubernetes-typecheck
pull-kubernetes-bazel-build link /test pull-kubernetes-bazel-build

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@xichengliudui xichengliudui deleted the fixshellcheck19021803 branch February 23, 2019 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note-none Denotes a PR that doesn't merit a release note. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants