Skip to content

chore: バージョン更新を Dependabot に一本化 - #752

Merged
keito4 merged 2 commits into
mainfrom
fix/consolidate-version-updates
May 18, 2026
Merged

chore: バージョン更新を Dependabot に一本化#752
keito4 merged 2 commits into
mainfrom
fix/consolidate-version-updates

Conversation

@keito4

@keito4 keito4 commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

オープンPR を眺めると、Dependabotupdate-libraries.yml同じ package.json を奪い合っておりupdate-claude-plugins.yml空実装の死にコードhas_updates=false ハードコード)になっていました。バージョン更新の責務を Dependabot に一本化します。

詳細な背景・現状の不整合は ADR 0006 を参照。

What's changed

対象 担当
package.json / package-lock.json Dependabot(従来は update-libraries.yml と重複)
.github/workflows/*.yml(Actions ピン) Dependabot
.devcontainer/Dockerfile(FROM 行) Dependabot
.devcontainer/Dockerfile(ARG 行) update-dev-tools.yml(Dependabot が ARG を読まないため)
npm/global.json update-libraries.yml(custom manifest のため)

具体変更

  • script/update-libraries.sh: npm-check-updates / npm install 部分を削除し、npm/global.json の同期のみに縮小
  • .github/workflows/update-libraries.yml: サマリ生成を npm/global.json のみに簡素化、ヘッダコメントで責務境界を明文化
  • .github/workflows/update-claude-plugins.yml: 削除(空実装)
  • docs/adr/0006-consolidate-version-updates.md: 新規 ADR
  • docs/adr/0002-auto-version-updates.md: Status を Superseded by 0006
  • README.md / AGENTS.md / script/README.md / docs/adr/README.md の関連記述を更新

残課題(本 PR では扱わない)

  • update-dev-tools.yml の cron を毎日 → 毎週に変更すべきか
  • update-dev-tools.yml の 1Password CLI 取得元 (agilebits.com1Password/connect フォールバック) が別プロダクトを指している件

Test plan

  • npm run format:check
  • npm run lint
  • npm test(114 tests passed)
  • npm run shellcheck
  • CI 緑確認
  • マージ後の次回 Dependabot 実行で package.json 更新 PR が想定どおり立つこと
  • マージ後の次回 update-libraries.yml 実行で npm/global.json のみが対象になること

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor

    • Consolidated library update automation to focus on global CLI manifest management
    • Restructured version update coordination between automated and manual processes
  • Documentation

    • Updated development guides and architecture documentation to reflect the new dependency update workflow and responsibility boundaries

Review Change Stack

`update-libraries.yml` と Dependabot が `package.json` を奪い合っていた問題、
および死にコードの `update-claude-plugins.yml` を整理する。

- `script/update-libraries.sh` から `npm-check-updates` 部分を削除し、
  責務を `npm/global.json` の同期のみに縮小
- `update-libraries.yml` のサマリ生成を `npm/global.json` のみに簡素化
- `update-claude-plugins.yml`(`has_updates=false` ハードコードの死にコード)を削除
- ADR 0006 を追加して責務分担を明文化、ADR 0002 を Superseded に変更
- README.md / script/README.md / AGENTS.md の関連記述を更新

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@keito4 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 53 minutes and 45 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c9142e9-20d5-45f4-8b72-33f48ccfdd0f

📥 Commits

Reviewing files that changed from the base of the PR and between 8397dbe and f9d0700.

📒 Files selected for processing (1)
  • test/integration/update_libraries.bats
📝 Walkthrough

Walkthrough

This PR consolidates version-update automation by removing the Claude plugin workflow, narrowing library updates to refresh only npm/global.json, and rewriting the update script accordingly. A new ADR 0006 documents the consolidation strategy, marking ADR 0002 superseded, with comprehensive documentation updates reflecting the narrowed scope.

Changes

Version Update Automation Consolidation

Layer / File(s) Summary
Architecture decision and ADR consolidation
docs/adr/0006-consolidate-version-updates.md, docs/adr/0002-auto-version-updates.md, docs/adr/README.md
ADR 0006 documents unifying version updates under Dependabot, mapping each target file to its controlling mechanism, listing concrete workflow changes, and recording consequences. ADR 0002 is marked superseded by 0006. The ADR index is expanded to include new ADRs 0003–0006.
Update-libraries workflow narrowing
.github/workflows/update-libraries.yml
Workflow header comments clarify that npm/global.json (custom manifest) is Dependabot-owned but cannot be parsed there. Job steps run only npm run update:libs with PR summary logic scoped to npm/global.json changes. PR metadata references "automated global CLI manifest refresh" and removes prior broader "What's Updated" list.
Update-libraries script rewrite
script/update-libraries.sh
Script replaces prior npm-check-updates / npm install / test pipeline with dedicated global CLI manifest refresh. Queries npm registry per dependency, skips overridden entries, validates tool/file existence, logs version-change summary, and documents Dependabot responsibility for other updates.
Documentation reflecting new automation scope
README.md, AGENTS.md, script/README.md
README directory tree, "Update All Libraries" instructions, and "Library Auto-Update" workflow descriptions are updated to reflect npm/global.json-only refresh and Dependabot ownership of package.json. AGENTS.md workflow count and table entries adjusted. script/README.md quick reference and detailed docs clarified with ADR 0006 references.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • keito4/config#552: Both PRs directly touch update-claude-plugins.yml; introduced in #552, removed in this PR.
  • keito4/config#239: Both modify script/update-libraries.sh and .github/workflows/update-libraries.yml for npm/global.json update summarization.
  • keito4/config#614: Both modify AGENTS.md CI/CD workflows section, updating workflow count and narrowing update-libraries.yml scope.

Suggested labels

released


🐰 A workflow trimmed to golden parts,
Claude plugins now rest, their time departs,
Dependabot rules the versioning dance,
npm/global.json shines at a glance,
Cleaner automation hops in the light!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: consolidating version update responsibility into Dependabot.
Description check ✅ Passed The description is comprehensive and follows the template with all required sections (Summary, What's changed, test plan/checklist) properly filled and detailed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/consolidate-version-updates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@keito4

keito4 commented May 18, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

✨ Gemini Review

MCP issues detected. Run /mcp list for status.ADR 0006(バージョン更新の Dependabot 一本化)の決定に基づき、重複していた更新メカニズムを整理し、保守性を向上させる非常に優れた変更です。

修正が必要な問題(Actionable Issues)

重大な問題は見当たりません。変更は意図通りであり、プロジェクトの新しい方針に完全に合致しています。


レビューの詳細

  1. 責務の分離と一本化 (ADR 0006)
    • package.json や Actions の更新を Dependabot に集約し、独自スクリプトの責務を npm/global.json(Dependabot が扱えないカスタム形式)のみに絞り込んだ点は、運用管理の観点で非常に合理的です。
  2. update-libraries.sh の改善
    • npm-check-updatesnpm install を排除し、npm view によるバージョン取得に特化したことで、スクリプトが軽量化されています。
    • overridden: true によるパッケージのピン留め機能の追加は、特定のツールを特定バージョンで固定したい場合の例外処理として適切に実装されています。
  3. ワークフローのクリーンアップ
    • 未実装だった update-claude-plugins.yml の削除により、不要な CI 実行と潜在的な PR コンフリクトが解消されています。
  4. ドキュメントの整合性
    • README.mdAGENTS.mdscript/README.md の記述が、スクリプトの挙動変更に合わせて正確に更新されています。

判定

patch is correct

理由: ADR 0006 に基づき、重複した自動更新の仕組みを適切に整理・統合しており、コードの品質およびドキュメントの整合性が非常に高いレベルで維持されています。

信頼度: 1.0


🤖 Generated by post_pr_ai_review.py hook

@claude

claude Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

Claude finished @keito4's task in 2m 5s —— View job


PR レビュー

タスク

  • コンテキスト収集
  • 変更ファイルの確認
  • レビューフィードバック作成

総評

Verdict: APPROVE — 構造的に正しい変更です。ADR 0006 で意思決定を文書化したうえで実装しており、責務の境界が明確になっています。重大・主要な問題は見当たりません。以下は minor / recommendation レベルの指摘です。


指摘事項

script/update-libraries.shmktemp のクリーンアップなし (minor)

tmp_file=$(mktemp)
cp "$GLOBAL_FILE" "$tmp_file"

set -euo pipefail でスクリプトが途中終了した場合、$tmp_file${tmp_file}.next/tmp/ に残ります。trap による後始末を追加するとより堅牢です。

tmp_file=$(mktemp)
trap 'rm -f "$tmp_file" "${tmp_file}.next"' EXIT
cp "$GLOBAL_FILE" "$tmp_file"

Fix this →


script/update-libraries.shnpm view が逐次実行 (recommendation)

while IFS= read -r pkg; do
  latest_version=$(npm view "$pkg" version 2>/dev/null || echo "$current_version")
  ...
done < <(jq -r '.dependencies | keys[]' "$GLOBAL_FILE")

現在 npm/global.json には 19 パッケージがあり、npm view を 19 回直列呼び出しします。週次 CI での実行なので問題になる可能性は低いですが、将来パッケージ数が増えた際には並列取得(xargs -P 等)を検討する価値があります。現状は許容範囲です。


npm/global.jsonoverridden: false の明示 (recommendation)

"@commitlint/cli": {
  "version": "21.0.0",
  "overridden": false
}

スクリプト側で // false をデフォルト値として扱っているため、overridden: false は省略可能です。現在の明示スタイルは意図を明確にするメリットがあり、このままでも問題ありません。新規エントリ追加時のガイドを script/README.md に一行追記するとより親切です。


scheduled-maintenance.yml のスコープ変更が暗黙的 (recommendation)

scheduled-maintenance.ymlnpm run update:libs を引き続き呼び出しますが、その挙動は本 PR により「package.json も更新する」→「npm/global.json のみ」に変わります。このワークフロー自体は変更されていないため、将来の読者が混乱する可能性があります。コメント一行でも追加できれば理想的ですが、PR 本文に記載があるため必須ではありません(.github/workflows/ は書き込み権限外のため、この PR での修正は不要です)。


良い点

  • ADR 0006 の質が高い: 変更前の不整合を表形式で整理し、決定後の責務境界を明示。残課題も誠実に列挙されており、後から読んでも意図が伝わります。
  • docs/adr/README.md に ADR 0003〜0005 が追加: 既存の漏れが一緒に補完されています。
  • ワークフローの責務コメント: update-libraries.yml のヘッダーコメントが Dependabot との境界を明文化しており、将来の誤った追加を抑止します。
  • overridden フラグ: // false デフォルトで後方互換を保ちつつ、ピン留め機能を追加。設計が clean です。
  • 全ドキュメント一貫更新: README.md / AGENTS.md / script/README.md が変更内容を正確に反映しています。

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@script/update-libraries.sh`:
- Line 46: The script uses mktemp to create tmp_file outside the repo; change it
to create temp files under the repository-scoped .context directory instead:
ensure .context exists (mkdir -p .context) and replace the tmp_file creation
(variable tmp_file) to use mktemp with a .context-prefixed template (e.g.,
mktemp .context/tmp.XXXXXX) so all temporary artifacts live under .context; keep
any existing cleanup logic that references tmp_file working with the new path.
- Line 60: The script currently hides npm registry lookup failures by assigning
latest_version with a fallback to current_version using "npm view \"$pkg\"
version 2>/dev/null || echo \"$current_version\"" which can mask transient
errors; change the behavior in the latest_version assignment so that npm view
errors are not silently discarded—remove the silent fallback and either let npm
view's stderr surface (remove "2>/dev/null || echo \"$current_version\""), or
capture the error and fail loudly (exit non‑zero or log an explicit error via
echo/stderr) referencing the variables latest_version, pkg and current_version
so callers can see registry failures instead of returning a false "no update"
result.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 443cee09-7224-4d56-8420-08263442b717

📥 Commits

Reviewing files that changed from the base of the PR and between 2a73699 and 8397dbe.

📒 Files selected for processing (9)
  • .github/workflows/update-claude-plugins.yml
  • .github/workflows/update-libraries.yml
  • AGENTS.md
  • README.md
  • docs/adr/0002-auto-version-updates.md
  • docs/adr/0006-consolidate-version-updates.md
  • docs/adr/README.md
  • script/README.md
  • script/update-libraries.sh
💤 Files with no reviewable changes (1)
  • .github/workflows/update-claude-plugins.yml

log "Installing updated dependencies"
npm install
log "Refreshing global CLI manifest versions"
tmp_file=$(mktemp)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use repository-scoped temp files instead of OS temp directory.

At Line 46, mktemp writes outside the repository, which breaks the shared-artifact rule for this repo.

Suggested fix
 log "Refreshing global CLI manifest versions"
-tmp_file=$(mktemp)
+context_tmp_dir="$REPO_PATH/.context/tmp"
+mkdir -p "$context_tmp_dir"
+tmp_file=$(mktemp "$context_tmp_dir/update-libraries.XXXXXX")
 cp "$GLOBAL_FILE" "$tmp_file"

Based on learnings: "Place all temporary and context files under .context/ in the repository root. Do NOT use /tmp/ or other OS-level temp directories."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tmp_file=$(mktemp)
log "Refreshing global CLI manifest versions"
context_tmp_dir="$REPO_PATH/.context/tmp"
mkdir -p "$context_tmp_dir"
tmp_file=$(mktemp "$context_tmp_dir/update-libraries.XXXXXX")
cp "$GLOBAL_FILE" "$tmp_file"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@script/update-libraries.sh` at line 46, The script uses mktemp to create
tmp_file outside the repo; change it to create temp files under the
repository-scoped .context directory instead: ensure .context exists (mkdir -p
.context) and replace the tmp_file creation (variable tmp_file) to use mktemp
with a .context-prefixed template (e.g., mktemp .context/tmp.XXXXXX) so all
temporary artifacts live under .context; keep any existing cleanup logic that
references tmp_file working with the new path.

continue
fi

latest_version=$(npm view "$pkg" version 2>/dev/null || echo "$current_version")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Do not silently suppress npm registry lookup failures.

At Line 60, falling back to current_version masks transient/npm errors and can produce false “no updates” results.

Suggested fix
-  latest_version=$(npm view "$pkg" version 2>/dev/null || echo "$current_version")
+  if ! latest_version=$(npm view "$pkg" version 2>/dev/null); then
+    echo "Failed to fetch latest version for $pkg" >&2
+    exit 1
+  fi

Based on learnings: "Always prefer simplicity over pathological correctness... Avoid backward-compat shims or fallback paths unless they add no cyclomatic complexity."

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
latest_version=$(npm view "$pkg" version 2>/dev/null || echo "$current_version")
if ! latest_version=$(npm view "$pkg" version 2>/dev/null); then
echo "Failed to fetch latest version for $pkg" >&2
exit 1
fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@script/update-libraries.sh` at line 60, The script currently hides npm
registry lookup failures by assigning latest_version with a fallback to
current_version using "npm view \"$pkg\" version 2>/dev/null || echo
\"$current_version\"" which can mask transient errors; change the behavior in
the latest_version assignment so that npm view errors are not silently
discarded—remove the silent fallback and either let npm view's stderr surface
(remove "2>/dev/null || echo \"$current_version\""), or capture the error and
fail loudly (exit non‑zero or log an explicit error via echo/stderr) referencing
the variables latest_version, pkg and current_version so callers can see
registry failures instead of returning a false "no update" result.

@keito4 keito4 self-assigned this May 18, 2026
`script/update-libraries.sh` から削除した挙動(npx 依存、REJECT_PACKAGES、
lint/test 検証)に対するテストを、新しい責務(npm/global.json 専用、
overridden:true スキップ、npm-check-updates 不使用)に置き換える。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@keito4
keito4 merged commit eae9311 into main May 18, 2026
16 checks passed
@keito4
keito4 deleted the fix/consolidate-version-updates branch May 18, 2026 06:49
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.112.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant