codeant-ai-for-open-source[bot] commented on code in PR #43168:
URL: https://github.com/apache/superset/pull/43168#discussion_r3785008638


##########
docker/docker-frontend.sh:
##########
@@ -32,8 +32,10 @@ if [ "$BUILD_SUPERSET_FRONTEND_IN_DOCKER" = "true" ]; then
         npm run prune
     fi
 
-    echo "Running \"npm install\""
-    npm install
+    # Install from the committed lockfile so a dev image build resolves the 
same
+    # versions that were reviewed, matching the `npm ci` used in the 
Dockerfile.
+    echo "Running \"npm ci\""
+    npm ci

Review Comment:
   **Suggestion:** Because `/app/superset-frontend` is a host bind mount and 
the compose files do not provide a separate `node_modules` volume, `npm ci` 
deletes and recreates the host's `superset-frontend/node_modules` directory. 
Running the container can therefore replace host-installed modules, including 
OS-specific native binaries, and may leave the host tree owned by the 
container's root user. Mount an anonymous or named volume at 
`/app/superset-frontend/node_modules` before running the install. [stale 
reference]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Host frontend dependencies are deleted on container startup.
   - ⚠️ Native modules may become incompatible with the host OS.
   - ⚠️ Root-owned files can impede host-side development.
   ```
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=41ed03cec54341e5aa900a0a40ba8754&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=41ed03cec54341e5aa900a0a40ba8754&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** docker/docker-frontend.sh
   **Line:** 37:38
   **Comment:**
        *Stale Reference: Because `/app/superset-frontend` is a host bind mount 
and the compose files do not provide a separate `node_modules` volume, `npm ci` 
deletes and recreates the host's `superset-frontend/node_modules` directory. 
Running the container can therefore replace host-installed modules, including 
OS-specific native binaries, and may leave the host tree owned by the 
container's root user. Mount an anonymous or named volume at 
`/app/superset-frontend/node_modules` before running the install.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43168&comment_hash=48edf92d63b65b8ef096124029c92567b0ff41b06b3398bd59bb4f0decbca597&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F43168&comment_hash=48edf92d63b65b8ef096124029c92567b0ff41b06b3398bd59bb4f0decbca597&reaction=dislike'>👎</a>



-- 
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