Skip to content

strictDepBuilds=true、他サプライチェーン攻撃への対策の追加 #61#62

Merged
ano333333 merged 5 commits into
masterfrom
features/61
May 24, 2026
Merged

strictDepBuilds=true、他サプライチェーン攻撃への対策の追加 #61#62
ano333333 merged 5 commits into
masterfrom
features/61

Conversation

@ano333333

@ano333333 ano333333 commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

リリースノート

  • Chores
    • パッケージマネージャをnpmからpnpmに統一し、pnpmバージョンを11.1.2に更新
    • Docker環境とCI/CDワークフローの構築手順を最適化
    • pnpmワークスペース設定を追加して、プロジェクト管理体制を強化

Review Change Stack

@ano333333 ano333333 self-assigned this May 24, 2026
@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

プロジェクト全体でパッケージマネージャーをnpmからpnpmに移行し、pnmバージョンを10.10.0から11.1.2に統一した。Docker環境ではcorepack経由でのpnpm有効化に変更し、GitHub Actionsワークフローはpnmコマンドに置き換え、プロジェクト設定ファイル(package.json、pnpm-workspace.yaml、flake.nix)を合わせて更新した。

Changes

pnpm移行とバージョン統一

Layer / File(s) Summary
Dockerfileでのpnpmのcorepackセットアップ
.github/workflows/images/Dockerfile.node, .github/workflows/images/Dockerfile.playwright, gcp/sheet-scraper/Dockerfile
Dockerfile.nodeとsheet-scraperでcorepack経由によるpnpm@11.1.2有効化に統一。Playwright Dockerfileではchrome-extension依存ファイルをコピーしてpnpm install --frozen-lockfileを実行し、Playwright ブラウザをchromiumに明示してpnpm exec playwright install chromium --with-depsで導入。
GitHub Actionsワークフローのpnpm移行
.github/workflows/build-chromeex/action.yaml, .github/workflows/test-chromeex/action.yaml
BuildChromeExtensionおよびTestChromeExtensionアクションで、依存関係インストール(pnpm install --frozen-lockfile)および実行コマンド(pnpm run buildpnpm run test:ci)をnpmからpnmに置き換え。
プロジェクト設定ファイルのpnpm宣言
chrome-extension/package.json, gcp/sheet-scraper/package.json, chrome-extension/pnpm-workspace.yaml
chrome-extensionとsheet-scraperのpackage.jsonにpackageManager: pnpm@11.1.2を追加。chrome-extension配下にpnpm-workspace.yamlを新規追加し、esbuildビルド許可と信頼ポリシーダウングレード無効を定義。
開発環境とスクリプト更新
flake.nix, gcp/sheet-scraper/package.json
flake.nixでpnpm依存をnodePackages.pnpmからpnpmに簡潔化。sheet-scraperのbuild scriptをnpx tscからtsc呼び出しに変更。
ドキュメント整備
.github/workflows/README.md
Dockerイメージ仕様の表記をバージョン固定からpnpm(corepack経由)に統一し、事前インストール手順をnpxからpnpm execに更新。ローカルビルド手順をフルパス指定に整理。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related issues

  • ano333333/ongeki-score-fetch#61: pnmワークスペース設定(trustPolicy、esbuildビルド許可)とバージョン更新(v11)が同時に対応されている。

Possibly related PRs

Poem

🐰 ウサギの手でpnpmと並べて
十点一から十一へと登り
corepackの道つけて
npm卒業、新しい世界へ
依存関係もワークスペースも整頓完了! 📦✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive プルリクエストのタイトルはサプライチェーン攻撃への対策追加を示していますが、実際の変更内容はpnpmバージョン更新(10.10.0→11.1.2)、パッケージマネージャーの統一、Dockerfile設定の見直しが主となっており、タイトルと実装内容の対応が曖昧です。 タイトルを「pnpmを11.1.2へ更新し、パッケージマネージャーの統一化」など、主な変更内容をより明確に反映させることを検討してください。
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 features/61

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@flake.nix`:
- Line 27: flake.nix currently pulls the top-level pkgs.pnpm (which maps to
pnpm_9) causing a version mismatch with packageManager/Dockerfile and
package.json files that require pnpm@11.1.2; update flake.nix to explicitly use
pnpm_11 from pkgs (pkgs.pnpm_11) or add an overlay that pins pnpm to 11.1.2
(matching the project’s package.json/Dockerfile), ensuring the symbol you change
is the pnpm entry in the top-level package list (the pnpm / pnpm_11 reference)
so the dev environment and chrome-extension/gcp/sheet-scraper
packageManager/Dockerfile versions are consistent.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 49fa2956-b17d-4753-9cfc-18fdb8a7e066

📥 Commits

Reviewing files that changed from the base of the PR and between 904b5d2 and c3058a9.

⛔ Files ignored due to path filters (1)
  • flake.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • .github/workflows/README.md
  • .github/workflows/build-chromeex/action.yaml
  • .github/workflows/images/Dockerfile.node
  • .github/workflows/images/Dockerfile.playwright
  • .github/workflows/test-chromeex/action.yaml
  • chrome-extension/package.json
  • chrome-extension/pnpm-workspace.yaml
  • flake.nix
  • gcp/sheet-scraper/Dockerfile
  • gcp/sheet-scraper/package.json

Comment thread flake.nix
packages = with pkgs; [
nodejs_24
nodePackages.pnpm
pnpm

@coderabbitai coderabbitai Bot May 24, 2026

Copy link
Copy Markdown
Contributor

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Nixのpnpmパッケージ情報を確認

# pnpmパッケージの存在確認
if command -v nix &> /dev/null; then
  echo "=== Checking pnpm package in nixpkgs-unstable ==="
  nix eval nixpkgs#pnpm.version --raw 2>/dev/null || echo "pkgs.pnpm not found"
  echo ""
  echo "=== Checking nodePackages.pnpm package ==="
  nix eval nixpkgs#nodePackages.pnpm.version --raw 2>/dev/null || echo "nodePackages.pnpm not found"
else
  echo "Nix is not available in this environment"
fi

Repository: ano333333/ongeki-score-fetch

Length of output: 113


🌐 Web query:

nixpkgs unstable pnpm package availability

💡 Result:

In nixpkgs unstable (2026-05-24), pnpm is available in multiple versioned packages, notably pnpm_8, pnpm_9, and pnpm_10 (with additional variant labels like pnpm_10_29_2) via pkgs.development.tools.pnpm.default.nix [1][2]. The top-level pnpm attribute is also set to pnpm_9 in the nixpkgs tree (i.e., pnpm aliases pnpm_9) [3]. Concrete availability in nixpkgs (unstable) based on the current pnpm packaging definitions: - pnpm_8 exists, pinned to a specific pnpm 8.x version in the nixpkgs pnpm default.nix variant table [1]. - pnpm_9 exists, pinned to a specific pnpm 9.x version in the nixpkgs pnpm default.nix variant table [1]. - pnpm_10 exists, pinned to a specific pnpm 10.x version in the nixpkgs pnpm default.nix variant table [1]. - Additional pnpm_10_* variants can exist to handle known breaking changes (example comment/variant for 10.29.2) [1]. Related build tooling availability (how pnpm is intended to be used in nixpkgs builds): - nixpkgs provides fetchPnpmDeps and pnpmConfigHook infrastructure for building pnpm-based JS projects reproducibly [4][5]. Notes on package name changes / aliases: - Older nixpkgs guidance used nodePackages.pnpm; however, nixpkgs has been deprecating/removing “nodePackages.*” usage in favor of other patterns (e.g., overlays/overrides), and there are documented issues about pnpm being wrapped with an unintended nodejs version when using the aliasing approach [6][7]. How to check quickly in your local nixpkgs-unstable checkout: - Look under pkgs.development.tools.pnpm (it defines pnpm_8, pnpm_9, pnpm_10, etc.) [1]. - In that same tree, check that pnpm = pnpm_9 is exported at the top-level all-packages layer [3].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# flake.nixの該当行(27)周辺を確認
if [ -f flake.nix ]; then
  nl -ba flake.nix | sed -n '15,45p'
else
  echo "flake.nix not found"
fi

Repository: ano333333/ongeki-score-fetch

Length of output: 115


🌐 Web query:

nixpkgs unstable pnpm_11 package

💡 Result:

As of May 24, 2026, the pnpm_11 package is actively being integrated into nixpkgs [1][2]. While development and testing are ongoing—including recent work to ensure deterministic builds for the pnpm v11 store index [3] and fixes for binary execution [4]—it is not yet part of the standard stable release or fully merged into the main nixpkgs-unstable branch as a finalized, widely available attribute [5]. Users tracking the progress of pnpm_11 can follow the primary development efforts in the nixpkgs repository, specifically through pull requests and commits related to its initialization and store reproducibility [1][3][2]. Because pnpm v11 introduced significant changes, such as using a SQLite database for the store index, the integration requires careful handling of build reproducibility and pnpmConfigHook compatibility [1][3]. If you need to use pnpm 11 before it is officially available in your channel, you may need to track the relevant pull requests or use a local overlay to pull in the work-in-progress definitions [1][6]. Once merged, it is expected to follow the established naming convention in nixpkgs, where pinned versions are exposed as pnpm_X (e.g., pnpm_10, pnpm_11) [7][8].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

if [ -f flake.nix ]; then
  echo "== flake.nix: lines 20-35 =="
  awk 'NR>=20 && NR<=35 {printf "%d:%s\n", NR, $0}' flake.nix
  echo
  echo "== flake.nix: all pnpm occurrences =="
  rg -n "pnpm" flake.nix
else
  echo "flake.nix not found"
fi

Repository: ano333333/ongeki-score-fetch

Length of output: 777


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n "pnpm@|packageManager|pnpm_11|11\.1\.2" . || true

Repository: ano333333/ongeki-score-fetch

Length of output: 312


flake.nix の pnpm バージョンが pnpm@11.1.2(packageManager/Dockerfile指定)と一致するよう調整してください(pnpm のままだと不一致の可能性)

  • flake.nixwith pkgs; [ ... pnpm ... ](pkgsのトップレベル pnpm 属性)を使っています。
  • 一方で chrome-extension/package.json / gcp/sheet-scraper/package.json / gcp/sheet-scraper/Dockerfile はすべて pnpm@11.1.2 を指定しています。
  • nixpkgs-unstable ではトップレベル pnpm は現状 pnpm_9 エイリアスで、pnpm_11 は統合途上になっているため、現在の flake.nix のままだとバージョン不一致リスクがあります。
  • pnpm_11 を明示的に使う/オーバーレイで pnpm@11.1.2 にピン止めするなど、開発環境の pnpm をプロジェクト指定に合わせてください。
🤖 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 `@flake.nix` at line 27, flake.nix currently pulls the top-level pkgs.pnpm
(which maps to pnpm_9) causing a version mismatch with packageManager/Dockerfile
and package.json files that require pnpm@11.1.2; update flake.nix to explicitly
use pnpm_11 from pkgs (pkgs.pnpm_11) or add an overlay that pins pnpm to 11.1.2
(matching the project’s package.json/Dockerfile), ensuring the symbol you change
is the pnpm entry in the top-level package list (the pnpm / pnpm_11 reference)
so the dev environment and chrome-extension/gcp/sheet-scraper
packageManager/Dockerfile versions are consistent.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

nix flake updateのタイミングのみで上がるので、そのタイミングでバージョンを更新するだけなので、現段階で調節しておけばとりあえずOKと判断。

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@ano333333、ご説明ありがとうございます。nix flake update のタイミングで flake.lock が更新されるため、その際に pnpm バージョンを合わせる運用であれば問題ない判断ですね。了解しました。

@ano333333 ano333333 merged commit db6d651 into master May 24, 2026
8 checks passed
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