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
[OCPCLOUD-809] Add verify-diff check in generate task and enable in CI #744
[OCPCLOUD-809] Add verify-diff check in generate task and enable in CI #744
Conversation
/retest |
- Check file diff between committed code and generated bits with hack/verify-diff.sh - go generate is moved into it's own script, which uses docker image with goimports tool in it - hack/go-gen.sh
310f052
to
c2d0175
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexander-demichev 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 |
|
||
REPO_NAME=$(basename "${PWD}") | ||
if [ "$IS_CONTAINER" != "" ]; then | ||
go generate ./pkg/apis/... |
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.
Running this line forcefully in a container, as the goimports
tool is a requirement for the environment, but a user/CI should not nessesary have it.
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.
I think we may be able to workaround this by running it from the vendor directory, do you know where the go generate command is in the code that is causing us to need goimports
?
# creates. A simple `go generate` is enough for these. | ||
# Also use this for generating deepcopy for all types (so that we use the same generator). | ||
echo "Generating deepcopy funcs" | ||
go generate ./pkg/apis/... |
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 a part of codegen workflow, but was failing for me using the default docker comand coming from Makefile. Now it is a separate task managed by Makefile in https://github.com/openshift/machine-api-operator/pull/744/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52R68
/hold need to remove all docker references in CI run before merging |
@Danil-Grigorev: The following test failed, say
Full PR test history. Your PR dashboard. 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. |
/hold cancel |
/retest |
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.
i tried this out locally a few times and everything seemed to work as i would expect.
/lgtm
This PR is dependent on openshift/release#13400 to enable the functionality in CI. Should go prior to the PR, allowing CI to get green.
Changes: