Skip to content
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

[Dependency Cache] Dependency Cache on CI per Project [without GRADLE_RO_DEP_CACHE] #135

Draft
wants to merge 7 commits into
base: trunk
Choose a base branch
from

Conversation

ParaskP7
Copy link

@ParaskP7 ParaskP7 commented Dec 19, 2024

Related: #134 + buildkite-ci#570

This change mainly adds a project prefix (BUILDKITE_PIPELINE_SLUG) to the existing gradle dependency cache key (GRADLE_DEPENDENCY_CACHE_KEY) so that to enable testing another dependency cache mechanism, but per project, WITHOUT depending on the read-only cache (GRADLE_RO_DEP_CACHE).

FYI: The rest of the optimization are done for measuring purposes (like adding the duration, cache size, etc).


  • I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary.

This is done in order to avoid having each client project adding its own
project prefix to distinguish the Gradle dependency cache key.

Test Only PR (WCAndroid): https://github.com/woocommerce/
woocommerce-android/pull/13122

For example, for WCAndroid, this would mean that instead of using this
'WOOCOMMERCE' value via this 'GRADLE_DEPENDENCY_CACHE_PROJECT_PREFIX'
environment variable, which ultimately is creating the below
'WOOCOMMERCE_GRADLE_DEPENDENCY_CACHE' key, instead, with this change the
'woocommerce-android_GRADLE_DEPENDENCY_CACHE' key will be
automatically created, taking the 'woocommerce-android' value from the
standard 'BUILDKITE_PIPELINE_SLUG' environment variable.

For more info see: p1734350857095859-slack-C020Q0Z579V
@dangermattic
Copy link

1 Warning
⚠️ Please add an entry in the CHANGELOG.md file to describe the changes made by this PR
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@ParaskP7 ParaskP7 force-pushed the gradle/isolate-dependency-cache-per-project-v2 branch 8 times, most recently from cb9972a to 5fef742 Compare December 20, 2024 15:06
1. On saving, the script will create a new folder, within the
'GRADLE_HOME' space, named 'dependency-cache', where all the contents
from 'caches/modules-2' will be copied after the build finishes.
2. On restoring, the script will create the 'caches/modules-2' folder,
within the 'GRADLE_HOME' space, and extract the saved contents into it
and before the build starts.
This is done in order to differentiate between the 'GRADLE_RO_DEP_CACHE'
and the 'GRADLE_DEP_CACHE' caches, and thus be able to test both caching
strategies in-parallel, without one overwriting the other on save, or
one reusing the other on restore.
@ParaskP7 ParaskP7 force-pushed the gradle/isolate-dependency-cache-per-project-v2 branch from 5fef742 to 84a1cb6 Compare December 20, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants