-
Notifications
You must be signed in to change notification settings - Fork 6
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] Fix Dependency Cache #138
Conversation
As part of #135 and this last 1dda7bd commit I incorrectly removed the 'DEP_CACHE_FOLDER_NAME' variable. Without this variable set, placing Gradle dependency cache is not working as expected due to the fact that this 'DEP_CACHE_FOLDER_NAME' variable is now unbound. And this makes this whole dependency cache solution not working at all.
FYI: Lint is now failing otherwise: https://buildkite.com/automattic/ ci-toolkit-buildkite-plugin/builds/ 894#01946971-8ca9-4e6b-8024-da9e25f85121 PS: I wasn't aware about this process and thus missed updating both, the 'README' and 'CHANGELOG' with 3.9.0 release info after merging #135 by creating a separate 'release/3.9.0' branch and PR for release purposes. Instead, I just went and drafted a new release directly from GitHub and the project's releases' page. Example Release Process Related PR: https://github.com/Automattic/ a8c-ci-toolkit-buildkite-plugin/pull/137
FYI: This change is done for testing purposes and until the below 'A8C CI Toolkit' #138 PR gets merged to 'trunk'. When that's done, the 'a8c-ci-toolkit' will be updated to '3.9.1' instead. A8C CI Toolkit PR: [Dependency Cache] Fix Dependency Cache #138 - Automattic/a8c-ci-toolkit-buildkite-plugin#138
README.md
Outdated
@@ -26,7 +26,7 @@ steps: | |||
restore_cache $(hash_file package-lock.json) | |||
|
|||
plugins: | |||
- automattic/a8c-ci-toolkit#3.8.0: | |||
- automattic/a8c-ci-toolkit#3.9.0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see a 3.9.0
release already in the repo, perhaps it was created too early? Indeed it's best to make a new release following https://github.com/Automattic/a8c-ci-toolkit-buildkite-plugin?tab=readme-ov-file#releasing. Perhaps you can delete that one with its tag as well? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I feel like it should be 3.9.1
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe even this should be unchanged in this PR, and only bumped in the release PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe even this should be unchanged in this PR, and only bumped in the release PR?
Lint fails otherwise, and actually @AliSoftware did the same on this #139 that just got merged (plus this). 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
…e-plugin into gradle/fix-dependency-cache
Release Notes: https://github.com/Automattic/ a8c-ci-toolkit-buildkite-plugin/releases/tag/3.9.1 FYI: This change points to that version of the 'A8C CI Toolkit' where both, the #135 and #138 PRs, are merged into 'trunk', and, the new dependency cache mechanism, per project, without 'GRADLE_RO_DEP_CACHE', is fully operational. A8C CI Toolkit #135 PR: [Dependency Cache] Dependency Cache on CI per Project [without GRADLE_RO_DEP_CACHE] #135 - Automattic/a8c-ci-toolkit-buildkite-plugin#135 A8C CI Toolkit #138 PR: [Dependency Cache] Fix Dependency Cache #138 - Automattic/a8c-ci-toolkit-buildkite-plugin#138
* CI: Update a8c-ci-toolkit to 3.9.1 Release Notes: https://github.com/Automattic/ a8c-ci-toolkit-buildkite-plugin/releases/tag/3.9.1 FYI: This change points to that version of the 'A8C CI Toolkit' where both, the #135 and #138 PRs, are merged into 'trunk', and, the new dependency cache mechanism, per project, without 'GRADLE_RO_DEP_CACHE', is fully operational. A8C CI Toolkit #135 PR: [Dependency Cache] Dependency Cache on CI per Project [without GRADLE_RO_DEP_CACHE] #135 - Automattic/a8c-ci-toolkit-buildkite-plugin#135 A8C CI Toolkit #138 PR: [Dependency Cache] Fix Dependency Cache #138 - Automattic/a8c-ci-toolkit-buildkite-plugin#138 * CI: Add a scheduled dependency cache job (save cache) FYI: This job will be then used by 'buildkite-ci' and configured as a 'buildkite_pipeline_schedule' with a weekly frequency. PS.1: The targeted 'pipeline' related jobs are: - Mobile App - Lint - Unit Tests - Android tests PS.2: Since the 'WordPress' app is being build from the very same codebase as the 'Jetpack' app, targeting only the 'Jetpack' related 'pipeline' jobs are enough to download and cache all the dependencies required for both apps. * CI: Fix wrongly defined command related double quotes on pipeline jobs Otherwise, using 'multi-cmd' will produce 'no such file or directory' type of errors. * CI: Add restore cache and run on targeted pipeline related jobs only FYI: The targeted 'pipeline' related jobs are: - Mobile App - Lint - Unit Tests - Android Tests (Commented Out) PS.1: The 'detekt' and 'checkstyle' jobs aren't targeted because they only take about 30+ seconds of network request to download all the dependencies needed for those specific jobs, which is about the same time it takes for the dependency cache to actually be restored (20+ seconds). Thus, this optimization is not really worth it for these specific jobs. For all those other jobs targeted, it take more than a minute of network requests to download all the dependencies needed, and as such worth the diff is worth it. PS.2: Although the 'Android Tests' are commented-out, I chose to include cache restoration into those as well, just in case they will be reactivated at some point in the future. * CI: Move restore cache call to individual .sh script files WCAndroid PR Comment: https://github.com/woocommerce/ woocommerce-android/pull/13303#discussion_r1916752265 * CI: Fix wrongly defined command related double quotes on pipeline jobs When using 'single-cmd' and not using this double quotes structure it is is producing 'did not find expected key' type of errors. * Docs: Add gradlew test suite to comment on save cache for unit tests
Release Notes: https://github.com/Automattic/ a8c-ci-toolkit-buildkite-plugin/releases/tag/3.9.1 FYI: This change points to that version of the 'A8C CI Toolkit' where both, the #135 and #138 PRs, are merged into 'trunk', and, the new dependency cache mechanism, per project, without 'GRADLE_RO_DEP_CACHE', is fully operational. A8C CI Toolkit #135 PR: [Dependency Cache] Dependency Cache on CI per Project [without GRADLE_RO_DEP_CACHE] #135 - Automattic/a8c-ci-toolkit-buildkite-plugin#135 A8C CI Toolkit #138 PR: [Dependency Cache] Fix Dependency Cache #138 - Automattic/a8c-ci-toolkit-buildkite-plugin#138
* Gradle: Fix dependency cache As part of #135 and this last 1dda7bd commit I incorrectly removed the 'DEP_CACHE_FOLDER_NAME' variable. Without this variable set, placing Gradle dependency cache is not working as expected due to the fact that this 'DEP_CACHE_FOLDER_NAME' variable is now unbound. And this makes this whole dependency cache solution not working at all. * Release: Update `README` and `CHANGELOG` with 3.9.0 release info (#135) FYI: Lint is now failing otherwise: https://buildkite.com/automattic/ ci-toolkit-buildkite-plugin/builds/ 894#01946971-8ca9-4e6b-8024-da9e25f85121 PS: I wasn't aware about this process and thus missed updating both, the 'README' and 'CHANGELOG' with 3.9.0 release info after merging #135 by creating a separate 'release/3.9.0' branch and PR for release purposes. Instead, I just went and drafted a new release directly from GitHub and the project's releases' page. Example Release Process Related PR: https://github.com/Automattic/ a8c-ci-toolkit-buildkite-plugin/pull/137 * Release: Add 'CHANGELOG' entry
Related: #135
Description
As part of #135 and this last 1dda7bd commit I incorrectly removed the
DEP_CACHE_FOLDER_NAME
variable. Without this variable set, placing Gradle dependency cache is not working as expected due to the fact that thisDEP_CACHE_FOLDER_NAME
variable is now unbound. And this makes this whole dependency cache solution not working at all.Testing Instructions
Base on this WCAndroid##13303 PR and this test commit, looking at its corresponding build:
Mobile App
) the cache is being placed as expected.Mobile App
), make sure that the network activity is minimal and close to zero (ie.Wall clock time spent on network requests | 0s
.CHANGELOG.md
if necessary.