Repository navigation
RUM-18975: Speed up PR builds - #3995
aleksandr-gringauz wants to merge 1 commit into
Conversation
|
✅ All CI checks and tests passed. Datadog automation helped this PR pass. 🎉 All green!🧪 All tests passed 🔄 Datadog retried 2 tests - 2 passed on retry 🎯 Code Coverage (details) 🔗 Commit SHA: 9b1c6de | Docs | View more details | Give us feedback! |
81041ae to
3ffaa18
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsAdvisory findings (1)ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: 3ffaa186e0
ℹ️ About Codex security reviews in GitHub
This is an experimental Codex feature. Security reviews are triggered when:
- You comment "@codex security review"
- A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review
Once complete, Codex will leave suggestions, or a comment if no findings are found.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ffaa186e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ad26c98 to
fff9c6f
Compare
fff9c6f to
9b1c6de
Compare
What does this PR do?
This PR focuses on improving the time it takes for CI to execute in PRs. Publishing to synthetics, releasing the SDK to maven and everything else that is develop/release/dogfooding branch specific wasn't touched here.
The CI in PRs looks like this now:
verify:alljob that runs on k8s linux runners. It does everything that was done in multiple k8s jobs before in a single Gradle invocation: lint checks, unit tests, reliability tests, coverage reports. Also it now compiles APKs for instrumented tests that are saved in the job artifacts.core-it-and-ndk,legacy-integration-instrumented-min-api,legacy-integration-instrumented-latest-api,legacy-integration-instrumented-median-api. They run on MacOS. The APKs for the tests are fetched from the artifacts of theverify:alljob. So now we don't compile anything in these jobs.Results
Implementation details
verify:all
dd-sdk-android-core. Fixed that by passing a stub commit sha on CI.--init-script ci/gradle-cache-cleanup.init.gradle.kts. The oldorg.gradle.cache.cleanupwasn't doing anyting on Gradle 9.4.0. Fixed."-Dorg.gradle.project.kotlin.compiler.execution.strategy=daemon"- runs the Kotlin compiler in its own daemon process. In a clean build without build or configuration cache, Gradle execution dropped from ~15 min (in-process CI run) to ~5 min (Kotlin-daemon CI run)."-Dorg.gradle.workers.max=16"- I tried setting more, but I didn't see any improvements in the build speed. Yes, it is lower than 32, but AI told me that each worker theoretically utilize multiple threads, so I think it is good to be generous here."-XX:ReservedCodeCacheSize=768m"- this is the memory for code compiled with JIT. I profiled the build and it turned out that this limit was always exceeded. After bumping it the build started running faster, specificallydd-sdk-android-rum:lintDebug.instrumented tests
adbto run the tests. This broke the generation of JUnit XML with the test results (it isn't generated). Fixed that by reading the console output and converting it to xml (seeinstrumentation_to_junit.py).core-it-and-ndkruns bothcore-it(for all api levels) andndktests on the same runner. This is done to reduce the usage of the runners. This way we reduce the time our jobs spend in "queued" state.core-it-and-ndkruns tests on 3 emulators in parallel (seerun_instrumented_apks.py).legacy-integration-instrumented-min-api(and others) and others also run tests on 3 emulators in parallel. We split all the tests in 3 groups: 1 - rum, 2 - session-replay, 3 - others by package name.Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?
Review checklist (to be filled by reviewers)