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] Use Custom Init Gradle Task to Download Dependencies #21610

Merged

Conversation

ParaskP7
Copy link
Contributor

@ParaskP7 ParaskP7 commented Jan 24, 2025

Project Thread: paaHJt-7CE-p2
Test PR: #21609
Depends On: buildkite-ci#585


Description

This PR uses the custom init.gradle.kts related file, defined within the Android AMI itself (see buildkite-ci#585), which now contains this custom downloadDependencies task.

With this change, instead of individually calling a number of assemble/lint related tasks to download as many dependencies as possible prior to saving the cache, any project can now utilize this globally defined downloadDependencies task to replace all this boilerplate and streamline the overall dependency cache process.

Notably, with this change, the dependency cache process:

  1. Will no longer be broken on issues like this, making the process more robust.
  2. Will no longer require an associated entry save-cache.sh entry (example) for newly defined jobs/commands, making the process more maintainable.
  3. Will no longer have any missing dependencies that would require extra network activity, making the process faster (just a second or two, but faster nevertheless).
  4. Will no longer take a significant amount of time to save the cache, as it will no longer run any assemble/lint tasks, just that single downloadDependencies task, making the build process faster (for scheduled builds).

To Test:

Just verify the below:

  1. Triggering schedules/dependency-cache.yml manually via this build:
  2. CI is working as expected:

Note

The only drawback to this change, but an expected one, is that the size of the dependency cache is considerably bigger than before, 1573.37 MB now, 1076.74 before, which is more than 500 MB a diff, and this makes the cache restoration a few seconds slower (20s before, 30s now, ish). Having said that, we believe that the low cost of maintaining the cache saving process is worth the extra seconds (context).


Merge Instructions


Regression Notes

  1. Potential unintended areas of impact

    • CI builds failing or slower than expected.
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • See To Test section above.
  3. What automated tests I added (or what prevented me from doing so)

    • N/A

PR Submission Checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing Checklist (strike-out the not-applying and unnecessary ones): N/A

@ParaskP7 ParaskP7 added Core Tooling Do Not Merge In PRs with this label, our automation will fail a require check, preventing accidental merging labels Jan 24, 2025
@ParaskP7 ParaskP7 added this to the Future milestone Jan 24, 2025
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 24, 2025

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr21610-be296d2
Commitbe296d2
Direct Downloadwordpress-prototype-build-pr21610-be296d2.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 24, 2025

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr21610-be296d2
Commitbe296d2
Direct Downloadjetpack-prototype-build-pr21610-be296d2.apk
Note: Google Login is not supported on these builds.

This custom 'downloadDependencies' task is part of the Android AMI,
that is utilized by the 'android' agents, and it is becoming available
to all project via the 'init.gradle.kts' script that is included in it.
@ParaskP7 ParaskP7 force-pushed the ci/use-custom-init-gradle-task-to-download-dependencies branch from ed9d74f to 6d74fe5 Compare January 28, 2025 12:11
@nbradbury nbradbury closed this Jan 28, 2025
@nbradbury nbradbury deleted the ci/use-custom-init-gradle-task-to-download-dependencies branch January 28, 2025 19:52
@ParaskP7 ParaskP7 restored the ci/use-custom-init-gradle-task-to-download-dependencies branch January 29, 2025 08:40
@ParaskP7 ParaskP7 reopened this Jan 29, 2025
@ParaskP7
Copy link
Contributor Author

ParaskP7 commented Jan 29, 2025

👋 @nbradbury , I am not sure why this and its accompanying test #21609 PR got closed, it being a work-in-progress PR, so I just restored the branch and reopened it. Let me know if I am missing something. 🙏

FYI: About the accompanying test #21609 PR I can keep this closed, we are done with testing it. I would have closed that after merging this PR, but doing that now doesn't hurt.

… into ci/use-custom-init-gradle-task-to-download-dependencies
@nbradbury
Copy link
Contributor

I am not sure why this and its accompanying test #21609 PR got closed

Apologies @ParaskP7 . I was cleaning up stale branches yesterday and apparently got rid of more than I intended!

… into ci/use-custom-init-gradle-task-to-download-dependencies
@ParaskP7 ParaskP7 removed the Do Not Merge In PRs with this label, our automation will fail a require check, preventing accidental merging label Jan 29, 2025
@ParaskP7 ParaskP7 marked this pull request as ready for review January 29, 2025 14:56
@ParaskP7 ParaskP7 requested a review from wzieba January 29, 2025 14:56
@ParaskP7 ParaskP7 merged commit 10d605c into trunk Jan 30, 2025
32 checks passed
@ParaskP7 ParaskP7 deleted the ci/use-custom-init-gradle-task-to-download-dependencies branch January 30, 2025 09:10
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.

4 participants