Skip to content

fix: 新規マシンセットアップで踏んだ残りの問題を改善 - #1005

Merged
keito4 merged 4 commits into
mainfrom
fix/new-machine-hardening
Jul 23, 2026
Merged

fix: 新規マシンセットアップで踏んだ残りの問題を改善#1005
keito4 merged 4 commits into
mainfrom
fix/new-machine-hardening

Conversation

@keito4

@keito4 keito4 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

PR #1004 の続き。新規マシンセットアップ (oykotnoMacBook-Air) で実際に踏んだ、環境差分による失敗 4 件を改善する。

Why

  • npm 11.17 生成の package-lock.json は npm 11.6 の npm ci で「Missing: argue-cli@3.1.0 from lock file」になり、ローカルの npm バージョン次第でセットアップが壊れる
  • script/lib/output.sh を macOS 標準 bash 3.2 で source すると typeset: -g: invalid option という原因の分かりにくいエラーで失敗する(jest 17 件の失敗として表面化)
  • import.sh が設定インポートの副作用として GitHub の全リポジトリを無条件に ghq クローンする
  • install-npm-globals.sh は Nix 管理 npm(prefix が読み取り専用の Nix store)では動作しない

What

  • package-lock.json を npm 11.6 で再生成(peer フラグ + optional 依存を含む上位互換形式。npm 11.6 / 11.17 両方で npm ci が通ることを確認)
  • output.sh に bash 4 未満の明示的なバージョンガードを追加(brew bash 導入を促すメッセージ)
  • import.sh の全リポジトリクローンを --with-repos オプトインに分離(script/README.md に追記)
  • install-npm-globals.sh に Nix store prefix 検出のガードを追加してスキップ(script/README.md に追記)

How to test

  • npm ci が npm 11.6.2 / 11.17.0 の両方で成功
  • npx jest --runInBand 779 件全パス
  • shellcheck 通過
  • bash 3.2 で output.sh を source すると明示的なエラーメッセージで exit 1
  • bash 5 / zsh では従来どおり動作
  • import.sh --check の従来動作を維持
  • Nix 管理 npm 環境で install-npm-globals.sh が警告を出して exit 0

Checklist

  • セルフレビュー済み
  • テストを追加・更新した(該当する場合)
  • ドキュメントを更新した(script/README.md)
  • 破壊的変更がない(import.sh の一括クローンはデフォルト無効に変更 — 意図的な挙動変更)

Related

🤖 Generated with Claude Code

keito4 and others added 4 commits July 23, 2026 15:48
npm 11.17 生成の lockfile は peer フラグと optional 依存
(argue-cli) を省略しており、npm 11.6 の npm ci が
「Missing: argue-cli@3.1.0 from lock file」で失敗していた。
npm 11.6 で再生成した上位互換の lockfile は 11.6 / 11.17 の
両方で npm ci が通ることを確認済み。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
macOS 標準の bash 3.2 で source すると typeset -g が
「typeset: -g: invalid option」という分かりにくいエラーで失敗する。
brew bash の導入を促す明示的なメッセージで早期に失敗させる。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
設定インポートの副作用として GitHub の全リポジトリを
無条件に ghq get するのは重すぎるため、明示的な
--with-repos フラグを指定した場合のみ実行する。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
macOS の nix 管理 npm は prefix が読み取り専用の Nix store を
指すため npm install -g が失敗する。この環境では CLI ツールを
nix/home/packages.nix で管理するため、警告を出してスキップする。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@keito4, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 5 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 96342084-f722-4139-9451-f50df70ee6dd

📥 Commits

Reviewing files that changed from the base of the PR and between 30cfda6 and 01c4415.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (4)
  • script/README.md
  • script/import.sh
  • script/install-npm-globals.sh
  • script/lib/output.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/new-machine-hardening

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.

@keito4 keito4 self-assigned this Jul 23, 2026
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error after 3m 6s —— View job


I'll analyze this and get back to you.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01c4415f2f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread script/import.sh
Comment on lines +123 to +124
if type gh >/dev/null 2>&1 && type ghq >/dev/null 2>&1; then
gh api user/repos --paginate | jq -r '.[].ssh_url' | xargs -L1 ghq get

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add jq to the --with-repos prerequisite check

When --with-repos is used on a fresh Linux bootstrap, brew/LinuxBrewfile installs gh and ghq but not jq (brew/LinuxBrewfile:32-33), so this guard can pass and the next pipeline aborts under set -o pipefail with jq: command not found. Please include jq in the prerequisite check/install path, otherwise the newly documented opt-in clone mode only works when jq was installed independently.

Useful? React with 👍 / 👎.

Comment on lines +27 to +30
if [[ "$npm_prefix" == /nix/store/* ]]; then
warning "npm prefix が読み取り専用の Nix store を指しています: ${npm_prefix}"
warning "この環境では npm グローバルは管理対象外のためスキップします (nix/home/packages.nix を参照)"
exit 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Provision replacements before skipping Nix npm installs

When the npm prefix is /nix/store, this exits successfully before installing any of the packages below. The warning says the CLI tools are managed in nix/home/packages.nix, but that file's package list does not include happy, @openai/codex, @google/gemini-cli, or vercel, so a fresh nix-darwin setup can report success while leaving the expected commands unavailable. Please either add the Nix-managed equivalents or fail with instructions for a writable npm prefix instead of silently skipping.

Useful? React with 👍 / 👎.

@keito4
keito4 merged commit 55143f2 into main Jul 23, 2026
22 of 23 checks passed
@keito4
keito4 deleted the fix/new-machine-hardening branch July 23, 2026 08:54
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.127.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label Jul 24, 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