chore(deps): add npm release age constraint for @kilocode/cli - #801
Conversation
- Set min-release-age=3 to defer installation of npm packages released within the last 3 days, reducing risk of installing unstable prereleases - Add .npmrc config file to persist this setting across builds - Update Dockerfile to configure npm before installing @kilocode/cli
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe change sets npm’s ChangesConfiguration updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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: 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 @.npmrc:
- Line 1: Update the markdown-fix workflow’s markdownlint-cli2 installation step
to use npm 11.10 or newer, either by configuring its npm-version override or by
selecting a Node release that bundles a supported npm version; ensure the
existing min-release-age setting is recognized during npm install.
🪄 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: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: ea729bab-8999-4a01-bd10-335f39ef070f
📒 Files selected for processing (2)
.devcontainer/Dockerfile.npmrc
📜 Review details
🔇 Additional comments (2)
.devcontainer/Dockerfile (1)
107-107: LGTM!.npmrc (1)
1-1: 🔒 Security & PrivacySecurity Misconfiguration (CWE-16)
Reachability: External
Verify project configuration for global installs.
Line [1] is a project
.npmrcsetting. npm does not read project.npmrcfiles in global mode. The shown workflow commands usenpm install -g, so they bypass this setting unless they also configureuserconfig, an environment variable, or a command-line flag. Apply the policy at user scope or directly on each global install. (docs.npmjs.com)
- Update setup-node to Node.js v26 (released 2026-04) - Disable package-manager-cache to avoid stale npm dependencies - No effect on workflow output; ensures consistent, up-to-date tooling
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Pull request overview
This PR reduces npm supply-chain risk by enforcing a minimum “release age” before newly published package versions are eligible for installation, and updates the auto-fix workflows/devcontainer to align with that policy.
Changes:
- Add
.npmrcto setmin-release-age=3. - Configure npm with
min-release-age=3in the devcontainer before installing@kilocode/cli. - Update Markdown/YAML fix workflows to use Node.js 26 and disable setup-node’s package-manager cache.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.npmrc |
Adds repo-level npm policy to defer installing very new releases. |
.github/workflows/yaml-fix.yaml |
Updates Node version and disables setup-node package-manager caching for the YAML fixer workflow. |
.github/workflows/markdown-fix.yaml |
Updates Node version, disables setup-node package-manager caching, and switches markdownlint install step to a multiline run block. |
.devcontainer/Dockerfile |
Sets npm min-release-age prior to installing @kilocode/cli in the devcontainer image. |
Suppressed comments (1)
.npmrc:2
- The new .npmrc currently has a trailing blank line (line 2 is empty). Repo guidelines require text files to end with exactly one newline and no extra blank lines at EOF; this extra line can trip whitespace/EOF fixers.
min-release-age=3
Install npm 11.10.0+ before running format tools in markdown-fix.yaml and yaml-fix.yaml workflows, and update devcontainer Dockerfile to ensure a recent npm version. This prevents failures from older npm versions that may not support required package features. Fixes node-version "26" → "26" (no change, explicit version for clarity).
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Suppressed comments (2)
.github/workflows/markdown-fix.yaml:115
min-release-age=3is added in the repo’s.npmrc, but this step runs outside the checkout directory (the repo is checked out into${{ needs.setup.outputs.checkout_path }}), so npm likely won’t read the project.npmrcand the cooldown won’t apply to this global install. Setworking-directoryto the checkout path (or set the config in user/global scope) so the constraint is actually enforced here.
- name: Install markdownlint-cli2
run: |
npm install -g markdownlint-cli2
.github/workflows/yaml-fix.yaml:116
min-release-age=3is committed as a project.npmrc, but this global install runs from the default working directory rather than the checkout directory (${{ needs.setup.outputs.checkout_path }}), so npm likely won’t pick up the project config and the release-age constraint won’t be applied. Run this step from the checkout path (or set the config in user/global scope).
- name: Install prettier
run: |
npm install -g prettier
knoepfel
left a comment
There was a problem hiding this comment.
How is the top-level .npmrc file used? It would be nice if it didn't have to go in the top-level directory of the repository, which is already cluttered with many files.
Good call: this is an AI mistake. The "project-level" I will set it at the user level instead of relying on a file (cf |
the last 3 days, reducing risk of installing unstable prereleases
Build system
.npmrcwithmin-release-age=3.@kilocode/cliin.devcontainer/Dockerfile.CI
markdownlint-cli2with a multiline shell command in the Markdown Fix workflow.