Skip to content

Commit

Permalink
NO-ISSUE: CI partitioning script was leaving out the last package (#2647
Browse files Browse the repository at this point in the history
)
  • Loading branch information
thiagoelg authored Oct 4, 2024
1 parent a622435 commit fdb7c5d
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async function getPartitions(): Promise<Array<None | Full | Partial>> {
const chunkSize = 50;
for (let i = 0; i < changedPackagesNames.length; i += chunkSize) {
changedPackagesNamesChunks.push(
changedPackagesNames.slice(i, Math.min(i + chunkSize, changedPackagesNames.length - 1))
changedPackagesNames.slice(i, Math.min(i + chunkSize, changedPackagesNames.length))
);
}

Expand Down Expand Up @@ -215,7 +215,7 @@ async function getPartitions(): Promise<Array<None | Full | Partial>> {
}

const changedSourcePathsInPartition = changedPackagesDirs.filter((path) =>
[...partition.dirs].some((partitionDir) => path.startsWith(`${partitionDir}`))
[...partition.dirs].some((partitionDir) => path === partitionDir)
);

if (changedSourcePathsInPartition.length === 0) {
Expand Down Expand Up @@ -268,6 +268,9 @@ async function getPartitions(): Promise<Array<None | Full | Partial>> {
}

async function getDirsOfDependencies(leafPackageNames: Set<string>) {
if (leafPackageNames.size === 0) {
return new Set<string>();
}
const packagesFilter = [...leafPackageNames].map((pkgName) => `-F ${pkgName}...`).join(" ");
return new Set(
stdoutArray(execSync(`bash -c "pnpm ${packagesFilter} exec bash -c pwd"`).toString()) //
Expand Down

0 comments on commit fdb7c5d

Please sign in to comment.