Bug 843394

Summary: npm modules of nodejs app aren't cleaned after touching force_clean_build marker
Product: OKD Reporter: jizhao
Component: ContainersAssignee: Mrunal Patel <mpatel>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: szhou
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: devenv_1922 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-07 20:42:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jizhao 2012-07-26 08:40:00 UTC
Description of problem:
Create a nodejs-0.6 app, add some modules like "optimist" to the dependencies in package.json and git push all the changes. optimist will be installed. Touch force_clean_build marker, remove "optimist" from package.json and git push. optimist still exists in $OPENSHIFT_GEAR_DIR/repo/node_modules/ and still can be used.

Version-Release number of selected component (if applicable):
devenv_1912

How reproducible:
Always

Steps to Reproduce:
1.Create a nodejs-0.6 app
2.Add optimist to dependencies in package.json:
  "dependencies": {
      "optimist": "0.3.4"
  },
3.Add 1 line to <git_repo>/server.js
var argv    = require('optimist').argv;
4.Git push all the changes.
5.Touch force_clean_build marker.
$ touch .openshift/markers/force_clean_build
6.Remove optimist from package.json and git push all the changes.
7.Log in the app using Openshift Shell and check $OPENSHIFT_GEAR_DIR/repo/node_modules/. Check the app.
  
Actual results:
7.optimist still exists under $OPENSHIFT_GEAR_DIR/repo/node_modules/.
The app is still available.

Expected results:
7.optimist should be removed from $OPENSHIFT_GEAR_DIR/repo/node_modules/.
The app should be unavailable because module "optimist" not found.

Additional info:

Comment 1 jizhao 2012-07-26 08:49:29 UTC
Besides, I find 3 "node_modules" dirs in app's home dir, none of which is symbolic link:
app-root/runtime/repo/node_modules/
node_modules/
nodejs-0.6/node_modules/

Among them, "nodejs-0.6/node_modules/" is always empty. Is is necessary ?

Comment 2 Mrunal Patel 2012-07-27 22:06:53 UTC
https://github.com/openshift/crankcase/pull/297

Comment 3 jizhao 2012-07-30 08:07:46 UTC
The change is not in devenv_1920. I will test it on the next devenv.

Comment 4 jizhao 2012-07-31 07:59:06 UTC
Verified on INT server.