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

Add verify script for deep-copies generator #545

Merged

Conversation

pravarag
Copy link
Contributor

@pravarag pravarag commented Apr 8, 2021

This PR is related to: #483

This PR contains changes for verifying deep-copies generator. Below are the logs,

  1. When there are no changes,
-bash>descheduler(add-verify-script-deep-copies)$
 ->  make verify-gen
./hack/verify-conversions.sh
Generated conversions verified.
./hack/verify-deep-copies.sh
Generated deep-copies verified.
  1. After making a change in the api similar to the change mentioned here for validating failed scenario,
-bash>descheduler(add-verify-script-deep-copies)$
 ->  ./hack/verify-deep-copies.sh
Generated deep-copies output differs:
diff -Naupr pkg/api/v1alpha1/zz_generated.deepcopy.go ./hack/../_tmp/kube-verify.whSrQp/descheduler/pkg/api/v1alpha1/zz_generated.deepcopy.go
--- pkg/api/v1alpha1/zz_generated.deepcopy.go	2021-04-08 11:16:08.000000000 +0530
+++ ./hack/../_tmp/kube-verify.whSrQp/descheduler/pkg/api/v1alpha1/zz_generated.deepcopy.go	2021-04-08 11:17:03.000000000 +0530
@@ -61,7 +61,6 @@ func (in *DeschedulerPolicy) DeepCopyInt
 		*out = new(int)
 		**out = **in
 	}
-	out.Foo = in.Foo
 	return
 }

Generated deep-copies verify failed.

@k8s-ci-robot
Copy link
Contributor

Hi @pravarag. 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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 8, 2021
@seanmalloy
Copy link
Member

This PR fixes: #483

Please edit the description to say "This PR is related to #483".

fi
popd > /dev/null 2>&1

echo "Generated deep-copies verified."
Copy link
Member

@seanmalloy seanmalloy Apr 8, 2021

Choose a reason for hiding this comment

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

Please delete this line. You can also remove this line from the verify-conversions.sh script too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you referring to, line 34 or line 36 ?

Copy link
Member

Choose a reason for hiding this comment

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

Line 36

Copy link
Contributor

@damemi damemi Apr 8, 2021

Choose a reason for hiding this comment

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

Some kind of "success" message is helpful rather than printing nothing, to show that the script did actually complete (for local runs, and for CI where we are calling multiple scripts).

I would also update the failure message to include a Please run ./hack/update-deep-copies.sh (same for conversions if it doesn't already)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated with latest push.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I'll just put back those in with the updated failure message as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, sorry for the back and forth but I do think these are worth having... You may want to wait for @seanmalloy to see if he agrees or there is something I'm overlooking 🙂

Copy link
Member

@seanmalloy seanmalloy Apr 8, 2021

Choose a reason for hiding this comment

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

It's fine to keep the echo statement.

Copy link
Member

Choose a reason for hiding this comment

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

@pravarag you can re-add the echo statement. Sorry for the confusion.

@seanmalloy
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 8, 2021
@pravarag pravarag force-pushed the add-verify-script-deep-copies branch from 58b2314 to 487a3e9 Compare April 8, 2021 14:54
@@ -32,5 +32,3 @@ if ! _out="$(diff -Naupr pkg/ "${_deschedulertmp}/pkg/")"; then
exit 1
fi
popd > /dev/null 2>&1

echo "Generated conversions verified."
Copy link
Member

Choose a reason for hiding this comment

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

Please don't delete these lines. Sorry for the confusion.

@pravarag pravarag force-pushed the add-verify-script-deep-copies branch from 487a3e9 to 4fce2ca Compare April 8, 2021 17:21
@pravarag
Copy link
Contributor Author

pravarag commented Apr 8, 2021

I've added back the echo statements and updated the failure message as well.

@damemi
Copy link
Contributor

damemi commented Apr 8, 2021

@pravarag thanks, this looks good to me
/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2021
@seanmalloy
Copy link
Member

/lgtm
/kind cleanup

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Apr 9, 2021
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 9, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damemi, pravarag, seanmalloy

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

@k8s-ci-robot k8s-ci-robot merged commit 9fe585c into kubernetes-sigs:master Apr 9, 2021
@pravarag
Copy link
Contributor Author

pravarag commented Apr 9, 2021

Thanks @seanmalloy @damemi for merging this 🙂

briend pushed a commit to briend/descheduler that referenced this pull request Feb 11, 2022
…t-deep-copies

Add verify script for deep-copies generator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

4 participants