cluster-api-provider-azure
cluster-api-provider-azure copied to clipboard
Simplify and reuse variables in hack/*.sh scripts
What type of PR is this? This is a kind of Code clean PR, In this PR I have simplified and reused the variable before that were declared multiple times hack/*.sh scripts moving some of variables into common-vars.sh . This PR Fixes issue #2499
TODOs:
- [ ] Squash commits
@lakshkeswani: Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.
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.
Welcome @lakshkeswani!
It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-azure 🎉. 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/cluster-api-provider-azure 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. :smiley:
Hi @lakshkeswani. 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.
Thanks for the PR @lakshkeswani !
- There some more variables in the
hack/tools/*.sh
scripts,root
YQ
,envsubst
,REPO_ROOT
, etc which could be pulled into thecommon_vars.sh
.
~I did not mention the following in the original issue but now that I think of it, would we want to install the binaries too through common_vars.sh
? If yes, then common_vars.sh
would also run make --directory=<go_to_repo_root> <binary_names>
for all the binary variables.~
I updated the comment above @lakshkeswani
/ok-to-test
Looks like common-vars.sh
needs to add the standard copyright header:
#!/bin/bash
# Copyright 2022 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
@nawazkh should we use one variable for root,KUBE_ROOT, ROOT? because all are referring to the same thing
@nawazkh should we use one variable for root, KUBE_ROOT, ROOT ?
That seems like it's worth simplifying. Maybe use REPO_ROOT
or just ROOT
? Thanks for noticing that!
(And thanks for your patience on this PR, it's really appreciated. @nawazkh is out for a couple weeks, btw.)
/reopen
@lakshkeswani: Reopened this PR.
In response to this:
/reopen
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.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign justinsb for approval by writing /assign @justinsb
in a comment. For more information see:The Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign justinsb for approval by writing /assign @justinsb
in a comment. For more information see:The Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
@nawazkh above you stated the envsubt and YQ should be moved into common-vars but these are only used once
@nawazkh above you stated the envsubt and YQ should be moved into common-vars but these are only used once
You are right that they are used just once.
But for consistency and any future scope of reusing envsubst
and yq
we would want to get envsubst and YQ into common_vars.sh
.
It be nice to have the PR description as per the template. k8s-ci-robot tracks the contents of the description (as per the PR template) to update the labels on the PR.
/retest-required
/test pull-cluster-api-provider-azure-coverage
/retest
~~@nawazkh one test make verify-shellcheck
which is failing is the errors in test logs we have some variables which are in common-vars
file that are unused according to error message. I guess this test is checking the variables usability in common-vars
so as a reviewer please look at failed test logs we can ignore this too and other solution I tried to use the directive to skip the shell check but coverage test failed. Have look at test logs let me know what we can do.~~
@nawazkh Now all the tests have are passed so should I move to squashing comments?
/test pull-cluster-api-provider-azure-e2e
You'd also want to fix your Release Note
section for the do-not-merge/release-note-label-needed
label to go away.
/lifecycle active
Done added release-notes
in PR description.
Thanks! /lgtm
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: CecileRobertMichon
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [CecileRobertMichon]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
/retest
likely a flake