feat(update): implement approved update flow - #56
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
| ? [path.resolve(configured)] | ||
| : [path.resolve(cacheBase, configured), path.resolve(path.dirname(configPath), configured)] | ||
| const selected = candidates.find((candidate) => isSameOrContained(candidate, cacheBase) && existsSync(candidate)) | ||
| if (selected) return selected |
There was a problem hiding this comment.
return undefined here exits the loop on the first configured key whose candidates fail the containment/exists check, so a missed path never falls through to installPath or cachePath. That makes a valid later key unreachable when an earlier key resolves outside the cache base. Should be continue (and return only after the loop) so subsequent keys are still tried.
|
|
||
| const timer = setTimeout(() => { | ||
| timedOut = true | ||
| child.kill('SIGTERM') |
There was a problem hiding this comment.
Killing only the direct child with SIGTERM/SIGKILL leaves any subprocesses it spawned (npm/node trees) running in their own process group, so the command can be reported as timed out while a grandchild keeps working in the background. Spawning detached and killing the whole group (process.kill(-pid, ...)) would avoid the orphaned subprocess.
| const packageRoots: string[] = [] | ||
| const hasUserCanonical = matching.some((entry) => entry.scope === 'user' && entry.canonical) | ||
| const hasProjectCanonical = matching.some((entry) => entry.scope === 'project' && entry.canonical) | ||
| const invalid = matching.find((entry) => !entry.canonical) |
There was a problem hiding this comment.
A single non-canonical Pi entry in any scope makes invalid truthy and downgrades the whole installation to unsupported, so a perfectly healthy canonical user (or project) scope can never be updated just because the other scope pins a git/pinned source. Treating each scope independently would let the healthy scope update instead of failing all of them.
No description provided.