Dependabot、.npmrc の自動推論を廃止
GitHub は、npm プライベートレジストリの認証問題を解消するため、Dependabot の .npmrc 自動推論機能を廃止し、依存関係管理設定を dependabot.yml の明示的なスコープ定義へ移行させる方針を発表した。
キーポイント
.npmrc 自動推論の終了と理由
ロックファイルの URL 解析に基づく .npmrc 推論は、フォーマットの違いや不正確な URL が原因で認証失敗を引き起こすことが多く、この機能は廃止される。
依存関係管理設定の一元化
レジストリ設定には dependabot.yml の 'scope' プロパティを使用し、これがコミットされた .npmrc ファイルよりも優先されるようになり、設定の権威源が明確になる。
既存設定との互換性
リポジトリに既に .npmrc が存在し、scope 設定を行っていない場合は、従来通りそのファイルが使用されるため、即時の破壊的変更はない。
影響分析・編集コメントを表示
影響分析
この変更は、オープンソース依存関係管理における認証プロセスの信頼性を劇的に高めるものであり、特に複数のパッケージマネージャーやプライベートレジストリを扱う大規模プロジェクトにおいて、自動化ツールの安定稼働に寄与します。開発者は設定ファイルを一元化することで、構成管理の複雑さを低減し、セキュリティリスクを軽減することが可能になります。
編集コメント
Dependabot の設定管理方針が明確化され、開発現場での認証トラブルが減少する画期的なアップデートです。ただし、既存プロジェクトの移行には .npmrc ファイルの確認と dependabot.yml の修正が必要となるため、計画的な対応が求められます。
Dependabot は、npm プライベートレジストリに対して .npmrc 設定を推測しようとしなくなります。以前は、Dependabot がロックファイルの解決済み URL から .npmrc の内容を再構築しようとしましたが、誤ったロックファイル URL や、npm、Yarn v1、Yarn Berry、pnpm 間でのロックファイル形式の違い、その他のエッジケースが頻繁にレジストリの認証失敗を引き起こしていました。
何が変わるか
これより、dependabot.yml のレジストリ定義に scope プロパティを設定できるようになります。Dependabot はこの設定を使用して、正しい .npmrc を自動的に生成します。scope が指定された場合、これはリポジトリ内のコミット済みの .npmrc ファイルを含む他のすべての .npmrc ソースよりも優先されます。これにより、レジストリ設定の権威あるソースとして dependabot.yml が機能します。
もしリポジトリに既にチェックインされた .npmrc があり、scope を設定していない場合は、Dependabot は引き続きそれを使用し続けます。scope プロパティは、コミット済みの .npmrc がない状態で Dependabot の推測機能に依存している場合にのみ必要です。
この機能を誰が利用できるか
この機能はすべての github.com ユーザーで利用可能であり、GHES 3.23 で提供開始されます。
始め方
Dependabot 設定ドキュメントを確認し、必要な npm レジストリに対して dependabot.yml に scope を追加するよう更新してください。
この投稿「Dependabot no longer infers .npmrc」は、The GitHub Blog で最初に公開されました。
原文を表示
Dependabot will no longer attempt to infer .npmrc configuration for npm private registries. Previously, Dependabot tried to reconstruct .npmrc contents from lockfile resolved URLs, but incorrect lockfile URLs, lockfile format differences across npm, Yarn v1, Yarn Berry, and pnpm, and other edge cases regularly caused registry authentication failures.
What’s changing
You can now define a scope property on registries in your dependabot.yml. Dependabot uses this to automatically generate the correct .npmrc. When scope is provided, it takes precedence over all other .npmrc sources, including any committed .npmrc file in your repository. This makes dependabot.yml the authoritative source for registry configuration.
If your repository already includes a checked-in .npmrc and you have not configured scope, Dependabot will continue to use it. The scope property is only needed when you don’t have a committed .npmrc and are relying on Dependabot’s inference.
Who can use this feature
This feature is available for all github.com users and will ship in GHES 3.23.
Get started
Review the Dependabot configuration docs and update your dependabot.yml to add scope to any npm registries that need it.
The post Dependabot no longer infers .npmrc appeared first on The GitHub Blog.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み