Skip to content

CI on Go 1.27, and a content switch so the inherited tests can run - #379

Closed
tamnd wants to merge 232 commits into
golang:masterfrom
tamnd:ci/go-1.27
Closed

tamnd wants to merge 232 commits into
golang:masterfrom
tamnd:ci/go-1.27

Conversation

@tamnd

@tamnd tamnd commented Sep 2, 2026

Copy link
Copy Markdown

This repository has no CI. It is a fork of golang/website carrying 680 files of
Vietnamese translation in an overlay filesystem, and until now nothing checked
either half of that on a pull request.

The switch

go test ./... cannot pass here as inherited. Content and TourOnly return
the overlay, so they return Vietnamese, and two upstream test call sites read
them directly rather than going through the server's -content flag:

  • internal/tour/tour.go:32 holds website.TourOnly() in a package level variable and asserts >A Tour of Go<
  • cmd/golangorg/server_test.go:347 reads website.Content() to check every release notes page carries its release date

Those tests are not wrong to assert English. What they test is the renderer,
and the fork has to not break the renderer. So GODEV_CONTENT=en turns the
overlay off and gives them back the content they were written against. The
default stays Vietnamese, because a deployment that forgets an environment
variable should serve the site this fork exists to serve.

overlay_test.go covers the overlay itself, which has no test anywhere
upstream, and covers the switch. It asserts that GODEV_CONTENT changes what
comes back rather than pinning a Vietnamese sentence, because a test that pins
prose fails the next time somebody improves the prose.

The workflow

Two jobs.

test runs vet, build, and the upstream suite under GODEV_CONTENT=en, then
the overlay tests with the overlay on. cmd/screentest is excluded: it dials
Google Cloud Storage for screenshot baselines and cannot pass without
credentials, upstream included.

audit checks out tamnd/godev-vn-translator and runs the fourteen quality
gates against this tree. Dropped links, invented heading anchors, edited code
blocks, translated template actions, front matter that moved, and whether each
translation still matches the English it was made from. The report is uploaded
as an artifact whether the gate passes or fails, since a failure is exactly
when it is worth reading.

Why -max 227 and not zero

The corpus has 227 refusals today. A required check demanding zero is red on
the first pull request and every one after it, including the ones fixing the
refusals, and a check that is always red is a check somebody turns off.

So the gate is pinned at what the corpus has and fails at 228. It only ever
goes down. A pull request that fixes ten refusals lowers the pin by ten in the
same diff, which is a reviewable claim about what the change did, and when it
reaches zero the flag comes off.

go.mod

Left at upstream's go 1.26.0. That line is a minimum language version and
says nothing about what CI runs. Raising it in the fork would buy nothing and
would put a seventh file into the divergence, to be conflicted on at every
upstream sync. The Go version that matters is the one in the workflow, and it
is 1.27.

Checked locally

  • GODEV_CONTENT=en go test over every package but cmd/screentest passes on Go 1.27
  • internal/tour fails with the overlay on and passes with it off, which is the whole point of the switch
  • godev audit -max 227 exits 0 at exactly 227 and would exit 1 at 228

tamnd added 28 commits March 31, 2026 17:12
Complete Go modules reference covering module paths, versions, go.mod
directives, go commands, proxies, version control, and authentication.
…slations

Fix 18 files where Vietnamese prose used inconsistent terminology:

blog/:
- 16years.md: "garbage collector" → "bộ gom rác" (2x)
- contributor-workshop.md: "contributor" → "người đóng góp" (5x), "repository" → "kho lưu trữ"
- contributors-summit-2019.md: "contributor" → "người đóng góp" (4x), "open-source" → "mã nguồn mở"
- contributors-summit.md: "contributor" → "người đóng góp" (multiple), "tooling" → "hệ thống công cụ"
- cover.md: "tooling" → "hệ thống công cụ" (2x)
- generic-slice-functions.md: "garbage collector" → "bộ gom rác" (3x)
- gofix.md: "false positive" → "dương tính giả"
- open-source.md: "garbage collector" → "bộ gom rác", "contributor" → "người đóng góp" (14x)
- pgo-preview.md: "repository" → "kho lưu trữ" (2x), PGO term fix (4x)
- pgo.md: "garbage collector" → "bộ gom rác", "repository" → "kho lưu trữ" (2x), PGO term fix (5x)
- qihoo.md: "garbage collection" → "bộ gom rác"
- survey2023-q1-results.md: "repository" → "kho lưu trữ"
- wire.md: "tooling" → "hệ thống công cụ"

doc/:
- go1.12.md: "garbage collector" → "bộ gom rác"
- go1.22.md: "Profile-Guided Optimization" → "tối ưu hóa dựa trên hồ sơ thực thi"
- go1.23.md: "Profile Guided Optimization" → "tối ưu hóa dựa trên hồ sơ thực thi"
- go1.26.md: "garbage collector/Garbage collector" → "bộ gom rác" (6x)

solutions/:
- mercadolibre.md: "repository" → "kho lưu trữ" (3x)
- contributor: keep unchanged (do not translate to "người đóng góp")
- repository: keep unchanged (do not translate to "kho lưu trữ")

Reverted in 8 files:
  blog/contributor-workshop.md, contributors-summit-2019.md,
  contributors-summit.md, open-source.md, pgo.md, pgo-preview.md,
  survey2023-q1-results.md, solutions/mercadolibre.md

Updated GLOSSARY.md to mark both terms as "keep unchanged".
Sync translations with golang/website upstream commits:
- e2752c0 (_content: add more documentation for 'go tool' features in ref/mod)
- c961c3d (_content: in managing dependencies doc '-u' flag and mention '-modfile')

Changes in _content_vi/ref/mod.md:
- tool directive: add "Kể từ Go 1.24," prefix
- go get usage: add -tool flag
- go get flags: add -tool flag description
- go get -d: fix tense (sẽ luôn → luôn)
- go install constraints: conditionalize on version-suffix args
- go install file paths bullet: note go install tool works without version suffix
- go install last para: add go install tool for module tools
- Add new `go tool` section with usage, examples, and description

Changes in _content_vi/doc/modules/managing-dependencies.md:
- Remove unnecessary -u from `go get -u tool` → `go get tool`
- Add equivalence note: go get tool@upgrade
Quote summary field to fix parse error: unquoted colon-space inside
a YAML scalar value causes the parser to interpret it as a mapping.
Full translation of /ref/spec (8928 lines) into _content_vi/ref/spec.html.
All prose translated to Vietnamese; code blocks, identifiers, and HTML
attributes preserved unchanged.
Translate Go language specification to Vietnamese
- content.go: embed _content_vi alongside _content; Content() now returns
  an overlayFS (vi → en) so Vietnamese translations take priority while
  missing assets (css/js/fonts/images) fall back to English originals.
- server.go: auto-detect _content_vi before _content for live-reload in
  local dev; NewHandler constructs the same overlay when contentDir ends
  with _content_vi.
Embed _content_vi/tour alongside _content/tour. TourOnly() now returns
an overlayFS (vi → en) so the tour serves Vietnamese content (title:
"Hành trình khám phá Go") while missing files fall back to English.
Awesome-list style index linking to every page on go.dev, organized
for learners and practitioners. Includes tutorials, blog posts by
category, language spec, Tour of Go lessons, and 67 talks (2010-2019).
The tour article content was already translated, but the surrounding
UI was still in English. This translates the remaining pieces:

- values.js: module titles and descriptions in the table of contents
  (Basics, Methods and interfaces, Generics, Concurrency), plus all
  i18n strings (button tooltips, status messages, navigation labels)
- editor.html: translate the "Imports" button label to "Nhập khẩu"
- app.css: translate CSS-generated "on"/"off" toggle labels to
  "bật"/"tắt" for the syntax and imports checkboxes

The github-repo field in the feedback template now points to
tamnd/golang-website-vi instead of golang/go.
Translate remaining Go Tour UI to Vietnamese
Merge golang/website master (up to 8b62ccf) and update Vietnamese
translations to match:

- blog/inliner.md: add Lasse Folger to the credits list
- doc/effective_go.html: update intro paragraph (no longer "new
  language"), replace the old January 2022 note with a concise warning
  box at the top, change "item" to "variable" in new(T) description,
  and add the Go 1.26 new(expr) paragraph
Sync upstream and translate updated content
Sync upstream golang/website through 786360a
The Go 1.27 release post, one of the nine files the upstream sync added
that had no Vietnamese at all.

It is the first page translated through tamnd/godev-vn-translator end to
end, so it also brings translations.json, the manifest that records what
each translation was made from. Without it there is no way to tell a
translation whose English has moved from one that is current, and after a
sync the only safe reading is that all of them are stale.

The first answer came back with 24 escaped backticks in it, so a code
span inside a link read as two literal backslashes and a backtick on the
page. Every other gate passed that file. The audit caught it, the piece
it was in was sent back with the finding attached, and this is the
repair.
_content_vi/blog: translate go1.27, and add translations.json
The file still said to open pull requests against tamnd/golang-website-vi,
which has not been this repository's name since the rename, and that was
the whole of it.

What it should say is the thing that is easy to get wrong here: the
overlay filesystem means a missing or wrong translation renders as
English and returns 200, so browsing the site tells you nothing about
coverage. The audit does. Everything else in here is the shape a
translation has to keep, which is what the fourteen gates check.
AGENT.md: rewrite for the renamed repo and the audit
…rom (#12)

The manifest answers one question, has the English moved since this
translation was made, and until now it could not be asked of any file
except the one page translated through the tool. Every other translation
came back as having no record, which is 654 notices that say nothing
except that the corpus is older than the manifest.

The answer was in git. For each Vietnamese file, the commit that last
touched it is when that translation was current, and the English at that
commit is what it was made from. Written by godev backfill, which is
tamnd/godev-vn-translator#12.

The result is worth reading carefully. L13 goes from 654 findings to
129: 97 of those are the files whose Vietnamese is byte for byte the
English, which are copies rather than translations and are deliberately
left without a record, and 32 are real. Those 32 are stale, they refuse,
and they are exactly the 32 files the upstream sync modified. Nothing
else in the corpus is named.

So the refusal count goes up, from 195 to 227. That is the point. The
sync invalidated 32 translations in March and there was no way to say
which ones. Now there is, by name.

Route, model and prompt hash are empty on these records. A translation
made by hand was not asked for under any instructions the tool knows,
and an empty field says so without inventing a value.
This fork serves _content_vi over _content, so Content and TourOnly return
Vietnamese and the test suite it inherited from upstream cannot pass. Two call
sites are the reason, and neither of them goes through the server's -content
flag:

	internal/tour/tour.go holds website.TourOnly() in a package level
	variable and asserts >A Tour of Go<

	cmd/golangorg/server_test.go reads website.Content() to check that
	every release notes page carries its release date

Those tests are not wrong. What they test is the renderer, and the fork has to
not break the renderer. Whether the translation is any good is a different
question, and the answer to it is the fourteen quality gates in
tamnd/godev-vn-translator, not a grep for an English string.

So there is a switch. GODEV_CONTENT=en returns the embedded English and
restores the whole upstream suite. The default is Vietnamese, because a
deployment that forgets to set an environment variable should serve the site
this fork exists to serve.

overlay_test.go covers the overlay itself, which is the one piece of behaviour
in this repository that has no test anywhere upstream, and covers the switch.
It asserts that GODEV_CONTENT changes what comes back rather than pinning a
Vietnamese sentence, because a test that pins prose fails the next time
somebody improves the prose.
This repository had no workflows at all, which for a fork that is 680 hand
checked files of translated content is the wrong number of them.

Two jobs. The first is the ordinary one: vet, build, and upstream's tests under
GODEV_CONTENT=en, plus the overlay's own tests with the overlay on.
cmd/screentest is skipped because it dials Google Cloud Storage for screenshot
baselines and cannot pass without credentials, which is true upstream too.

The second runs the fourteen gates from tamnd/godev-vn-translator against this
checkout: dropped links, invented heading anchors, edited code blocks,
translated template actions, front matter that moved, and whether each
translation still matches the English it was made from.

It runs with -max 227, which is a ratchet and not a target. The corpus has 227
refusals today. A required check demanding zero would be red on the first pull
request and every one after it, including the ones fixing the refusals, and a
check that is always red is a check somebody turns off. This one fails at 228.
The number comes down in the same diff as the work that lowers it, which makes
it a reviewable claim about what the change did, and the day it reaches zero
the flag comes off and the gate is the plain one.

go.mod stays at upstream's go 1.26.0. That line is a minimum language version
and says nothing about what CI runs, so raising it in the fork would buy
nothing and would put a seventh file into the divergence, to be conflicted on
at every upstream sync. The Go version that matters is the one in this
workflow, and it is 1.27.

Actions are at checkout@v7, setup-go@v7 and upload-artifact@v7.
@tamnd

tamnd commented Sep 2, 2026

Copy link
Copy Markdown
Author

Opened by mistake against the wrong remote, this belongs on a fork. Sorry for the noise.

@tamnd tamnd closed this Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant