fix: refresh ignored builds when allowBuilds changes#11366
Conversation
|
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 (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughTracks workspace allowBuilds as an install-state input, detects changes to it during status checks, and prevents preserving previously ignored builds when allowBuilds explicitly disallows them. ChangesAllowBuilds tracked & ignored-builds preservation
Sequence Diagram(s)sequenceDiagram
actor CLI
participant Installer
participant StatusChecker
participant WorkspaceState
participant Lockfile
CLI->>Installer: run install/add (opts include allowBuilds)
Installer->>Lockfile: read filtered/current lockfile
Installer->>WorkspaceState: read modules manifest (.modules.yaml)
Installer->>Installer: for each ignoredBuild call isBuildExplicitlyDisallowed(depPath, allowBuild)
alt allowBuild explicitly false
Installer->>WorkspaceState: drop ignoredBuild (do not preserve)
else allowBuild true/unknown or depPath unparseable
Installer->>WorkspaceState: preserve ignoredBuild entry
end
CLI->>StatusChecker: checkDepsStatus(opts including allowBuilds)
StatusChecker->>WorkspaceState: compare settings (special-case allowBuilds)
alt allowBuilds changed from unset -> non-empty
StatusChecker->>CLI: upToDate: false (allowBuilds changed)
else
StatusChecker->>CLI: upToDate: true/other issues
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
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 unit tests (beta)
Comment |
9000d1b to
8e52c9f
Compare
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 `@deps/status/src/checkDepsStatus.ts`:
- Around line 148-154: The extra stale-state check for allowBuilds (in
checkDepsStatus.ts where workspaceState.settings.allowBuilds == null &&
opts.allowBuilds != null && !isEmpty(opts.allowBuilds)) ignores the
ignoredWorkspaceStateSettings list; update that conditional to also verify that
'allowBuilds' is not in ignoredWorkspaceStateSettings (e.g. add &&
!ignoredWorkspaceStateSettings.includes('allowBuilds')) before returning
upToDate: false so the check respects purposely ignored settings.
🪄 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: 0487e94b-4f03-4fcd-8b96-f1abc122eec4
📒 Files selected for processing (3)
.changeset/quiet-geese-build.mddeps/status/src/checkDepsStatus.tsdeps/status/test/checkDepsStatus.test.ts
✅ Files skipped from review due to trivial changes (2)
- .changeset/quiet-geese-build.md
- deps/status/test/checkDepsStatus.test.ts
Removes the duplicated ignored-build filter from deps-installer and deps-restorer and exposes it as `isBuildExplicitlyDisallowed` on `@pnpm/building.policy`, alongside `createAllowBuildFunction`.
… check The fallback that flagged installs when allowBuilds went from unset to non-empty bypassed the ignoredSettings filter, so callers that explicitly opted out of allowBuilds tracking (via ignoredWorkspaceStateSettings) could still be forced into a redundant install.
|
Congrats on merging your first pull request! 🎉🎉🎉 |
* fix: refresh ignored builds when allowBuilds changes * refactor: extract isBuildExplicitlyDisallowed into @pnpm/building.policy Removes the duplicated ignored-build filter from deps-installer and deps-restorer and exposes it as `isBuildExplicitlyDisallowed` on `@pnpm/building.policy`, alongside `createAllowBuildFunction`. * fix: respect ignoredWorkspaceStateSettings in allowBuilds stale-state check The fallback that flagged installs when allowBuilds went from unset to non-empty bypassed the ignoredSettings filter, so callers that explicitly opted out of allowBuilds tracking (via ignoredWorkspaceStateSettings) could still be forced into a redundant install. --------- Co-authored-by: Zoltan Kochan <z@kochan.io>
Closes #10528.
Summary: tracks
allowBuildsin workspace state and clears explicitly denied ignored builds.Tests: compile, workspace.state, deps.status, lifecycleScripts regression, diff check.
Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Tests