Skip to content

RUM-18975: Speed up PR builds - #3995

Draft
aleksandr-gringauz wants to merge 1 commit into
developfrom
aleksandr-gringauz/RUM-18975/speed-up-pr-builds
Draft

aleksandr-gringauz wants to merge 1 commit into
developfrom
aleksandr-gringauz/RUM-18975/speed-up-pr-builds

Conversation

@aleksandr-gringauz

@aleksandr-gringauz aleksandr-gringauz commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

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:

  1. verify:all job 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.
  2. 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 the verify:all job. So now we don't compile anything in these jobs.

Results

Implementation details

verify:all

  • Build cache wasn't working at its full potential because during build time we put git commit sha into the code. Thus all the code had to be recompiled because every (or almost) module depends on dd-sdk-android-core. Fixed that by passing a stub commit sha on CI.
  • --init-script ci/gradle-cache-cleanup.init.gradle.kts. The old org.gradle.cache.cleanup wasn'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).
  • Now we request 64gb RAM and 32 CPUs for the runner.
  • "-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, specifically dd-sdk-android-rum:lintDebug.

instrumented tests

  • As already mentioned we don't compile the APKs in these jobs. We now use adb to 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 (see instrumentation_to_junit.py).
  • core-it-and-ndk runs both core-it (for all api levels) and ndk tests 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-ndk runs tests on 3 emulators in parallel (see run_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)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Tests

✅ All CI checks and tests passed. Datadog automation helped this PR pass.

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog retried 2 tests - 2 passed on retry View in Datadog

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 73.58% (+1.78%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9b1c6de | Docs | View more details | Give us feedback!

@aleksandr-gringauz
aleksandr-gringauz force-pushed the aleksandr-gringauz/RUM-18975/speed-up-pr-builds branch from 81041ae to 3ffaa18 Compare October 16, 2026 10:52
@aleksandr-gringauz

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T11:05:27.720341Z 3ffaa18 Manual request
🔒 Security Review ✅ Completed 2026-10-16T11:01:47.254017Z 3ffaa18 Manual request

Security findings

Advisory findings (1)

ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛡️ 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.

Comment thread ci/pipelines/default-pipeline.yml Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread ci/pipelines/default-pipeline.yml Outdated
Comment thread ci/scripts/.idea/modules.xml Outdated
Comment thread ci/pipelines/default-pipeline.yml
Comment thread ci/scripts/run_instrumented_apks.py
@aleksandr-gringauz
aleksandr-gringauz force-pushed the aleksandr-gringauz/RUM-18975/speed-up-pr-builds branch 4 times, most recently from ad26c98 to fff9c6f Compare October 16, 2026 13:25
@aleksandr-gringauz
aleksandr-gringauz force-pushed the aleksandr-gringauz/RUM-18975/speed-up-pr-builds branch from fff9c6f to 9b1c6de Compare October 16, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant