ci: version.json の commit-back を廃止しビルド時に焼き込む (backport of #136, aicshud/WHEEL#1014) - #138
Merged
so5 merged 1 commit intoSep 11, 2026
Conversation
…ime (#136) Backport of PR #136 (main) to maintenance2023. This branch's Dockerfile predates the run_base/dev/versioner-friendly layout on main (it's builder -> base -> {UT, exec}, node:hydrogen-slim, no separate dev stage), so the backport is adapted rather than a literal copy: - versioner is `FROM base AS versioner` (base already has git installed) followed by `COPY . .` + `git describe`, same idea as main. - the version is baked only in the `exec` stage (there is no `dev` stage here); paths use this stage's WORKDIR (/usr/src/server, so app/db/version.json, not server/app/db/version.json). - kept "master" branch naming used in this line's run_test.yml / build_and_deploy.yml comments (unlike main, not yet renamed here). - did not add the entrypoint.sh ssh-agent block (PR #135, not backported to this branch) or the doc files that don't exist here yet (AGENTS.md, TEST_GUIDE.md, documentMD/design/{developer_guide,testing}.md). The `[skip ci] update version number` step in run_test.yml rewrote server/app/db/version.json and pushed it to every feature branch, so parallel PRs conflicted on that file and a stale `-beta` value rode onto main/maintenance at merge (issue #1014). - run_test.yml: drop the version-stamp / commit / push steps. - version.json: the committed value is a fixed placeholder ("not defined - this is a development build"). Nothing in CI edits the tracked file, so it never diverges between branches -> no more conflicts. - build_and_deploy.yml: pass the computed version through the WHEEL_VERSION build-arg instead of editing the worktree; repack source.tar.gz from a clean tree with the real version dropped in (git archive shipped the placeholder before). versionInfo.js is unchanged - it still statically imports version.json. (cherry picked from commit 931f0ae) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C3jKNM1qubomM8UTRdkEWu
so5
deleted the
backport/version-json-no-commit-back-maintenance2023
branch
September 11, 2026 13:01
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.
概要
mainの PR #136(aicshud/WHEEL#1014)をmaintenance2023へ cherry-pick したものです。内容は PR #136 と同じ —
run_test.ymlによるversion.jsonの commit-back を廃止し、ビルド時に焼き込む方式に変更します。背景は #136 を参照してください。
このブランチ向けに調整した点
このブランチの
Dockerfileは main / maintenance2026 のbase -> run_base -> {builder, dev, ut, exec}構成より前の、builder -> base -> {UT, exec}(node:hydrogen-slim、devステージ無し)という古い構成のままだったため、cherry-pick の conflict をこのブランチの実態に合わせて
解消しています(単純な機械的 cherry-pick ではありません)。
versionerステージはFROM base AS versioner(baseに既にgitが入っている)+
COPY . .+git describe。考え方は ci: version.json の commit-back を廃止しビルド時に焼き込む (aicshud/WHEEL#1014) #136 と同じです。execステージのみに追加しました(devステージがこのブランチには存在しないため)。パスもこのステージの
WORKDIR(
/usr/src/server)に合わせてapp/db/version.jsonとしています(
server/app/db/version.jsonではありません)。run_test.yml/build_and_deploy.ymlのコメント中のmainは、このブランチではまだ
master表記のままなのでそちらを維持しました。entrypoint.shの ssh-agent 修正(PR fix(entrypoint): start ssh-agent without writing into the bind-mounted home #135)はこのブランチにまだ backport されていないため、追加していません。
AGENTS.md/TEST_GUIDE.md/documentMD/design/developer_guide.md/documentMD/design/testing.mdはこのブランチにまだ存在しないため対応する修正は含めていません(
documentMD/design/design.mdは存在するので ci: version.json の commit-back を廃止しビルド時に焼き込む (aicshud/WHEEL#1014) #136 と同じ「バージョン番号の管理」セクションを追加しています)。
動作確認
このブランチの Dockerfile で実ビルドして確認しました。
docker build --target versioner:git describe(--dirtyなし)が動くこと(このブランチでは
2023-12-g<sha>のような値になります)。docker build --target exec(build-arg なし):<git describe>-localがserver/app/db/version.json(WORKDIR /usr/src/server基準のapp/db/version.json)に焼き込まれること。
🤖 Generated with Claude Code
https://claude.ai/code/session_01C3jKNM1qubomM8UTRdkEWu