-
Notifications
You must be signed in to change notification settings - Fork 4k
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
VPA: Enforce flag documentation check in CI #7857
base: master
Are you sure you want to change the base?
VPA: Enforce flag documentation check in CI #7857
Conversation
Welcome @pjsharath28! |
Hi @pjsharath28. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
933eb01
to
ab14079
Compare
/ok-to-test |
ab14079
to
7d4a883
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
Please check my attached comment. I realize I wasn’t clear enough in the issue description - sorry about that.
Could you add a script to the autoscaler/hack
directory that triggers vertical-pod-autoscaler/hack/verify-vpa-flags.sh
? (verify-all.sh
calls all verify-*
scripts in this directory.)"
.github/workflows/ci.yaml
Outdated
- name: Verify vertical-pod-autoscaler flags | ||
working-directory: ${{ env.GOPATH }}/src/k8s.io/autoscaler/vertical-pod-autoscaler | ||
run: hack/verify-vpa-flags.sh | ||
env: | ||
GO111MODULE: auto | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary since the previous step already runs all verify-*.sh files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not getting considered probably because it is in a different directory.
I'll update the verify-all.sh
so that this block could be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as I said you need to add a script to the autoscaler/hack
directory that triggers vertical-pod-autoscaler/hack/verify-vpa-flags.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script vertical-pod-autoscaler/hack/verify-codegen.sh
runs because of your change in hack/verify-all.sh
. But we don’t want to run all verify-*
scripts in the vertical-pod-autoscaler/hack
folder.
I suggest adding a new script, like verify-vpa-flags.sh
, in the main hack
folder. This script will run vertical-pod-autoscaler/hack/verify-vpa-flags.sh
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated. PTAL!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs to be called from the GitHub Action though, which doesn't happen at the moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad! I see we have this:
Line 56 in c5789ae
for t in `ls $KUBE_ROOT/hack/verify-*.sh` |
if [[ "$existing_flags" == "$updated_flags" ]]; then | ||
echo "VPA flags are up to date." | ||
else | ||
echo "VPA flags have been modified." | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to print anything when the check passes. I suggest using something like this instead:
if [[ "$existing_flags" != "$updated_flags" ]]; then
echo "VPA flags are not up to date. Please run ${GENERATE_FLAGS_SCRIPT}"
exit 1
fi
bb442f2
to
e752f67
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: pjsharath28 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
e752f67
to
73fa3ed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small nit.
hack/verify-vpa-flags.sh
Outdated
echo "Running VPA flags verification..." | ||
"$VPA_FLAGS_SCRIPT" | ||
|
||
echo "VPA flags verification completed successfully." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need to print this - we just need to ensure the pipeline passes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
73fa3ed
to
21316a6
Compare
/lgtm |
/lgtm Thanks for doing this! |
What type of PR is this?
/area vertical-pod-autoscaler
/kind cleanup
What this PR does / why we need it:
Adds a CI check to enforce that VPA flag documentation remains up-to-date by failing if modifications are detected.
Which issue(s) this PR fixes:
Fixes #7844
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: