Skip to content

Commit 704de4d

Browse files
committed
refactor(project): Enhance build cache logging for signatures
1 parent 8af8a75 commit 704de4d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/project/lib/build/cache/ProjectBuildCache.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ export default class ProjectBuildCache {
6464

6565
#combinedIndexState = INDEX_STATES.RESTORING_PROJECT_INDICES;
6666
#resultCacheState = RESULT_CACHE_STATES.PENDING_VALIDATION;
67-
// #dependencyIndicesInitialized = false;
6867

6968
/**
7069
* Creates a new ProjectBuildCache instance
@@ -547,7 +546,7 @@ export default class ProjectBuildCache {
547546
if (!stageMetadata) {
548547
return;
549548
}
550-
log.verbose(`Found cached stage with signature ${stageSignature}`);
549+
log.verbose(`Found cached stage for task ${stageName} with signature ${stageSignature}`);
551550
const {resourceMapping, resourceMetadata, projectTagOperations, buildTagOperations} = stageMetadata;
552551
let writtenResourcePaths;
553552
let stageReader;
@@ -854,6 +853,9 @@ export default class ProjectBuildCache {
854853
this.#sourceIndex = await ResourceIndex.create(resources, Date.now());
855854
this.#combinedIndexState = INDEX_STATES.INITIAL;
856855
}
856+
log.verbose(
857+
`Initialized source index for project ${this.#project.getName()} ` +
858+
`with signature ${this.#sourceIndex.getSignature()}`);
857859
}
858860

859861
/**
@@ -880,7 +882,8 @@ export default class ProjectBuildCache {
880882

881883
if (removed.length || added.length || updated.length) {
882884
log.verbose(`Source resource index for project ${this.#project.getName()} updated: ` +
883-
`${removed.length} removed, ${added.length} added, ${updated.length} updated resources.`);
885+
`${removed.length} removed, ${added.length} added, ${updated.length} updated resources. ` +
886+
`New signature: ${this.#sourceIndex.getSignature()}`);
884887
const changedPaths = [...removed, ...added, ...updated];
885888
// Since all source files are part of the result, declare any detected changes as newly written resources
886889
for (const resourcePath of changedPaths) {
@@ -936,7 +939,8 @@ export default class ProjectBuildCache {
936939
// No changes to already cached result stage
937940
return;
938941
}
939-
log.verbose(`Storing result metadata for project ${this.#project.getName()}`);
942+
log.verbose(`Storing result metadata for project ${this.#project.getName()} ` +
943+
`using result stage signature ${stageSignature}`);
940944
const stageSignatures = Object.create(null);
941945
for (const [stageName, stageSigs] of this.#currentStageSignatures.entries()) {
942946
stageSignatures[stageName] = stageSigs.join("-");

0 commit comments

Comments
 (0)