refactor(ansible): compare the version of the installed command - #152
Merged
Merged
Conversation
difft, act and ghq print their version, so ask the command itself instead of keeping a version stamp file. A stamp records what the playbook believed it installed, which can drift from what is actually on disk. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018aVdWSLTWB8VmHUBKgBVcN
lsd, btm and wezterm also print their version, so the version stamp mechanism is no longer used by anything and is removed. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018aVdWSLTWB8VmHUBKgBVcN
soblin
force-pushed
the
fix/compare-command-version
branch
from
August 21, 2026 17:55
28cd5af to
3aaa1c0
Compare
soblin
enabled auto-merge (squash)
August 21, 2026 17:58
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.
変更
install済みcommandのversionをversion stamp fileで管理するのをやめ、command自身の
--versionの出力とversions.yamlを直接比較するようにした。stampはplaybookが「installしたと思っているversion」でしかなく、実際に置かれているものとdriftしうる(#151 がまさにそれ)。--versionの出力Difftastic 0.70.0(複数行の1行目)0.70.0act version 0.2.89v0.2.89ghq version 1.10.1 (rev:f600896)v1.10.1lsd 1.2.0v1.2.0bottom 0.14.80.14.8wezterm 20240203-110809-5046fc22v付きでpinしているものだけregex_replace('^v', '')してから比較する。stdoutが空になり比較が一致しないのでinstallが走る。whichによるcheckは不要になったので削除した。verifytaskもwhichではなくversionの一致をcheckする。installしたのに版が合わない場合はその場でplaybookが失敗するので、fix(ansible): download the archive of the pinned version #151 のような「静かに古いまま」が起きない。version_stamp_dir変数とxdg_base_directoryのstamp dir作成taskを削除した。READMEも更新。確認
difftで3ケース:
lsd / btm / wezterm は一致時にskipされること、および不一致時にinstall blockへ入ることを確認(実際のinstallはdowngrade/存在しないtagなので想定通り失敗する)。
🤖 Generated with Claude Code
https://claude.ai/code/session_018aVdWSLTWB8VmHUBKgBVcN