mirror of
https://github.com/gradle/gradle-build-action.git
synced 2024-11-22 17:12:51 +00:00
Improvements to cache reporting
- Avoid "Entry not saved: reason unknown" when entry was not restored - Avoid "Entry not saved: Encryption key not provided" when no config-cache data found - Avoid spurious log message when no config-cache data found
This commit is contained in:
parent
df38ec05e0
commit
93050d1483
2 changed files with 10 additions and 4 deletions
|
@ -393,7 +393,7 @@ export class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
||||||
if (cacheEntries.length > 0) {
|
if (cacheEntries.length > 0) {
|
||||||
core.info(`Not restoring configuration-cache state, as ${reason}`)
|
core.info(`Not restoring configuration-cache state, as ${reason}`)
|
||||||
for (const cacheEntry of cacheEntries) {
|
for (const cacheEntry of cacheEntries) {
|
||||||
listener.entry(cacheEntry.pattern).markNotRestored(reason).markNotSaved(reason)
|
listener.entry(cacheEntry.pattern).markNotRestored(reason)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update the results file based on no entries restored
|
// Update the results file based on no entries restored
|
||||||
|
@ -403,10 +403,13 @@ export class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
||||||
|
|
||||||
async extract(listener: CacheListener): Promise<void> {
|
async extract(listener: CacheListener): Promise<void> {
|
||||||
if (!params.getCacheEncryptionKey()) {
|
if (!params.getCacheEncryptionKey()) {
|
||||||
|
const cacheEntryDefinitions = this.getExtractedCacheEntryDefinitions()
|
||||||
|
if (cacheEntryDefinitions.length > 0) {
|
||||||
core.info('Not saving configuration-cache state, as no encryption key was provided')
|
core.info('Not saving configuration-cache state, as no encryption key was provided')
|
||||||
for (const cacheEntry of this.getExtractedCacheEntryDefinitions()) {
|
for (const cacheEntry of cacheEntryDefinitions) {
|
||||||
listener.entry(cacheEntry.pattern).markNotSaved('No encryption key provided')
|
listener.entry(cacheEntry.pattern).markNotSaved('No encryption key provided')
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -198,6 +198,9 @@ function getSavedMessage(entry: CacheEntryListener, cacheReadOnly: boolean): str
|
||||||
if (cacheReadOnly) {
|
if (cacheReadOnly) {
|
||||||
return '(Entry not saved: cache is read-only)'
|
return '(Entry not saved: cache is read-only)'
|
||||||
}
|
}
|
||||||
|
if (entry.notRestored) {
|
||||||
|
return '(Entry not saved: not restored)'
|
||||||
|
}
|
||||||
return '(Entry not saved: reason unknown)'
|
return '(Entry not saved: reason unknown)'
|
||||||
}
|
}
|
||||||
if (entry.savedSize === 0) {
|
if (entry.savedSize === 0) {
|
||||||
|
|
Loading…
Reference in a new issue