Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

pnpm cache race condition when using different node versions between workflows

オープン
#641 コメント 15 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
github-actions, node.js, typescript
領域
ci-cd, tooling

調査の方向性

このレポートでは、actions/setup-node@v3 と pnpm/action-setup@v2 を使用したワークフローの例を示しています。まず、setup-node で使用される pnpm キャッシュキーの生成を追跡します。Node 14 と Node 16 で生成されるキーを比較し、その後、別々のキーによって報告されたキャッシュの再利用と競合状態が防止されることを確認します。

索引モデルが issue の本文から書いたものです。

説明

feature request needs eyes

Description:

Same cache us being reused, regardless of node versions. This brings prolonged time for once of the operations, and cache race conditions.

As can be seen from the images attached below, same cache key is used for both, but once is using node14, while the other is using node16.

Action version:
actions/checkout@v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

Repro steps:

This is my Tests yaml

name: Tests

on:
  push:
    branches:
      - master
  pull_request:

jobs:
  exec:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - uses: pnpm/action-setup@v2
        with:
          version: 7

      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 14
          cache: "pnpm"

image

This is my Version yaml

name: Version

on:
  push:
    branches:
      - master

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
  version:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - uses: pnpm/action-setup@v2
        with:
          version: 7

      - name: Install Node.js
        uses: actions/setup-node@v3
        with:
          node-version: 16
          cache: "pnpm"

image

Expected behaviour:

Node version is taken into account on the cache generation key.

Actual behaviour:

Same cache is being used, which leads to longer pnpm install steps, and cache race conditions.

主要言語
TypeScript
スター
5k
フォーク
1.7k
平均マージ
2日 11時間
マージ済み PR(30日)
3

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

actions/setup-node のほかの issue

actions/setup-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。