Skip to content

ci: version.json の commit-back を廃止しビルド時に焼き込む (backport of #136, aicshud/WHEEL#1014) - #138

Merged
so5 merged 1 commit into
maintenance2023from
backport/version-json-no-commit-back-maintenance2023
Sep 11, 2026
Merged

so5 merged 1 commit into
maintenance2023from
backport/version-json-no-commit-back-maintenance2023

Conversation

@so5

@so5 so5 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

概要

main の PR #136aicshud/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-slimdev ステージ無し)という
古い構成のままだったため、cherry-pick の conflict をこのブランチの実態に合わせて
解消しています(単純な機械的 cherry-pick ではありません)。

  • versioner ステージは FROM base AS versionerbase に既に 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.jsonWORKDIR /usr/src/server 基準の app/db/version.json
    に焼き込まれること。

🤖 Generated with Claude Code

https://claude.ai/code/session_01C3jKNM1qubomM8UTRdkEWu

…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
so5 merged commit 644a90f into maintenance2023 Sep 11, 2026
@so5
so5 deleted the backport/version-json-no-commit-back-maintenance2023 branch September 11, 2026 13:01
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