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

Remove YEAR field of all generated files and fix kubernetes boilerplate checker #59172

Merged
merged 3 commits into from Mar 21, 2018

Conversation

@fisherxu
Copy link
Member

fisherxu commented Feb 1, 2018

What this PR does / why we need it:
Remove YEAR field of all generated files and fix kubernetes boilerplate checker
xref: remove YEAR fileds in gengo #91

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #gengo/issues/24

Special notes for your reviewer:
/cc @thockin @lavalamp @sttts

Release note:

NONE
@fisherxu

This comment has been minimized.

Copy link
Member Author

fisherxu commented Feb 1, 2018

@cblecker

This comment has been minimized.

Copy link
Member

cblecker commented Feb 1, 2018

/ok-to-test

@cblecker

This comment has been minimized.

Copy link
Member

cblecker commented Feb 1, 2018

@fisherxu Can you replace the release note with "NONE"? No release note is needed here.

@fisherxu

This comment has been minimized.

Copy link
Member Author

fisherxu commented Feb 1, 2018

@cblecker Sure, have done

@sttts

This comment has been minimized.

Copy link
Contributor

sttts commented Feb 1, 2018

/hold

This conflicts with #57656. We don't want the boilerplate without the year in kube, but it should come from the code-generator repo.

@thockin
Copy link
Member

thockin left a comment

I really dislike the idea of coding in a list of directories. I don't have a better answer off the top of my head, but consider this a plea - can anyone please find a better approach to this?

@lavalamp

@@ -183,14 +197,84 @@ def get_regexs():
regexs["shebang"] = re.compile(r"^(#!.*\n)\n*", re.MULTILINE)
return regexs

def generated_files(filename):

This comment has been minimized.

Copy link
@thockin

thockin Feb 6, 2018

Member

is_generated_file

Maybe a comment, please? Explain the hueristic and why..

This comment has been minimized.

Copy link
@fisherxu

fisherxu Feb 6, 2018

Author Member

Have added some comments :) I also have no better approach to identify the generated files :(

@fisherxu fisherxu force-pushed the fisherxu:removeyear branch from 14d5ee1 to 8531588 Feb 6, 2018

@fisherxu fisherxu force-pushed the fisherxu:removeyear branch 2 times, most recently from 93a8f87 to 6e3bbbb Feb 6, 2018

@@ -133,6 +133,20 @@ def file_extension(filename):
"vendor", "test/e2e/generated/bindata.go", "hack/boilerplate/test",
"pkg/generated/bindata.go"]

# list all the dirs that contain generated files
generated_dirs = ['pkg/client/listers', 'pkg/client/clientset_generated', 'pkg/client/informers', 'k8s.io/sample-controller/pkg/client/listers',

This comment has been minimized.

Copy link
@sttts

sttts Feb 8, 2018

Contributor

I am also against having another directory list. Note that we will also have this "DO NOT EDIT" line in generated files. Can't we just use that to detect generated files?

This comment has been minimized.

Copy link
@fisherxu

fisherxu Feb 8, 2018

Author Member

yeah, it's a nice idea, but the comment in different files is also different, like pkg/client/listers/admissionregistration/internalversion/expansion_generated.go and zz_generated.deepcopy.go

This comment has been minimized.

Copy link
@fisherxu

fisherxu Feb 8, 2018

Author Member

How about make the comments all the same? then may be we can identify them easily

This comment has been minimized.

Copy link
@sttts

sttts Feb 8, 2018

Contributor

With an updated gengo it will be uniform.

This comment has been minimized.

Copy link
@sttts

This comment has been minimized.

Copy link
@fisherxu

fisherxu Feb 9, 2018

Author Member

OK, some files generated from script in hack maybe also need fixed.

@sttts

This comment has been minimized.

Copy link
Contributor

sttts commented Mar 8, 2018

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm label Mar 8, 2018

@sttts sttts removed the lgtm label Mar 8, 2018

@sttts

This comment has been minimized.

Copy link
Contributor

sttts commented Mar 8, 2018

Please squash.

fisherxu added some commits Jan 22, 2018

add boilerplate.generatego.txt and let all code-generators use it
remove YEAR field in boilerplate under staging

add Do Not Edit for types_swagger_doc and add apiextensions-apiserver's example in codegen.sh
fix boilerplate checker of kubernetes/kubernetes
update bazel and remove passing golint packages

@fisherxu fisherxu force-pushed the fisherxu:removeyear branch from a405a23 to 93b9b82 Mar 8, 2018

@fisherxu

This comment has been minimized.

Copy link
Member Author

fisherxu commented Mar 8, 2018

@sttts Have squashed to 3 commits, PTAL

@sttts

This comment has been minimized.

Copy link
Contributor

sttts commented Mar 8, 2018

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm label Mar 8, 2018

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Mar 18, 2018

@fisherxu: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-kubeadm-gce-canary 14d5ee1 link /test pull-kubernetes-e2e-kubeadm-gce-canary

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.

@cblecker

This comment has been minimized.

Copy link
Member

cblecker commented Mar 18, 2018

/retest

@@ -449,12 +449,6 @@ staging/src/k8s.io/api/storage/v1alpha1
staging/src/k8s.io/api/storage/v1beta1
staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr
staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/apis/cr/v1
staging/src/k8s.io/apiextensions-apiserver/examples/client-go/pkg/client/clientset/versioned

This comment has been minimized.

Copy link
@thockin

thockin Mar 21, 2018

Member

This seems unrelated to the rest of the PR?

This comment has been minimized.

Copy link
@fisherxu

fisherxu Mar 22, 2018

Author Member

Run hack/update-all.sh don't contain file in the apiextensions-apiserver/examples, so I run the script in apiextensions-apiserver/examples manually.

@thockin

This comment has been minimized.

Copy link
Member

thockin commented Mar 21, 2018

/approve

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

k8s-ci-robot commented Mar 21, 2018

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fisherxu, sttts, thockin

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-github-robot

This comment has been minimized.

Copy link
Contributor

k8s-github-robot commented Mar 21, 2018

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot

This comment has been minimized.

Copy link
Contributor

k8s-github-robot commented Mar 21, 2018

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit e40ffd7 into kubernetes:master Mar 21, 2018

13 of 14 checks passed

Submit Queue Required Github CI test is not green: pull-kubernetes-verify
Details
cla/linuxfoundation fisherxu authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-cross Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gke Skipped
pull-kubernetes-e2e-kops-aws Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce Job succeeded.
Details
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details

bmwiedemann added a commit to bmwiedemann/dashboard that referenced this pull request Aug 25, 2018

Don't claim copyright for future years
When building the kubernetes-dashboard openSUSE package
in future years, files differed because they contained
something like
this.latestCopyrightYear="2033"

See https://reproducible-builds.org/ for why this is matters.

And https://stackoverflow.com/questions/2390230/do-copyright-dates-need-to-be-updated suggests that expiry should not be a concern anyway.

kubernetes/kubernetes#59172 fixed this for kubernetes.

bmwiedemann added a commit to bmwiedemann/dashboard that referenced this pull request Aug 25, 2018

Don't claim copyright for future years
When building the kubernetes-dashboard openSUSE package
in future years, files differed because they contained
something like
this.latestCopyrightYear="2033"

See https://reproducible-builds.org/ for why this matters.

And https://stackoverflow.com/questions/2390230/do-copyright-dates-need-to-be-updated suggests that expiry should not be a concern anyway.

kubernetes/kubernetes#59172 fixed this for kubernetes.

bmwiedemann added a commit to bmwiedemann/dashboard that referenced this pull request Aug 30, 2018

Don't claim copyright for future years
When building the kubernetes-dashboard openSUSE package
in future years, files differed because they contained
something like
this.latestCopyrightYear="2033"

See https://reproducible-builds.org/ for why this matters.

And https://stackoverflow.com/questions/2390230/do-copyright-dates-need-to-be-updated suggests that expiry should not be a concern anyway.

kubernetes/kubernetes#59172 fixed this for kubernetes.

k8s-ci-robot added a commit to kubernetes/dashboard that referenced this pull request Aug 30, 2018

Don't claim copyright for future years (#3233)
When building the kubernetes-dashboard openSUSE package
in future years, files differed because they contained
something like
this.latestCopyrightYear="2033"

See https://reproducible-builds.org/ for why this matters.

And https://stackoverflow.com/questions/2390230/do-copyright-dates-need-to-be-updated suggests that expiry should not be a concern anyway.

kubernetes/kubernetes#59172 fixed this for kubernetes.

jeefy added a commit to jeefy/dashboard that referenced this pull request Sep 13, 2018

Don't claim copyright for future years (kubernetes#3233)
When building the kubernetes-dashboard openSUSE package
in future years, files differed because they contained
something like
this.latestCopyrightYear="2033"

See https://reproducible-builds.org/ for why this matters.

And https://stackoverflow.com/questions/2390230/do-copyright-dates-need-to-be-updated suggests that expiry should not be a concern anyway.

kubernetes/kubernetes#59172 fixed this for kubernetes.

@fisherxu fisherxu deleted the fisherxu:removeyear branch Jan 3, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.