Skip to content

Commit aebf062

Browse files
Sort inherited and legacy folders so remap plans are deterministic
Folder observations come back in database order, which differs between stores and runners; CI saw the two linked worktrees in the opposite order from the fixture's expectation. Co-authored-by: Alfonso <alfonso-magic-context@users.noreply.github.com>
1 parent d50318c commit aebf062

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎packages/cli/src/commands/doctor-project-ids.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ export async function buildProjectIdPlan(
214214
});
215215
else staysOnLegacy.push({ directory: folder.directory, reason: "implicit" });
216216
}
217+
// Folder observations come back in database order, which varies between
218+
// stores; sort so the same store always produces byte-identical plans.
219+
const byDirectory = (a: { directory: string }, b: { directory: string }) =>
220+
a.directory < b.directory ? -1 : a.directory > b.directory ? 1 : 0;
221+
inherited.sort(byDirectory);
222+
staysOnLegacy.sort(byDirectory);
217223
candidates.set(from, {
218224
from,
219225
to,

0 commit comments

Comments
 (0)