chihsuan commented on code in PR #12140:
URL: https://github.com/apache/ozone/pull/12140#discussion_r4678658912


##########
.github/workflows/populate-cache.yml:
##########


Review Comment:
   Should we also add `**/pnpm-lock.yaml` to the push paths?



##########
.github/workflows/populate-cache.yml:
##########
@@ -62,6 +62,32 @@ jobs:
         with:
           only-exact-hit: true
 
+      - name: Restore NPM dependencies
+        id: restore-pnpm
+        uses: actions/cache/restore@v6
+        with:
+          path: |
+            ~/.pnpm-store
+          key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
+
+      - name: Fetch NPM dependencies

Review Comment:
   If the npm fetch fails here, the Maven cache save may be skipped too. Would 
it make sense to move the NPM steps after the Maven cache save?



##########
.github/workflows/populate-cache.yml:
##########
@@ -62,6 +62,32 @@ jobs:
         with:
           only-exact-hit: true
 
+      - name: Restore NPM dependencies
+        id: restore-pnpm
+        uses: actions/cache/restore@v6
+        with:
+          path: |
+            ~/.pnpm-store
+          key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
+
+      - name: Fetch NPM dependencies
+        if: steps.restore-pnpm.outputs.cache-hit != 'true'
+        run: |
+          ./mvnw -pl :ozone-recon 
com.github.eirslett:frontend-maven-plugin:install-node-and-pnpm
+          run_pnpm() {
+            ./mvnw -pl :ozone-recon 
com.github.eirslett:frontend-maven-plugin:pnpm -Dfrontend.pnpm.arguments="$1"
+          }
+          run_pnpm "config set store-dir ~/.pnpm-store"
+          run_pnpm fetch
+
+      - name: Save NPM dependencies
+        if: steps.restore-pnpm.outputs.cache-hit != 'true'
+        uses: actions/cache/save@v6
+        with:
+          path: |
+            ~/.pnpm-store
+          key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}

Review Comment:
   Could we reuse the key from the restore step here, like the Maven save does 
to avoid key mismatch we hit in HDDS-17242?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to