Skip to content

chore: Suggest npm ci instead of npm install#11627

Open
hmacr wants to merge 2 commits into1.9.xfrom
ser-1176
Open

chore: Suggest npm ci instead of npm install#11627
hmacr wants to merge 2 commits into1.9.xfrom
ser-1176

Conversation

@hmacr
Copy link
Copy Markdown
Contributor

@hmacr hmacr commented Mar 24, 2026

Closes SER-1176

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cf93b2f9-36d9-4c96-af2e-ff74771ae10e

📥 Commits

Reviewing files that changed from the base of the PR and between 2ec6b7a and a1e3df1.

📒 Files selected for processing (1)
  • app/config/templates/site.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/config/templates/site.php

📝 Walkthrough

Walkthrough

The pull request replaces npm install with npm ci across configuration and template files for Node-based frameworks and runtimes, updates example strings in several response/model classes to match, and adjusts tests that assert detected framework install commands. Changes are limited to configuration values, example metadata, and test expectations; no public API signatures or functional logic were modified.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: replacing npm install with npm ci across the codebase.
Description check ✅ Passed The description references the issue it closes (SER-1176) and is related to the changeset about updating npm install guidance.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ser-1176

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 24, 2026

Greptile Summary

This PR replaces all default npm install install commands with npm ci across framework configs, function/site templates, and API response model examples. This is a good CI/CD hygiene improvement — npm ci performs a clean, deterministic install from the lock file, is faster in automated environments, and prevents accidental lock file mutations during builds.

Key points:

  • All affected entries in app/config/frameworks.php, app/config/templates/function.php, and app/config/templates/site.php are updated consistently, including compound commands (npm ci && npm run setup, npm ci && cd web && npm ci && cd ..).
  • All API response model example fields across 8 model classes are updated to reflect the new default.
  • E2E test assertions are updated to expect npm ci for the sveltekit, astro, and remix framework detections.
  • One npm install occurrence remains on line 256 of app/config/templates/site.php (npm i vitepress && npm install) — this appears to have been missed rather than intentionally left as-is.
  • Note for users: npm ci requires a committed package-lock.json (or npm-shrinkwrap.json) and will fail if the lock file is absent or out of sync with package.json. Users who do not commit their lock file, or who use yarn/pnpm, will see their builds fail with this default. This is an intentional tradeoff for reproducible CI builds but is worth communicating in user-facing documentation or error messages.

Confidence Score: 4/5

  • Safe to merge; one minor missed instance in site.php and a worth-noting behavioral change for users without a package-lock.json.
  • The change is consistent and correct across nearly all files. One npm install in app/config/templates/site.php (line 256) was not updated. Additionally, switching to npm ci is a behavioral change that will break builds for users who do not commit a package-lock.json, which is an intentional but notable tradeoff.
  • app/config/templates/site.php (line 256 — remaining npm install not updated)

Important Files Changed

Filename Overview
app/config/frameworks.php All npm install occurrences replaced with npm ci across all framework adapters (analog, angular, next.js, vue, nuxt, preact, sveltekit, astro, tanstack-start, remix, solid). Changes are consistent and correct.
app/config/templates/function.php All Node.js template runtimes updated from npm install to npm ci, including compound commands like npm install && npm run setupnpm ci && npm run setup. Changes are consistent.
app/config/templates/site.php Most npm install occurrences updated to npm ci, but line 256 retains npm i vitepress && npm install — the npm install part was not updated, creating a minor inconsistency with the rest of the PR.
tests/e2e/Services/VCS/VCSConsoleClientTest.php Three test assertions updated to expect npm ci instead of npm install for sveltekit, astro, and remix frameworks. Test file contains no remaining npm install assertions that were missed.

Comments Outside Diff (1)

  1. app/config/templates/site.php, line 256 (link)

    P2 Leftover npm install not updated

    This line was not updated as part of this PR, leaving it inconsistent with all other installCommand entries. The trailing npm install could be changed to npm ci here as well — by the time it runs, npm i vitepress will have already written a lock file entry for vitepress, so npm ci would install the remaining dependencies deterministically.

    Alternatively, the npm install at the end is actually redundant because npm i vitepress already installs all dependencies (including other packages listed in package.json). Consider simplifying to just npm i vitepress.

Reviews (1): Last reviewed commit: "chore: Suggest `npm ci` instead of `npm ..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/config/frameworks.php`:
- Line 24: Replace the restrictive default install command so generic framework
detection doesn't fail: change the 'installCommand' default from "npm ci" to
"npm install" in the frameworks configuration (update the 'installCommand' key),
and move any optimized "npm ci" usage into your curated templates configuration
(i.e., template-specific configs) so template installs can still use CI while
framework detection remains permissive.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 7e89fda7-f398-4bbb-b298-280b4cc9f95a

📥 Commits

Reviewing files that changed from the base of the PR and between d4f7d51 and 2ec6b7a.

📒 Files selected for processing (12)
  • app/config/frameworks.php
  • app/config/templates/function.php
  • app/config/templates/site.php
  • src/Appwrite/Utopia/Response/Model/DetectionFramework.php
  • src/Appwrite/Utopia/Response/Model/DetectionRuntime.php
  • src/Appwrite/Utopia/Response/Model/Framework.php
  • src/Appwrite/Utopia/Response/Model/FrameworkAdapter.php
  • src/Appwrite/Utopia/Response/Model/Func.php
  • src/Appwrite/Utopia/Response/Model/Site.php
  • src/Appwrite/Utopia/Response/Model/TemplateFramework.php
  • src/Appwrite/Utopia/Response/Model/TemplateRuntime.php
  • tests/e2e/Services/VCS/VCSConsoleClientTest.php

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 24, 2026

🔄 PHP-Retry Summary

Flaky tests detected across commits:

Commit a1e3df1 - 3 flaky tests
Test Retries Total Time Details
UsageTest::testVectorsDBStats 1 10.03s Logs
LegacyCustomClientTest::testCreateIndexes 1 241.00s Logs
LegacyTransactionsCustomServerTest::testCommit 1 240.73s Logs

@github-actions
Copy link
Copy Markdown

✨ Benchmark results

  • Requests per second: 1,635
  • Requests with 200 status code: 294,346
  • P99 latency: 0.105877318

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 1,635 1,109
200 294,346 199,690
P99 0.105877318 0.204359118

@blacksmith-sh

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant