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/website: make it safer to make changes to templated HTML pages #37090

Closed
dmitshur opened this issue Feb 6, 2020 · 5 comments
Closed

x/website: make it safer to make changes to templated HTML pages #37090

dmitshur opened this issue Feb 6, 2020 · 5 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@dmitshur
Copy link
Contributor

dmitshur commented Feb 6, 2020

Issue #37072 was about making it safer to make changes to draft release notes. But the golang.org website (and in turn, the tip copy at tip.golang.org) still has many pages that use templates.

Right now, if a change introduces an error on one of the templated pages, there isn't a test or trybot that catches that error. We should find a way to automate finding this kind of a problem, otherwise it can lead to broken pages on golang.org (when manually deployed, if the deployment regression tests don't catch it) and tip.golang.org (which is automatically deployed as soon as the CL is submitted).

See CL 217877 and CL 218217 for a recent occurrence that should ideally be caught in the future.

/cc @bcmills @golang/osp-team

@dmitshur dmitshur added Testing An issue that has been verified to require only test changes, not just a test failure. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Feb 6, 2020
@dmitshur dmitshur added this to the Unreleased milestone Feb 6, 2020
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/229079 mentions this issue: content: convert doc/{conduct,security}.html to non-template

gopherbot pushed a commit to golang/website that referenced this issue Apr 20, 2020
There are no template features being used in either of these two files,
so convert them to regular non-template HTML files. Having template be
off has proven to be a safer default, and it uses less CPU.

For golang/go#37070.
For golang/go#37072.
For golang/go#37090.

Change-Id: Ib0de115e58c51a9660d648dbb8793fcaae9a7197
Reviewed-on: https://go-review.googlesource.com/c/website/+/229079
Reviewed-by: Alexander Rakoczy <[email protected]>
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/229081 mentions this issue: cmd/golangorg: generate release history page from structured data

gopherbot pushed a commit to golang/website that referenced this issue Apr 21, 2020
Previously, the release history page was a raw HTML file that was
manually edited whenever new Go releases were made. This change
converts release history entries into a structured format in the
new internal/history package, and generates release history entries
from that format.

For now, only Go 1.9 and newer releases are converted, but the
structured format is flexible enough to represent all releases
going back to the original Go 1 release.

Various English grammar rules and special cases are preserved,
so that the release history entries appear in a consistent way.

New release history entries need only to be added to the internal/
history package, making it so that English grammar rules and HTML
tags don't need to go through human code review for each release.
Future work may involve constructing that list from data already
available in the Go issue tracker.

This change makes minimal contributions to reducing the dependence
of x/website on the x/tools/godoc rendering engine for displaying
pages other than Go package documentation. The x/tools/godoc code
is in another module and does not provide flexibility desired for
the general purpose website needs of x/website.

Fixes golang/go#38488.
For golang/go#37090.
For golang/go#29206.

Change-Id: I80864e4f218782e6e3b5fcd5a1d63f3699314c81
Reviewed-on: https://go-review.googlesource.com/c/website/+/229081
Run-TryBot: Dmitri Shuralyov <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Alexander Rakoczy <[email protected]>
@jba
Copy link
Contributor

jba commented Dec 8, 2020

I just wrote templatecheck, a package that validates templates after they are parsed. It might help with this issue.

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/393357 mentions this issue: internal/history: split Release summary into bug- and security fixes

@dmitshur
Copy link
Contributor Author

The original issue stated:

Right now, if a change introduces an error on one of the templated pages, there isn't a test or trybot that catches that error.

This is no longer the case today. As documented in golangorg's README, x/website now has tests that check various pages for expected status code and content. If a template error is introduced, those tests will fail and will be caught by TryBots, or during deployment (if TryBots were accidentally missed).

Closing as fixed. Thanks to Russ who authored the webtest package and its integration into deployment.

passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
There are no template features being used in either of these two files,
so convert them to regular non-template HTML files. Having template be
off has proven to be a safer default, and it uses less CPU.

For golang/go#37070.
For golang/go#37072.
For golang/go#37090.

Change-Id: Ib0de115e58c51a9660d648dbb8793fcaae9a7197
Reviewed-on: https://go-review.googlesource.com/c/website/+/229079
Reviewed-by: Alexander Rakoczy <[email protected]>
passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
Previously, the release history page was a raw HTML file that was
manually edited whenever new Go releases were made. This change
converts release history entries into a structured format in the
new internal/history package, and generates release history entries
from that format.

For now, only Go 1.9 and newer releases are converted, but the
structured format is flexible enough to represent all releases
going back to the original Go 1 release.

Various English grammar rules and special cases are preserved,
so that the release history entries appear in a consistent way.

New release history entries need only to be added to the internal/
history package, making it so that English grammar rules and HTML
tags don't need to go through human code review for each release.
Future work may involve constructing that list from data already
available in the Go issue tracker.

This change makes minimal contributions to reducing the dependence
of x/website on the x/tools/godoc rendering engine for displaying
pages other than Go package documentation. The x/tools/godoc code
is in another module and does not provide flexibility desired for
the general purpose website needs of x/website.

Fixes golang/go#38488.
For golang/go#37090.
For golang/go#29206.

Change-Id: I80864e4f218782e6e3b5fcd5a1d63f3699314c81
Reviewed-on: https://go-review.googlesource.com/c/website/+/229081
Run-TryBot: Dmitri Shuralyov <[email protected]>
TryBot-Result: Gobot Gobot <[email protected]>
Reviewed-by: Alexander Rakoczy <[email protected]>
@golang golang locked and limited conversation to collaborators Mar 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

3 participants