Conversation
The Bazel side had not moved since 2020: Bazel 3.7.0, rules_go 0.24.7, gazelle 0.22.2. Updating them runs straight into WORKSPACE itself — Bazel 9 removed it, and rules_go 0.63.0 is tested against Bazel 8 and 9 — so there is no version-only bump available except a small one that just schedules this same migration for later. Replace WORKSPACE with MODULE.bazel: Bazel 9.2.0, rules_go 0.63.0, gazelle 0.54.0. Every bazel_dep carries repo_name, so @io_bazel_rules_go and @bazel_gazelle keep resolving and not one BUILD file changes. That is deliberate: it confines everything that can break to the dependency declarations, which matters because Bazel cannot be run here at all (releases.bazel.build is blocked by egress policy) and CI is the only thing that can confirm this. The EDItEUR archives are declared with use_repo_rule, same URLs and same sha256, so the download problem in ADR-0003 is neither helped nor made worse. Also drop the Makefile's WORKSPACE target: it ran `gazelle update-repos`, which bzlmod replaces with the go_deps extension — and go.sum is empty, so there are no external Go dependencies to declare either way. go.mod's directive moves from 1.14 to 1.21. Recorded as ADR-0006. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
First CI run on this branch:
ERROR: e2e/go/BUILD.bazel:35:1: name 'sh_test' is not defined
(did you mean 'cc_test'?)
Bazel 9 finished moving the native shell rules out of the global
namespace and into rules_shell. Add the bazel_dep and load sh_test from
@rules_shell//shell:sh_test.bzl.
This falsifies the claim ADR-0006 and the pull request both made, that no
BUILD file changes — one load line does. Corrected there, along with a
note that further Bazel bumps can be expected to need the same treatment
as more native rules are Starlarkified.
The Makefile conflict from merging #61 is resolved by taking both
deletions: that branch removed the dead `json` target and this one
removed the `WORKSPACE` target, and neither should come back.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
判定マージ可。ブロッカーは無い。 指摘推奨 1 —
|
Review points, now that CI has confirmed the migration works. The Go SDK was 1.24.7, roughly a year old, in a change whose whole point is catching up; 1.27.1 is current. go.mod's directive stays at 1.21 on purpose and the ADR now says why: it is the floor required of anyone using the generated Go client, while the SDK is what this repository builds with. Raising the floor to match the toolchain would narrow who can consume the output for no benefit. MODULE.bazel.lock should be committed rather than ignored — go_sdk.download carries no sha256, so without the lock every build re-fetches the Go version index and re-resolves BCR over the network. It cannot be generated here (bazel does not run in this environment), so the .gitignore entry is removed and the ADR asks whoever next runs bazel locally to commit it. `common --lockfile_mode=error` is deliberately not added yet: with no lock file present it would fail the build. Also drop the reference to docs/adr/0003 from MODULE.bazel — that file lives on another branch and does not exist here — and state the reason for the failing downloads inline instead. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z
|
レビューありがとうございます。推奨 3 件と任意 1 件を反映しました (10fae47)。
推奨 1:
|
Bazel 側の依存は 2020 年から止まっていました。base は #61(
rules_nodejsを外した PR)。なぜ bzlmod への移行になるのか
バージョンだけ上げる選択肢が実質ありません。Bazel 9 は WORKSPACE を廃止しており、rules_go 0.63.0 も Bazel 8/9 でテストされています。WORKSPACE を保つには上げ幅をかなり小さく取るしかなく、それは同じ移行を後日やり直すことを意味します。
BUILD ファイルの変更は 1 行だけ
bazel_depにrepo_nameを指定して、既存のラベルをそのまま通します。当初「BUILD ファイルは 1 行も変えていない」と書きましたが、CI がそれを否定しました。
Bazel 9 はネイティブの shell ルールを
rules_shellに移しています。bazel_depを足し、load("@rules_shell//shell:sh_test.bzl", "sh_test")を追加しました。ADR-0006 も訂正済みです。Bazel を上げる際に「無くなったネイティブルールを提供する rules_* を足す」作業が今後も発生しうる、という点も記録しました。スキーマ取得への影響はありません
EDItEUR の zip は
use_repo_ruleで従来どおりhttp_archiveとして宣言。URL もsha256も不変なので、ADR-0003 の取得問題は良くも悪くもなりません。その他
WORKSPACE: go.modターゲットを削除(gazelle update-reposは bzlmod に無く、go.sumが空で外部 Go 依存も無い)go.modのgoディレクティブを 1.14 → 1.21MODULE.bazel.lockは.gitignoreに追加jsonターゲット、本 PR がWORKSPACEターゲットを削除。どちらも戻すべきでない)判断は ADR-0006 に記録しています。
確認
load()を確認し、repo_nameで維持される範囲を特定sh_testの load パスは rules_shell v0.8.0 のshell/BUILDを読んで確定make -n testがマージ後もstack test --trace --fastのみを出すことを確認sh_testの件はそれで判明しました🤖 Generated with Claude Code
https://claude.ai/code/session_01P8rZakwAiz1jpViUX34x1Z