Fix unsupported Node onboarding failures#102
Conversation
📝 WalkthroughWalkthroughChangesNode.js compatibility is centralized in shared CommonJS helpers, enforced during installation and CLI startup, wired through package scripts, tested against package metadata and version cases, and verified in CI under supported and unsupported runtimes. Node compatibility enforcement
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant scripts/devspace.cjs
participant node-version.cjs
participant dist/cli.js
User->>scripts/devspace.cjs: invoke devspace command
scripts/devspace.cjs->>node-version.cjs: validate Node.js version
node-version.cjs-->>scripts/devspace.cjs: return support status
alt supported version
scripts/devspace.cjs->>dist/cli.js: dynamically import CLI
dist/cli.js-->>User: execute command
else unsupported version
scripts/devspace.cjs-->>User: print error and exit
end
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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: 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 @.github/workflows/ci.yml:
- Around line 56-57: Update the Checkout step using actions/checkout@v4 to set
persist-credentials to false before dependency installation runs.
🪄 Autofix (Beta)
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: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f92132f1-a56c-4233-b1d7-5b936ffb9802
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (7)
.github/workflows/ci.ymlpackage.jsonscripts/check-node-version.cjsscripts/devspace.cjsscripts/node-version.cjssrc/cli.test.tssrc/cli.ts
| - name: Checkout | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Disable persisted checkout credentials before running dependency scripts.
npm ci can execute lifecycle scripts; with checkout’s default credential persistence, a compromised dependency can read the GitHub token from local Git configuration. Set persist-credentials: false.
Proposed fix
- name: Checkout
uses: actions/checkout@v4
+ with:
+ persist-credentials: false📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false |
🧰 Tools
🪛 zizmor (1.26.1)
[warning] 56-57: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 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 @.github/workflows/ci.yml around lines 56 - 57, Update the Checkout step
using actions/checkout@v4 to set persist-credentials to false before dependency
installation runs.
Source: Linters/SAST tools
Summary
devspacebinary through a dependency-free runtime bootstrapWhy
On Node 18,
devspace initcurrently parses@earendil-works/pi-tuibefore the existing runtime guard executes, producingSyntaxError: Invalid regular expression flags. The launcher now validates Node before importing the compiled CLI, whilepreinstallrejects normal unsupported installations.Validation
npm cinpm run typechecknpm testnpm run buildnpm pack --dry-runSummary by CodeRabbit
New Features
Bug Fixes
Tests