Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 25e9b4d

Browse files
committed
Build outputs
1 parent b49446f commit 25e9b4d

File tree

4 files changed

+94
-62
lines changed

4 files changed

+94
-62
lines changed

dist/main/index.js

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,17 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
115115
core.info('Cache restored successfully');
116116
return restoredEntry;
117117
}
118-
catch (error) {
119-
const typedError = error;
120-
if (typedError.name === ValidationError.name) {
121-
throw error;
122-
}
123-
else {
124-
// Supress all non-validation cache related errors because caching should be optional
125-
core.warning(`Failed to restore: ${error.message}`);
126-
}
127-
}
118+
// PATCH: Error handling is done in action code, allowing us to provide better reporting
119+
// catch (error) {
120+
// const typedError = error;
121+
// if (typedError.name === ValidationError.name) {
122+
// throw error;
123+
// }
124+
// else {
125+
// // Supress all non-validation cache related errors because caching should be optional
126+
// core.warning(`Failed to restore: ${error.message}`);
127+
// }
128+
// }
128129
finally {
129130
// Try to delete the archive to save space
130131
try {
@@ -193,18 +194,19 @@ function saveCache(paths, key, options) {
193194
core.debug(`Saving Cache (ID: ${cacheId})`);
194195
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
195196
}
196-
catch (error) {
197-
const typedError = error;
198-
if (typedError.name === ValidationError.name) {
199-
throw error;
200-
}
201-
else if (typedError.name === ReserveCacheError.name) {
202-
core.info(`Failed to save: ${typedError.message}`);
203-
}
204-
else {
205-
core.warning(`Failed to save: ${typedError.message}`);
206-
}
207-
}
197+
// PATCH: Error handling is done in action code, allowing us to provide better reporting
198+
// catch (error) {
199+
// const typedError = error;
200+
// if (typedError.name === ValidationError.name) {
201+
// throw error;
202+
// }
203+
// else if (typedError.name === ReserveCacheError.name) {
204+
// core.info(`Failed to save: ${typedError.message}`);
205+
// }
206+
// else {
207+
// core.warning(`Failed to save: ${typedError.message}`);
208+
// }
209+
// }
208210
finally {
209211
// Try to delete the archive to save space
210212
try {
@@ -65745,10 +65747,10 @@ class GradleStateCache {
6574565747
core.info(`Cache hit occurred on the cache key ${cacheKey}, not saving cache.`);
6574665748
for (const entryListener of listener.cacheEntries) {
6574765749
if (entryListener === gradleHomeEntryListener) {
65748-
entryListener.markUnsaved('cache key not changed');
65750+
entryListener.markNotSaved('cache key not changed');
6574965751
}
6575065752
else {
65751-
entryListener.markUnsaved(`referencing '${this.cacheDescription}' cache entry not saved`);
65753+
entryListener.markNotSaved(`referencing '${this.cacheDescription}' cache entry not saved`);
6575265754
}
6575365755
}
6575465756
return;
@@ -65992,7 +65994,7 @@ class AbstractEntryExtractor {
6599265994
const previouslyRestoredKey = (_a = previouslyRestoredEntries.find(x => x.artifactType === artifactType && x.pattern === pattern)) === null || _a === void 0 ? void 0 : _a.cacheKey;
6599365995
if (previouslyRestoredKey === cacheKey) {
6599465996
(0, cache_utils_1.cacheDebug)(`No change to previously restored ${artifactType}. Not saving.`);
65995-
entryListener.markUnsaved('contents unchanged');
65997+
entryListener.markNotSaved('contents unchanged');
6599665998
}
6599765999
else {
6599866000
core.info(`Caching ${artifactType} with path '${pattern}' and cache key: ${cacheKey}`);
@@ -66230,6 +66232,10 @@ class CacheEntryListener {
6623066232
this.restoredSize = size;
6623166233
return this;
6623266234
}
66235+
markNotRestored(message) {
66236+
this.notRestored = message;
66237+
return this;
66238+
}
6623366239
markSaved(key, size) {
6623466240
this.savedKey = key;
6623566241
this.savedSize = size;
@@ -66240,8 +66246,8 @@ class CacheEntryListener {
6624066246
this.savedSize = 0;
6624166247
return this;
6624266248
}
66243-
markUnsaved(message) {
66244-
this.unsaved = message;
66249+
markNotSaved(message) {
66250+
this.notSaved = message;
6624566251
return this;
6624666252
}
6624766253
}
@@ -66294,9 +66300,15 @@ function renderEntryDetails(listener) {
6629466300
.join('---\n');
6629566301
}
6629666302
function getRestoredMessage(entry, cacheWriteOnly) {
66303+
if (entry.notRestored) {
66304+
return `(Entry not restored: ${entry.notRestored})`;
66305+
}
6629766306
if (cacheWriteOnly) {
6629866307
return '(Entry not restored: cache is write-only)';
6629966308
}
66309+
if (entry.requestedKey === undefined) {
66310+
return '(Entry not restored: not requested)';
66311+
}
6630066312
if (entry.restoredKey === undefined) {
6630166313
return '(Entry not restored: no match found)';
6630266314
}
@@ -66306,8 +66318,8 @@ function getRestoredMessage(entry, cacheWriteOnly) {
6630666318
return '(Entry restored: partial match found)';
6630766319
}
6630866320
function getSavedMessage(entry, cacheReadOnly) {
66309-
if (entry.unsaved) {
66310-
return `(Entry not saved: ${entry.unsaved})`;
66321+
if (entry.notSaved) {
66322+
return `(Entry not saved: ${entry.notSaved})`;
6631166323
}
6631266324
if (entry.savedKey === undefined) {
6631366325
if (cacheReadOnly) {
@@ -66321,7 +66333,7 @@ function getSavedMessage(entry, cacheReadOnly) {
6632166333
return '(Entry saved)';
6632266334
}
6632366335
function getCount(cacheEntries, predicate) {
66324-
return cacheEntries.filter(e => predicate(e) !== undefined).length;
66336+
return cacheEntries.filter(e => predicate(e)).length;
6632566337
}
6632666338
function getSize(cacheEntries, predicate) {
6632766339
const bytes = cacheEntries.map(e => { var _a; return (_a = predicate(e)) !== null && _a !== void 0 ? _a : 0; }).reduce((p, v) => p + v, 0);
@@ -66478,6 +66490,7 @@ function restoreCache(cachePath, cacheKey, cacheRestoreKeys, listener) {
6647866490
return restoredEntry;
6647966491
}
6648066492
catch (error) {
66493+
listener.markNotRestored(error.message);
6648166494
handleCacheFailure(error, `Failed to restore ${cacheKey}`);
6648266495
return undefined;
6648366496
}
@@ -66494,6 +66507,9 @@ function saveCache(cachePath, cacheKey, listener) {
6649466507
if (error instanceof cache.ReserveCacheError) {
6649566508
listener.markAlreadyExists(cacheKey);
6649666509
}
66510+
else {
66511+
listener.markNotSaved(error.message);
66512+
}
6649766513
handleCacheFailure(error, `Failed to save cache entry with path '${cachePath}' and key: ${cacheKey}`);
6649866514
}
6649966515
});

dist/main/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/post/index.js

Lines changed: 46 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,17 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
115115
core.info('Cache restored successfully');
116116
return restoredEntry;
117117
}
118-
catch (error) {
119-
const typedError = error;
120-
if (typedError.name === ValidationError.name) {
121-
throw error;
122-
}
123-
else {
124-
// Supress all non-validation cache related errors because caching should be optional
125-
core.warning(`Failed to restore: ${error.message}`);
126-
}
127-
}
118+
// PATCH: Error handling is done in action code, allowing us to provide better reporting
119+
// catch (error) {
120+
// const typedError = error;
121+
// if (typedError.name === ValidationError.name) {
122+
// throw error;
123+
// }
124+
// else {
125+
// // Supress all non-validation cache related errors because caching should be optional
126+
// core.warning(`Failed to restore: ${error.message}`);
127+
// }
128+
// }
128129
finally {
129130
// Try to delete the archive to save space
130131
try {
@@ -193,18 +194,19 @@ function saveCache(paths, key, options) {
193194
core.debug(`Saving Cache (ID: ${cacheId})`);
194195
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
195196
}
196-
catch (error) {
197-
const typedError = error;
198-
if (typedError.name === ValidationError.name) {
199-
throw error;
200-
}
201-
else if (typedError.name === ReserveCacheError.name) {
202-
core.info(`Failed to save: ${typedError.message}`);
203-
}
204-
else {
205-
core.warning(`Failed to save: ${typedError.message}`);
206-
}
207-
}
197+
// PATCH: Error handling is done in action code, allowing us to provide better reporting
198+
// catch (error) {
199+
// const typedError = error;
200+
// if (typedError.name === ValidationError.name) {
201+
// throw error;
202+
// }
203+
// else if (typedError.name === ReserveCacheError.name) {
204+
// core.info(`Failed to save: ${typedError.message}`);
205+
// }
206+
// else {
207+
// core.warning(`Failed to save: ${typedError.message}`);
208+
// }
209+
// }
208210
finally {
209211
// Try to delete the archive to save space
210212
try {
@@ -64796,10 +64798,10 @@ class GradleStateCache {
6479664798
core.info(`Cache hit occurred on the cache key ${cacheKey}, not saving cache.`);
6479764799
for (const entryListener of listener.cacheEntries) {
6479864800
if (entryListener === gradleHomeEntryListener) {
64799-
entryListener.markUnsaved('cache key not changed');
64801+
entryListener.markNotSaved('cache key not changed');
6480064802
}
6480164803
else {
64802-
entryListener.markUnsaved(`referencing '${this.cacheDescription}' cache entry not saved`);
64804+
entryListener.markNotSaved(`referencing '${this.cacheDescription}' cache entry not saved`);
6480364805
}
6480464806
}
6480564807
return;
@@ -65043,7 +65045,7 @@ class AbstractEntryExtractor {
6504365045
const previouslyRestoredKey = (_a = previouslyRestoredEntries.find(x => x.artifactType === artifactType && x.pattern === pattern)) === null || _a === void 0 ? void 0 : _a.cacheKey;
6504465046
if (previouslyRestoredKey === cacheKey) {
6504565047
(0, cache_utils_1.cacheDebug)(`No change to previously restored ${artifactType}. Not saving.`);
65046-
entryListener.markUnsaved('contents unchanged');
65048+
entryListener.markNotSaved('contents unchanged');
6504765049
}
6504865050
else {
6504965051
core.info(`Caching ${artifactType} with path '${pattern}' and cache key: ${cacheKey}`);
@@ -65281,6 +65283,10 @@ class CacheEntryListener {
6528165283
this.restoredSize = size;
6528265284
return this;
6528365285
}
65286+
markNotRestored(message) {
65287+
this.notRestored = message;
65288+
return this;
65289+
}
6528465290
markSaved(key, size) {
6528565291
this.savedKey = key;
6528665292
this.savedSize = size;
@@ -65291,8 +65297,8 @@ class CacheEntryListener {
6529165297
this.savedSize = 0;
6529265298
return this;
6529365299
}
65294-
markUnsaved(message) {
65295-
this.unsaved = message;
65300+
markNotSaved(message) {
65301+
this.notSaved = message;
6529665302
return this;
6529765303
}
6529865304
}
@@ -65345,9 +65351,15 @@ function renderEntryDetails(listener) {
6534565351
.join('---\n');
6534665352
}
6534765353
function getRestoredMessage(entry, cacheWriteOnly) {
65354+
if (entry.notRestored) {
65355+
return `(Entry not restored: ${entry.notRestored})`;
65356+
}
6534865357
if (cacheWriteOnly) {
6534965358
return '(Entry not restored: cache is write-only)';
6535065359
}
65360+
if (entry.requestedKey === undefined) {
65361+
return '(Entry not restored: not requested)';
65362+
}
6535165363
if (entry.restoredKey === undefined) {
6535265364
return '(Entry not restored: no match found)';
6535365365
}
@@ -65357,8 +65369,8 @@ function getRestoredMessage(entry, cacheWriteOnly) {
6535765369
return '(Entry restored: partial match found)';
6535865370
}
6535965371
function getSavedMessage(entry, cacheReadOnly) {
65360-
if (entry.unsaved) {
65361-
return `(Entry not saved: ${entry.unsaved})`;
65372+
if (entry.notSaved) {
65373+
return `(Entry not saved: ${entry.notSaved})`;
6536265374
}
6536365375
if (entry.savedKey === undefined) {
6536465376
if (cacheReadOnly) {
@@ -65372,7 +65384,7 @@ function getSavedMessage(entry, cacheReadOnly) {
6537265384
return '(Entry saved)';
6537365385
}
6537465386
function getCount(cacheEntries, predicate) {
65375-
return cacheEntries.filter(e => predicate(e) !== undefined).length;
65387+
return cacheEntries.filter(e => predicate(e)).length;
6537665388
}
6537765389
function getSize(cacheEntries, predicate) {
6537865390
const bytes = cacheEntries.map(e => { var _a; return (_a = predicate(e)) !== null && _a !== void 0 ? _a : 0; }).reduce((p, v) => p + v, 0);
@@ -65529,6 +65541,7 @@ function restoreCache(cachePath, cacheKey, cacheRestoreKeys, listener) {
6552965541
return restoredEntry;
6553065542
}
6553165543
catch (error) {
65544+
listener.markNotRestored(error.message);
6553265545
handleCacheFailure(error, `Failed to restore ${cacheKey}`);
6553365546
return undefined;
6553465547
}
@@ -65545,6 +65558,9 @@ function saveCache(cachePath, cacheKey, listener) {
6554565558
if (error instanceof cache.ReserveCacheError) {
6554665559
listener.markAlreadyExists(cacheKey);
6554765560
}
65561+
else {
65562+
listener.markNotSaved(error.message);
65563+
}
6554865564
handleCacheFailure(error, `Failed to save cache entry with path '${cachePath}' and key: ${cacheKey}`);
6554965565
}
6555065566
});

dist/post/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)