Skip to content

Commit

Permalink
Update for Gradle 8.1 release
Browse files Browse the repository at this point in the history
With Gradle 8.1, the configuration-cache has changed and is now stable. 
As a temporary measure, this commit disables save/restore of the configuration-cache
data to avoid issues until we can deal with this change properly.
  • Loading branch information
bigdaz committed Apr 14, 2023
1 parent 5056fa9 commit eb126d7
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 26 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci-full-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
with:
cache-key-prefix: ${{github.run_number}}-

restore-configuration-cache:
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
with:
cache-key-prefix: ${{github.run_number}}-
# restore-configuration-cache:
# uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
# with:
# cache-key-prefix: ${{github.run_number}}-

restore-custom-gradle-home:
uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/ci-quick-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ jobs:
runner-os: '["ubuntu-latest"]'
download-dist: true

restore-configuration-cache:
needs: build-distribution
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
with:
runner-os: '["ubuntu-latest"]'
download-dist: true
# restore-configuration-cache:
# needs: build-distribution
# uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
# with:
# runner-os: '["ubuntu-latest"]'
# download-dist: true

restore-containerized-gradle-home:
needs: build-distribution
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,10 @@ gradle-home-cache-includes: |
caches
notifications
jdks
# Exclude the local build-cache from the directories cached.
# Exclude the local build-cache and keyrings from the directories cached.
gradle-home-cache-excludes: |
caches/build-cache-1
caches/keyrings
```

You can specify any number of fixed paths or patterns to include or exclude.
Expand Down
6 changes: 2 additions & 4 deletions dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63664,7 +63664,6 @@ class GradleStateCache {
return __awaiter(this, void 0, void 0, function* () {
yield this.debugReportGradleUserHomeSize('as restored from cache');
yield new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).restore(listener);
yield new cache_extract_entries_1.ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener);
yield this.debugReportGradleUserHomeSize('after restoring common artifacts');
});
}
Expand Down Expand Up @@ -63703,8 +63702,7 @@ class GradleStateCache {
yield this.debugReportGradleUserHomeSize('before saving common artifacts');
this.deleteExcludedPaths();
yield Promise.all([
new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).extract(listener),
new cache_extract_entries_1.ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener)
new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).extract(listener)
]);
yield this.debugReportGradleUserHomeSize("after extracting common artifacts (only 'caches' and 'notifications' will be stored)");
});
Expand Down Expand Up @@ -64449,7 +64447,7 @@ const exec = __importStar(__nccwpck_require__(1514));
const crypto = __importStar(__nccwpck_require__(6113));
const path = __importStar(__nccwpck_require__(1017));
const fs = __importStar(__nccwpck_require__(7147));
const CACHE_PROTOCOL_VERSION = 'v6-';
const CACHE_PROTOCOL_VERSION = 'v7-';
const JOB_CONTEXT_PARAMETER = 'workflow-job-context';
const CACHE_DISABLED_PARAMETER = 'cache-disabled';
const CACHE_READONLY_PARAMETER = 'cache-read-only';
Expand Down
2 changes: 1 addition & 1 deletion dist/main/index.js.map

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions dist/post/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62715,7 +62715,6 @@ class GradleStateCache {
return __awaiter(this, void 0, void 0, function* () {
yield this.debugReportGradleUserHomeSize('as restored from cache');
yield new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).restore(listener);
yield new cache_extract_entries_1.ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener);
yield this.debugReportGradleUserHomeSize('after restoring common artifacts');
});
}
Expand Down Expand Up @@ -62754,8 +62753,7 @@ class GradleStateCache {
yield this.debugReportGradleUserHomeSize('before saving common artifacts');
this.deleteExcludedPaths();
yield Promise.all([
new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).extract(listener),
new cache_extract_entries_1.ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener)
new cache_extract_entries_1.GradleHomeEntryExtractor(this.gradleUserHome).extract(listener)
]);
yield this.debugReportGradleUserHomeSize("after extracting common artifacts (only 'caches' and 'notifications' will be stored)");
});
Expand Down Expand Up @@ -63500,7 +63498,7 @@ const exec = __importStar(__nccwpck_require__(1514));
const crypto = __importStar(__nccwpck_require__(6113));
const path = __importStar(__nccwpck_require__(1017));
const fs = __importStar(__nccwpck_require__(7147));
const CACHE_PROTOCOL_VERSION = 'v6-';
const CACHE_PROTOCOL_VERSION = 'v7-';
const JOB_CONTEXT_PARAMETER = 'workflow-job-context';
const CACHE_DISABLED_PARAMETER = 'cache-disabled';
const CACHE_READONLY_PARAMETER = 'cache-read-only';
Expand Down
2 changes: 1 addition & 1 deletion dist/post/index.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/cache-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import path from 'path'
import fs from 'fs'
import {CacheListener} from './cache-reporting'
import {saveCache, restoreCache, cacheDebug, isCacheDebuggingEnabled, tryDelete, generateCacheKey} from './cache-utils'
import {ConfigurationCacheEntryExtractor, GradleHomeEntryExtractor} from './cache-extract-entries'
import {GradleHomeEntryExtractor} from './cache-extract-entries'

const RESTORED_CACHE_KEY_KEY = 'restored-cache-key'

Expand Down Expand Up @@ -80,7 +80,7 @@ export class GradleStateCache {
async afterRestore(listener: CacheListener): Promise<void> {
await this.debugReportGradleUserHomeSize('as restored from cache')
await new GradleHomeEntryExtractor(this.gradleUserHome).restore(listener)
await new ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener)
// await new ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener)
await this.debugReportGradleUserHomeSize('after restoring common artifacts')
}

Expand Down Expand Up @@ -130,8 +130,8 @@ export class GradleStateCache {
await this.debugReportGradleUserHomeSize('before saving common artifacts')
this.deleteExcludedPaths()
await Promise.all([
new GradleHomeEntryExtractor(this.gradleUserHome).extract(listener),
new ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener)
new GradleHomeEntryExtractor(this.gradleUserHome).extract(listener)
// new ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener)
])
await this.debugReportGradleUserHomeSize(
"after extracting common artifacts (only 'caches' and 'notifications' will be stored)"
Expand Down
2 changes: 1 addition & 1 deletion src/cache-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import * as fs from 'fs'

import {CacheEntryListener} from './cache-reporting'

const CACHE_PROTOCOL_VERSION = 'v6-'
const CACHE_PROTOCOL_VERSION = 'v7-'

const JOB_CONTEXT_PARAMETER = 'workflow-job-context'
const CACHE_DISABLED_PARAMETER = 'cache-disabled'
Expand Down

0 comments on commit eb126d7

Please sign in to comment.