Conversation
…inimumReleaseAge Without this, a user-set `minimumReleaseAge` would silently fall back to installing an immature version when no mature version satisfied the requested range, making the setting look like it had no effect (#11433). The built-in default of `minimumReleaseAge` (1440) stays non-strict for backward compatibility, and an explicit `minimumReleaseAgeStrict: false` is still respected.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughgetConfig now sets ChangesMinimum Release Age Strictness Default
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 9/10 reviews remaining, refill in 6 minutes. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@config/reader/src/index.ts`:
- Around line 432-443: The defaulting for pnpmConfig.minimumReleaseAgeStrict
runs before environment variables are parsed, so pnpm_config_minimum_release_age
set via env (which populates pnpmConfig.explicitlySetKeys later) is missed; move
the block that checks pnpmConfig.explicitlySetKeys.has('minimumReleaseAge') and
sets pnpmConfig.minimumReleaseAgeStrict = true to run after the env parsing
logic (the code that populates pnpmConfig.explicitlySetKeys from pnpm_config_*),
or alternatively ensure env-derived keys are merged into
pnpmConfig.explicitlySetKeys before this check; update references to pnpmConfig,
explicitlySetKeys, minimumReleaseAge and minimumReleaseAgeStrict accordingly.
In `@config/reader/test/index.ts`:
- Around line 319-383: Add a test case to cover the env-var path: call getConfig
with env: { pnpm_config_minimum_release_age: '60' } and assert that
config.minimumReleaseAge === 60 and config.minimumReleaseAgeStrict === true
(mirroring the existing tests for CLI and pnpm-workspace.yaml); also add a
complementary case ensuring that when the workspace/yaml is empty and no env var
is set the built-in default (minimumReleaseAge === 1440) still leaves
minimumReleaseAgeStrict undefined. Locate and modify the same describe block
testing minimumReleaseAgeStrict around getConfig, minimumReleaseAge and
minimumReleaseAgeStrict to add these assertions.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: dcce3446-b06c-4a54-8e45-a59ce6ece342
📒 Files selected for processing (3)
.changeset/strict-min-release-age-when-user-set.mdconfig/reader/src/index.tsconfig/reader/test/index.ts
There was a problem hiding this comment.
Pull request overview
This PR updates pnpm’s config reader behavior so that when a user explicitly configures minimumReleaseAge, the related enforcement flag minimumReleaseAgeStrict defaults to true (unless explicitly set), making the constraint reliably enforced while preserving non-strict behavior for the built-in default.
Changes:
- Default
minimumReleaseAgeStricttotruewhenminimumReleaseAgeis explicitly set. - Add unit tests covering workspace YAML, CLI, explicit
minimumReleaseAgeStrict: false, and built-in defaults. - Add a changeset describing the behavioral change for release notes.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| config/reader/src/index.ts | Adds logic to default minimumReleaseAgeStrict when minimumReleaseAge is explicitly configured. |
| config/reader/test/index.ts | Adds unit tests validating the new defaulting behavior in key scenarios. |
| .changeset/strict-min-release-age-when-user-set.md | Documents the behavior change for package releases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Move the strict-default logic to run after `parseEnvVars` so `pnpm_config_minimum_release_age` is also covered.
There was a problem hiding this comment.
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 `@config/reader/test/index.ts`:
- Around line 368-383: The test "respects an explicit
minimumReleaseAgeStrict=false from pnpm-workspace.yaml" only asserts
config.minimumReleaseAgeStrict; also assert that the parsed minimumReleaseAge is
preserved by adding an expectation like
expect(config.minimumReleaseAge).toBe(60). Update the test in
config/reader/test/index.ts (the test block) so after awaiting getConfig(...)
and before finishing, add an assertion that config.minimumReleaseAge === 60 to
guard against regressions in getConfig's parsing of minimumReleaseAge.
🪄 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: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e1f4f044-bfb2-4bbd-8089-40825ff04e18
📒 Files selected for processing (2)
config/reader/src/index.tsconfig/reader/test/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- config/reader/src/index.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…inimumReleaseAge (#11436) * fix(config): default minimumReleaseAgeStrict to true when user sets minimumReleaseAge Without this, a user-set `minimumReleaseAge` would silently fall back to installing an immature version when no mature version satisfied the requested range, making the setting look like it had no effect (#11433). The built-in default of `minimumReleaseAge` (1440) stays non-strict for backward compatibility, and an explicit `minimumReleaseAgeStrict: false` is still respected. * chore(changeset): downgrade to patch * fix(config): apply minimumReleaseAgeStrict default after env var parsing Move the strict-default logic to run after `parseEnvVars` so `pnpm_config_minimum_release_age` is also covered. * test(config): also assert minimumReleaseAge in the strict=false test
Summary
minimumReleaseAge(viapnpm-workspace.yaml, the globalconfig.yaml, the CLI, orpnpm_config_*env vars),minimumReleaseAgeStrictnow defaults totrueso the constraint is actually enforced.minimumReleaseAgecould silently fall back to installing an immature version when no mature version satisfied the requested range, making the setting look like it had no effect.minimumReleaseAge(1440) stays non-strict, preserving existing behavior for users who haven't configured it. An explicitminimumReleaseAgeStrict: falseis still respected.Fixes #11433.
Test plan
config/reader/test/index.tscover all four cases (workspace yaml, CLI, explicitfalseoverride, built-in default)minimumReleaseAgeset inpnpm-workspace.yamlwith no satisfying version → install errors instead of silently picking an immature versionminimumReleaseAgeStrict: false→ silent fallback preservedSummary by CodeRabbit
Behavior Changes
Tests