Repository navigation
chore: disable lifecycle hooks - #4664
Conversation
Summary by CodeRabbit
Summary by CodeRabbit
WalkthroughReplaces the skipPrepareScript approach with an explicit prepare phase: adds Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer/CI
participant CI as CI workflow
participant NPM as npm
note over CI,NPM: .npmrc sets ignore-scripts=true
Dev->>CI: trigger job
CI->>NPM: npm ci
Note right of NPM: lifecycle scripts skipped
CI->>NPM: npm run prepare
NPM-->>CI: prepare completes
CI-->>Dev: continue pipeline
sequenceDiagram
autonumber
participant Builder as Docker build
participant DevStage as dev stage
participant ProdStage as prodDepsBuilder
participant NPM as npm
note over Builder: Dockerfiles use --ignore-scripts then explicit prepare
Builder->>DevStage: RUN npm ci --ignore-scripts --no-audit --cache .npm
DevStage->>NPM: npm run prepare
DevStage->>NPM: npm run setup:swagger
DevStage-->>Builder: dev prepared
Builder->>ProdStage: RUN npm ci --ignore-scripts --omit=dev --no-audit --cache .npm
ProdStage->>NPM: npm run clean:node
ProdStage-->>Builder: prod deps ready
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (11)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (8)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
🔇 Additional comments (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
87595ea to
5ae580e
Compare
|
Allure Test reports for this run are available at:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #4664 +/- ##
========================================
Coverage 91.78% 91.78%
========================================
Files 642 642
Lines 33974 33979 +5
Branches 8037 8047 +10
========================================
+ Hits 31184 31189 +5
Misses 2560 2560
Partials 230 230 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5ae580e to
c69c803
Compare
|
Allure Test reports for this run are available at:
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
.github/workflows/publish-new-release.yml (1)
45-49: Make npm install invocation consistent across workflows
- Most workflows already use "npm ci && npm run prepare": .github/workflows/ut-tests.yml, dt-test-and-report-code-coverage.yml, allure-test-reporter.yml, verify.yml, verify-server-start.yml, publish-new-release.yml, commitlint.yml.
- .github/workflows/draft-new-release.yml uses only "npm ci" — change it to "npm ci && npm run prepare" (or confirm the omission is intentional).
- No other legacy patterns (e.g., skipPrepareScript or npm install ... scripts) were found.
Dockerfile-ut-func (1)
34-36: Consider adding comments to document the manual prepare step.While the implementation is correct, consider adding inline comments to document why the manual
npm run preparestep is necessary after--ignore-scripts. This would help future maintainers understand the build process, especially since this pattern deviates from standard npm install behavior.# Install dependencies without running lifecycle scripts, then manually run prepare -RUN npm ci --ignore-scripts --no-audit --cache .npm && \ +RUN npm ci --ignore-scripts --no-audit --cache .npm && \ + # Manually run prepare to build isolated-vm and other native dependencies npm run prepareApply similar documentation to the production stage as well.
Also applies to: 54-57
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package.jsonis excluded by!**/*.json
📒 Files selected for processing (11)
.github/workflows/allure-test-reporter.yml(1 hunks).github/workflows/commitlint.yml(1 hunks).github/workflows/dt-test-and-report-code-coverage.yml(1 hunks).github/workflows/publish-new-release.yml(2 hunks).github/workflows/ut-tests.yml(1 hunks).github/workflows/verify-server-start.yml(1 hunks).github/workflows/verify.yml(1 hunks).npmrc(1 hunks)Dockerfile(2 hunks)Dockerfile-ut-func(2 hunks)scripts/skipPrepareScript.js(0 hunks)
💤 Files with no reviewable changes (1)
- scripts/skipPrepareScript.js
🚧 Files skipped from review as they are similar to previous changes (8)
- .github/workflows/verify.yml
- .github/workflows/dt-test-and-report-code-coverage.yml
- .npmrc
- Dockerfile
- .github/workflows/ut-tests.yml
- .github/workflows/verify-server-start.yml
- .github/workflows/allure-test-reporter.yml
- .github/workflows/commitlint.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build User Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image AMD64
- GitHub Check: Build Transformer Docker Image - PR / Build Transformer Docker Image ARM64
- GitHub Check: Code Coverage
- GitHub Check: test_and_publish
🔇 Additional comments (5)
.github/workflows/publish-new-release.yml (2)
49-49: LGTM! Consistent with the lifecycle hook management strategy.The addition of
npm run prepareafternpm cialigns with the PR's objective to disable automatic lifecycle hooks via.npmrcand manually execute the prepare script. This ensures that theisolated-vmpackage is properly built from source during the release process.
169-169: Minor formatting improvement applied.The Slack action reference appears to have had extra whitespace removed while maintaining the same version tag (
v2.1.1). This is a minor formatting improvement that enhances readability.Dockerfile-ut-func (3)
34-36: LGTM! Clean consolidation of npm install and prepare steps.The consolidation of npm installation and prepare steps into a single RUN command is well-executed. Using
--ignore-scriptsfollowed by explicitnpm run prepareprovides better control over the build process and aligns with the repository-wide changes to disable lifecycle hooks.
54-57: LGTM! Production dependencies handling is correct.The production dependencies stage properly handles the new build approach by:
- Installing dependencies with
--ignore-scripts --omit=devto skip development dependencies and lifecycle hooks- Explicitly running
npm run prepareto build necessary native modules- Running
npm run clean:nodeto remove unnecessary filesThis approach provides better control and transparency in the build process.
34-36: Verify native modules are built (Dockerfile-ut-func lines 34–36, 54–57)Verification aborted: package.json not found at repo root. Confirm that npm run prepare actually builds native modules (e.g., isolated-vm, node-gyp-based deps) and that built artifacts are present in the final image. Quick checks to run locally or provide outputs for:
- Confirm prepare script: jq '.scripts.prepare // "MISSING"' path/to/package.json
- List potential native deps: jq -r '(.dependencies + .optionalDependencies + .devDependencies) // {} | to_entries[] | select(.key | test("isolated-vm|node-gyp|nan|bindings|prebuild|prebuild-install")) | "(.key): (.value)"' path/to/package.json
- Find native build files: rg -n '(binding.gyp|.gyp$|.cc$|.cpp$)' || fd -e gyp -e cc -e cpp
- Ensure prepare runs in a stage with build tools (python/make/g++/node-gyp) or that prebuilt binaries are fetched and copied into the production stage.
Provide the package.json path or outputs from the commands above to complete verification.
c69c803 to
2d58a41
Compare
|
Allure Test reports for this run are available at:
|
|



What are the changes introduced in this PR?
Introduced
.npmrcwith ignore-scripts=true to prevent lifecycle hooks. The rest of the changes are to accommodateisolated-vmmanual build as well as Dockerfile adjustments to manually callnpm run preparewhich buildsisolated-vmfrom source.