Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rush] Fix build cache ids when "enableSubpathScan" is enabled #5045

Merged
merged 1 commit into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "Fix an issue with the `enableSubpathScan` experiment where the set of returned hashes would result in incorrect build cache identifiers when using `--only`.",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,12 @@ export class PhasedScriptAction extends BaseScriptAction<IPhasedCommandConfig> {

const analyzer: ProjectChangeAnalyzer = new ProjectChangeAnalyzer(this.rushConfiguration);
const getInputsSnapshotAsync: GetInputsSnapshotAsyncFn | undefined =
await analyzer._tryGetSnapshotProviderAsync(projectConfigurations, terminal, projectSelection);
await analyzer._tryGetSnapshotProviderAsync(
projectConfigurations,
terminal,
// We need to include all dependencies, otherwise build cache id calculation will be incorrect
Selection.expandAllDependencies(projectSelection)
);
const initialSnapshot: IInputsSnapshot | undefined = await getInputsSnapshotAsync?.();

repoStateStopwatch.stop();
Expand Down
3 changes: 2 additions & 1 deletion libraries/rush-lib/src/logic/ProjectChangeAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,10 @@ export class ProjectChangeAnalyzer {

if (
projectSelection &&
projectSelection.size > 0 &&
this._rushConfiguration.experimentsConfiguration.configuration.enableSubpathScan
) {
filterPath = Array.from(projectSelection).map(({ projectFolder }) => projectFolder);
filterPath = Array.from(projectSelection, ({ projectFolder }) => projectFolder);
}

return async function tryGetSnapshotAsync(): Promise<IInputsSnapshot | undefined> {
Expand Down
Loading