chore: enforce npm min-release-age dependency cooldown - #416
Open
joker23 wants to merge 6 commits into
Open
Conversation
Co-Authored-By: Steven Zhang <szhang@launchdarkly.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
@cursor review |
Co-Authored-By: Steven Zhang <szhang@launchdarkly.com>
Co-Authored-By: Steven Zhang <szhang@launchdarkly.com>
Co-Authored-By: Steven Zhang <szhang@launchdarkly.com>
Co-Authored-By: Steven Zhang <szhang@launchdarkly.com>
Co-Authored-By: Steven Zhang <szhang@launchdarkly.com>
joker23
marked this pull request as ready for review
August 7, 2026 15:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requirements
Related issues
Supply chain hardening for legacy SDK repositories, mirroring js-core's yarn
npmMinimalAgeGate: 4320(3 days).Describe the solution you've provided
.npmrcwithmin-release-age=3(npm expresses this in days), so npm resolves only versions published more than 3 days ago. Unlike a Dependabot-level setting, this applies to every install — local development and CI alike.min-release-age-excludeexplicitly names the first-party packages this repo actually resolves (launchdarkly-js-client-sdkand its transitivelaunchdarkly-js-sdk-common), so LaunchDarkly patches can be adopted immediately while third-party releases stay quarantined. Names are listed individually rather than pattern matched..npmrcis un-ignored so the setting is committed; publishing is unaffected becausesetup-nodewrites its auth.npmrcto a tempNPM_CONFIG_USERCONFIGpath, not into the repo.npm@^12.0.0beforenpm install, so the gate applies to both PR builds and published releases.min-release-age-excludeneeds npm 12, which requires node >=22.22, so the older CI matrix entry is raised to node 22.Describe alternatives you've considered
Dependabot
cooldown— only governs Dependabot PRs, and these legacy repos aren't aiming to stay continuously updated.Additional context
Verified locally with npm 12:
npm installand the test suite pass with the gate active. CI is green.Link to Devin session: https://app.devin.ai/sessions/566f0d951dfa4568b67ad0c6c1cfb7c1
Requested by: @joker23
Note
Low Risk
Workflow and install-policy changes only; no application runtime logic. Slightly delays adoption of very new third-party releases by design.
Overview
Adds supply-chain hardening so installs only resolve npm package versions published more than 3 days ago, aligned with js-core’s dependency cooldown.
A committed
.npmrcsetsmin-release-age=3and exemptslaunchdarkly-js-client-sdkandlaunchdarkly-js-sdk-commonso first-party LaunchDarkly packages can still update immediately..npmrcis removed from.gitignoreso the policy applies in local dev and CI.CI pins the matrix to Node 22 (replacing
lts/*) and installsnpm@^12beforenpm install, sincemin-release-age-excludeneeds npm 12. Release workflows likewise upgrade global npm from 11.6.2 tonpm@^12.0.0before dependency install and publish.Reviewed by Cursor Bugbot for commit 5c891d8. Bugbot is set up for automated code reviews on this repo. Configure here.