ci: add a nightly compat matrix that verifies the declared Go floor - #550
Closed
Episkey-G wants to merge 1 commit into
Closed
ci: add a nightly compat matrix that verifies the declared Go floor#550Episkey-G wants to merge 1 commit into
Episkey-G wants to merge 1 commit into
Conversation
ci.yml 只在 1.25 上跑门禁,所以生成代码哪天用上高版本才有的写法, go.mod 里那行 `go 1.13` 会悄悄失效而没人发现。这个 workflow 专门回答那个问题。 只挂 schedule 与 workflow_dispatch,不挂 pull_request/push:兼容性是巡检结果, 红了要人来看,不该参与「这个 PR 能不能合」的判定——否则一个陈年的旧版本问题 会把日常发布卡死。codegen PR 上因此不会多出任何 check。 下界 1.13 是实测确认的,不是照抄 go.mod 声明:官方 golang 镜像跑整仓, 1.13.15 / 1.16.15 / 1.21.13 三档的 go build、go vet、make ci-syntax 全部 exit 0, 1.13 上 make test-cov 也是 exit 0。 特别验了 gofmt 的跨版本漂移——ci-syntax 里含 gofmtcheck,而 gofmt 在 1.19 改过 doc comment 排版,老版本有可能把现代格式判为不合格、让矩阵开局就红。 实测 gofmt -l(排除 vendor)在三个版本上命中数均为 0。
|
Collaborator
Author
|
按仓库维护者判断撤回:兼容矩阵是纯巡检,不参与门禁判定,也没人会去盯一个非阻断的定时任务。声明的下界还成不成立是另一个问题,需要时手工跑一次即可,不必为它常驻一条每天运行的 workflow。 留档一下这次量出来的数字,省得以后有人重新做一遍。在官方 golang 镜像里跑整仓:1.13.15 / 1.16.15 / 1.21.13 三个版本的 PR#548 的 PR 门禁不受影响,已在 master 上正常运行。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Adds
.github/workflows/compat.yml— a scheduled compatibility matrix over Go 1.13 / 1.16 / 1.21 / 1.25.Why
ci.ymlonly gates on 1.25. If generated code ever starts using a newer language or stdlib feature, thego 1.13line ingo.modwould silently stop being true and nobody would notice.This workflow runs on
schedule+workflow_dispatchonly — never onpull_requestorpush— so it adds no checks to codegen PRs. Compatibility is a patrol result: when it goes red a human should look, but it must not participate in deciding whether a PR can merge.The floor is measured, not copied from go.mod
Ran the whole repo in the official
golang:<v>images (linux/amd64):go build ./...go vet ./...make ci-syntaxmake test-covci-syntaxincludesgofmtcheck.sh, and gofmt changed doc-comment layout in 1.19 — an older gofmt could plausibly reject modern formatting and make the matrix red on day one. Checked explicitly:gofmt -l(excluding vendor) reports 0 files on all three versions.1.16 and 1.21 are kept as intermediate points because both changed build behaviour (
-mod=readonlybecoming the default; toolchain auto-switching), so a future breakage can be localised.