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

x/tools/godoc/static, x/website/content/static: hardcode copyright year in static.go to be the year the file was first created #36360

Closed
dmitshur opened this issue Jan 2, 2020 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Jan 2, 2020

Based on my reading of https://golang.org/doc/contribute.html#copyright:

Files in the repository are copyrighted the year they are added. Do not update the copyright year on files that you change.

There shouldn't be a need to keep updating the copyright year in the generated static.go to be the current year, causing TestStaticIsUpToDate to fail at the beginning of each year and needing to be regenerated (e.g., see CL 156077, CL 156079 and CL 213037).

/cc @bradfitz @stamblerre @heschik

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 2, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jan 2, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Jan 2, 2020
@dmitshur dmitshur changed the title x/tools/godoc/static: hardcode copyright year to be the year the file was first created x/tools/godoc/static, x/website/content/static: hardcode copyright year to be the year the file was first created Jan 2, 2020
@dmitshur dmitshur changed the title x/tools/godoc/static, x/website/content/static: hardcode copyright year to be the year the file was first created x/tools/godoc/static, x/website/content/static: hardcode copyright year in static.go to be the year the file was first created Jan 2, 2020
@gopherbot
Copy link

Change https://golang.org/cl/213119 mentions this issue: godoc/static: update copyright year to 2013

gopherbot pushed a commit to golang/tools that referenced this issue Jan 2, 2020
The generated static.go file was missing a license header when it was
created in 2013 in CL 12805046. CL 38165 added a license header, using
the current year in the template. This causes the static.go file to go
"out of date" whenever the year changes.

Change the copyright year to be a fixed year when the file was created.
This way, the TestStaticIsUpToDate test will stop breaking every year.

Updates golang/go#36360
Updates golang/go#11811

Change-Id: If1597b0d93b7eacf23b7de103a6d7e3ca049bb4f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/213119
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/213121 mentions this issue: content/static: generate constant 2019 copyright year

@dmitshur dmitshur self-assigned this Jan 2, 2020
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jan 2, 2020
@golang golang locked and limited conversation to collaborators Jan 1, 2021
passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
The generated static.go file was created in 2019 in CL 156321, and
it inherited the generator code from x/tools that uses today's year.
There isn't a need to update the copyright year, so make it a constant.

This change fixes the failing TestStaticIsUpToDate test in 2020,
and prevents it from breaking in every future year.

Fixes golang/go#36360
Updates golang/go#11811

Change-Id: Ie87b1219448f1e288539f95280492b4f95b76798
Reviewed-on: https://go-review.googlesource.com/c/website/+/213121
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants