8000 Update Cache Error Message for Improved Clarity by aparnajyothi-y · Pull Request #947 · actions/setup-python · GitHub
[go: up one dir, main page]

Skip to content

Update Cache Error Message for Improved Clarity #947

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

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
updated error message
  • Loading branch information
aparnajyothi-y committed Sep 20, 2024
commit b9a674e48d5e8d016b8f1d6e5d2ddb34bf9ea59d
4 changes: 2 additions & 2 deletions dist/cache-save/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81041,7 +81041,7 @@ class CacheDistributor {
.split('\n')
.join(',')} or ${constants_1.CACHE_DEPENDENCY_BACKUP_PATH}`
: this.cacheDependencyPath.split('\n').join(',');
throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`);
throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository. No cache paths were identified for ${this.packageManager} with cache-dependency-path = ${this.cacheDependencyPath}. This likely indicates no dependencies to cache. Consider removing the cache step if it's not needed`);
}
const cachePath = yield this.getCacheGlobalDirectories();
core.saveState(State.CACHE_PATHS, cachePath);
Expand Down Expand Up @@ -81165,7 +81165,7 @@ function saveCache(packageManager) {
const cachePaths = JSON.parse(cachePathState);
core.debug(`paths for caching are ${cachePaths.join(', ')}`);
if (!isCacheDirectoryExists(cachePaths)) {
throw new Error(`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(', ')}`);
throw new Error(`No file in ${process.cwd()} matched to [${cachePaths.join(', ')}], make sure you have checked out the target repository. No cache paths were identified for ${packageManager} with cache-dependency-path. This likely indicates no dependencies to cache. Consider removing the cache step if it's not needed.`);
}
const primaryKey = core.getState(cache_distributor_1.State.STATE_CACHE_PRIMARY_KEY);
const matchedKey = core.getState(cache_distributor_1.State.CACHE_MATCHED_KEY);
Expand Down
2 changes: 1 addition & 1 deletion dist/setup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90243,7 +90243,7 @@ class CacheDistributor {
.split('\n')
.join(',')} or ${constants_1.CACHE_DEPENDENCY_BACKUP_PATH}`
: this.cacheDependencyPath.split('\n').join(',');
throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`);
throw new Error(`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository. No cache paths were identified for ${this.packageManager} with cache-dependency-path = ${this.cacheDependencyPath}. This likely indicates no dependencies to cache. Consider removing the cache step if it's not needed`);
}
const cachePath = yield this.getCacheGlobalDirectories();
core.saveState(State.CACHE_PATHS, cachePath);
Expand Down
6 changes: 5 additions & 1 deletion src/cache-distributions/cache-distributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ abstract class CacheDistributor {
.join(',')} or ${CACHE_DEPENDENCY_BACKUP_PATH}`
: this.cacheDependencyPath.split('\n').join(',');
throw new Error(
`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository`
`No file in ${process.cwd()} matched to [${file}], make sure you have checked out the target repository. No cache paths were identified for ${
this.packageManager
} with cache-dependency-path = ${
this.cacheDependencyPath
}. This likely indicates no dependencies to cache. Consider removing the cache step if it's not needed`
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/cache-save.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ async function saveCache(packageManager: string) {

if (!isCacheDirectoryExists(cachePaths)) {
throw new Error(
`Cache folder path is retrieved for ${packageManager} but doesn't exist on disk: ${cachePaths.join(
`No file in ${process.cwd()} matched to [${cachePaths.join(
', '
)}`
)}], make sure you have checked out the target repository. No cache paths were identified for ${packageManager} with cache-dependency-path. This likely indicates no dependencies to cache. Consider removing the cache step if it's not needed.`
);
}

Expand Down
413A Loading
0