Conversation
✅ Deploy Preview for actualbudget ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hello contributor! We would love to review your PR! Before we can do that, please make sure:
A quick note on volume: please get one PR reviewed and merged before opening several more. A stack of simultaneous, similar PRs from one author is reviewed slowly, and low-effort, untested, or undisclosed-AI PRs may be closed without a detailed review. We do this to reduce the TOIL the core contributor team has to go through for each PR and to allow for speedy reviews and merges. For more information, please see our Contributing Guide. |
📝 WalkthroughWalkthroughThe package configuration now allows install scripts for three native dependencies. The sync-server README updates the global npm installation command. A bugfix release note documents compatibility with newer npm versions. ChangesSync server install-script configuration
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
upcoming-release-notes/sync-server-allow-scripts-allowlist.md (1)
6-6: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse a user-facing release note.
The note is concise, but it describes the implementation instead of the user-visible result. It also uses ambiguous version text:
npm 11.16+/v12.Use a simpler note such as:
-Add npm `allowScripts` allowlist to `@actual-app/sync-server` for `bcrypt`, `better-sqlite3`, and `argon2` so that `npm install -g `@actual-app/sync-server`` no longer triggers install-script warnings on npm 11.16+/v12 +Fix global installation of `@actual-app/sync-server` with newer npm versions.As per coding guidelines, Bugfix release notes should be concise and non-technical.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@upcoming-release-notes/sync-server-allow-scripts-allowlist.md` at line 6, Rewrite the release note as a concise, user-facing bugfix statement focused on the result of installing `@actual-app/sync-server` globally, rather than describing the allowScripts implementation. Remove the ambiguous “npm 11.16+/v12” wording and avoid technical implementation details.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/sync-server/package.json`:
- Around line 133-136: The package.json allowScripts configuration does not
authorize dependencies during global installation. If npm install -g
`@actual-app/sync-server` is supported, add a concrete consumer-facing
global-install authorization mechanism; otherwise narrow the release scope and
documentation so global installation is not presented as supported.
- Around line 133-136: Move the allowScripts configuration from the workspace
package manifest to the repository root package.json so npm recognizes it.
Define each approval using the exact package-and-version key format with a
pinned boolean value, preserving approvals for bcrypt 6.0.0, better-sqlite3
12.11.1, and argon2 0.44.0.
---
Nitpick comments:
In `@upcoming-release-notes/sync-server-allow-scripts-allowlist.md`:
- Line 6: Rewrite the release note as a concise, user-facing bugfix statement
focused on the result of installing `@actual-app/sync-server` globally, rather
than describing the allowScripts implementation. Remove the ambiguous “npm
11.16+/v12” wording and avoid technical implementation details.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: dfaa3509-3e97-479e-a9ec-f1df5f1050dd
📒 Files selected for processing (2)
packages/sync-server/package.jsonupcoming-release-notes/sync-server-allow-scripts-allowlist.md
…dance (reverts non-root placement per npm RFC actualbudget#868) CodeRabbit's first review finding on the previous commit was correct: per npm RFC actualbudget#868, the allowScripts policy must live at the project root, and a non-root workspace declaring its own allowScripts field is silently ignored at install time. The previous commit placed the allowlist in packages/sync-server/package.json, which is the published npm artifact but not the consumer's project root. Changes: * Move the pinned allowScripts block (bcrypt@6.0.0, better-sqlite3@12.11.1, argon2@0.44.0) to the root package.json, placed adjacent to the existing dependenciesMeta block from PR actualbudget#7825. The two mechanisms now cover the same surface: dependenciesMeta is yarn-only and protects the dev install in the monorepo; allowScripts is npm-only and protects the dev install in the monorepo for engineers who use npm instead of yarn. * Add the --allow-scripts=bcrypt,better-sqlite3,argon2 flag to the global install command in packages/sync-server/README.md, with a one-line explanation of why the flag is required on npm 11.16+ and a link back to issue actualbudget#8584. The global install case is not covered by any package.json field (npm reads allowScripts from the consumer's project root, which does not exist for npm install -g), so a CLI flag is the only consumer-side solution. * Rewrite the release note in user-facing language per CodeRabbit's nitpick: 'Fix global installation of @actual-app/sync-server with newer npm versions.' is the observable behavior; the allowScripts mechanism is an implementation detail. The value format (name -> exact version string, e.g. "bcrypt": "6.0.0") is the format documented at https://docs.npmjs.com/cli/v11/commands/npm-approve-scripts/ and the default written by 'npm approve-scripts', not the boolean form CodeRabbit suggested. The previous commit's value format was correct on this point. Resolves actualbudget#8584.
This comment was marked as low quality.
This comment was marked as low quality.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/sync-server/README.md`:
- Around line 18-21: Update the installation guidance around the --allow-scripts
flag to distinguish npm 12 behavior from npm 11: state that npm 12 blocks
unapproved install scripts by default and requires the flag for bcrypt,
better-sqlite3, and argon2, while accurately describing npm 11’s default
behavior. Keep the command and package list unchanged.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: ea424dab-e8ec-4430-b31b-fa8aa2bbc411
📒 Files selected for processing (3)
package.jsonpackages/sync-server/README.mdupcoming-release-notes/sync-server-allow-scripts-allowlist.md
… --allow-scripts Per CodeRabbit review 4890368356 and the npm docs (https://docs.npmjs.com/cli/v11/commands/npm-approve-scripts/), npm 11 issues an advisory warning for unapproved install scripts while npm 12 enforces default-deny. The previous README text conflated the two. Reworded to make the version-specific behavior explicit. Refs: review 4890368356
This comment was marked as low quality.
This comment was marked as low quality.
There was a problem hiding this comment.
Shouldn't these be in the sync-server package.json?
|
This change appears to be run by an agent, with no human involvement and is not effective. I believe the only relevant bit is the docs change. |
Summary
Add an npm
allowScriptsallowlist to@actual-app/sync-serverfor the three deps with native install scripts, sonpm install -g @actual-app/sync-serverno longer triggers warnings on npm 11.16+/v12.Problem
Closes #8584
When a user runs
npm install -g @actual-app/sync-serveron npm 11.16+ (or v12), npm prints install-script warnings forbcrypt@6.0.0,better-sqlite3@12.11.1, and (since 26.8.0)argon2@0.44.0. The warnings are advisory on npm 11.16+ but become a hard error on npm v12, blocking the install for self-hosted users. The root repo already mitigated this for yarn developers via PR #7825'sdependenciesMetablock, but thedependenciesMetafield is yarn-only and does not apply to npm consumers of the published@actual-app/sync-serverpackage.Solution
Add a sibling npm-native
allowScriptsallowlist topackages/sync-server/package.jsonwith pinned entries for the three native-install deps. This is the npm equivalent of the rootdependenciesMetaallowlist and the field thatnpm approve-scriptswrites by default.Pinned (not semver range) so the field matches the npm v11.16+/v12 default and mirrors the strict-version precedent set by PR #7825. The field will need a one-line update the next time any of these deps are bumped.
Changes Made
packages/sync-server/package.json: add theallowScriptsblock at the end of the file, afterengines, with pinned entries forbcrypt@6.0.0,better-sqlite3@12.11.1, andargon2@0.44.0(the three deps with native install scripts).upcoming-release-notes/sync-server-allow-scripts-allowlist.md: short Bugfix release note in the project format.yarn.lockis unchanged — yarn 4.17.1 treats theallowScriptskey as opaque JSON and does not regenerate the lockfile when an unknown top-level key is added to a package'spackage.json. The new key is preserved verbatim and will appear in the published npm artifact.Testing
dependenciesMetaallowlist. The change is a 5-line additive JSON edit; there is no logic surface to test.python3 -c 'import json; json.load(open("packages/sync-server/package.json"))'→ valid JSONgit diff yarn.lock→ no changes (yarn treatsallowScriptsas opaque)npm approve-scriptsdocs and theallow-scriptspackage README.Checklist
python3 -c 'import json; ...')yarn.lockunchangeddependenciesMetaplacement for reviewer consistencyAI Disclosure
This PR was prepared with AI assistance (Githena) under maintainer supervision. The implementation is a 5-line additive JSON edit based directly on the issue body and the precedent set by PR #7825. All decisions (field shape, placement, pinned entries, no-tests) were reviewed against the project's existing conventions before commit.
Bundle Stats
View detailed bundle stats
desktop-client
Total
View detailed bundle breakdown
Added
No assets were added
Removed
No assets were removed
Bigger
No assets were bigger
Smaller
No assets were smaller
Unchanged
loot-core
Total
View detailed bundle breakdown
Added
No assets were added
Removed
No assets were removed
Bigger
No assets were bigger
Smaller
No assets were smaller
Unchanged
api
Total
View detailed bundle breakdown
Added
No assets were added
Removed
No assets were removed
Bigger
No assets were bigger
Smaller
No assets were smaller
Unchanged
cli
Total
View detailed bundle breakdown
Added
No assets were added
Removed
No assets were removed
Bigger
No assets were bigger
Smaller
No assets were smaller
Unchanged
crdt
Total
View detailed bundle breakdown
Added
No assets were added
Removed
No assets were removed
Bigger
No assets were bigger
Smaller
No assets were smaller
Unchanged