feat: add Baseline Profiles support#134
Conversation
Add a dedicated :baselineprofile producer module (com.android.test) with BaselineProfileGenerator, wire the androidx.baselineprofile plugin into :app with dexLayoutOptimization enabled, and add a weekly CI workflow for automated profile generation. AGP 9.x notes: requires benchmark-macro 1.5.0-alpha06+ (1.4.x incompatible); do NOT apply kotlin.android alongside com.android.test (AGP 9 has built-in Kotlin); scope AndroidX exclusions to :app only to avoid stripping benchmark and UiAutomator transitive deps in the new module. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
Your plan currently allows 1 review/hour. Refill in 44 minutes and 22 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds baseline profile generation: new ChangesAndroid Baseline Profile Generation Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/baseline-profile.yml:
- Around line 16-17: The checkout step currently uses actions/checkout@v6
without disabling credential persistence; update the Checkout step that uses
actions/checkout@v6 to include with: persist-credentials: false so the job does
not retain the runner's Git credentials after checkout (reference the Checkout
step and the persist-credentials setting).
- Line 17: Update the workflow to pin all third‑party actions to immutable
commit SHAs instead of mutable tags and disable credential persistence for the
checkout step: replace usages of actions/checkout@v6, actions/setup-java,
gradle/actions/setup-gradle, reactivecircus/android-emulator-runner and
actions/upload-artifact with their respective full commit SHAs, and add a with:
persist-credentials: false entry to the actions/checkout step so credentials are
not persisted to the workspace.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b901ca7d-bd5c-41e5-a098-8b2cccde29d0
📒 Files selected for processing (8)
.github/workflows/baseline-profile.ymlapp/build.gradle.ktsbaselineprofile/build.gradle.ktsbaselineprofile/src/main/AndroidManifest.xmlbaselineprofile/src/main/java/de/lemke/geticon/baselineprofile/BaselineProfileGenerator.ktbuild.gradle.ktsgradle/libs.versions.tomlsettings.gradle.kts
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new :baselineprofile module to generate baseline profiles for the application, including the necessary Gradle configurations, dependencies, and a generator test class. Feedback suggests that the logic for AndroidX exclusions in the root build script is currently too restrictive and should be refactored to exclude the :baselineprofile module specifically, rather than only targeting the :app module, to prevent issues in future library modules.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ofile Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
….properties - Untrack copilot migration XMLs, markdown.xml, migrations.xml (user-specific IDE state) - Add patterns for markdown.xml, migrations.xml, copilot.data.migration*.xml - Add github.properties (contains GH credentials per CLAUDE.md — must not be committed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace ~30 patchwork ignore patterns with /.idea/ + explicit whitelist. New .idea/ files from IDE updates are silently ignored by default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.gitignore:
- Around line 2-14: The current .gitignore ignores the whole /.idea/ directory
so later negate patterns like !/.idea/.gitignore won’t re-include children;
change the top rule to ignore contents (use "/.idea/*" instead of "/.idea/") and
ensure you also include an explicit allow rule for the directory itself (add
"!/.idea/") before or after your specific allowlist entries like
"!/.idea/.gitignore", "!/.idea/.name", etc., so Git can descend into the
directory and the specific files are re-included.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 91c3bdaa-3229-4e00-8ca6-49b5d4d4d8ae
📒 Files selected for processing (10)
.github/workflows/baseline-profile.yml.gitignore.idea/copilot.data.migration.agent.xml.idea/copilot.data.migration.ask.xml.idea/copilot.data.migration.ask2agent.xml.idea/copilot.data.migration.edit.xml.idea/gradle.xml.idea/markdown.xml.idea/migrations.xmlgradle/libs.versions.toml
💤 Files with no reviewable changes (8)
- .idea/copilot.data.migration.ask.xml
- .idea/copilot.data.migration.edit.xml
- .idea/markdown.xml
- .idea/copilot.data.migration.agent.xml
- .idea/gradle.xml
- .idea/migrations.xml
- .idea/copilot.data.migration.ask2agent.xml
- gradle/libs.versions.toml
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
/.idea/ ignores the directory itself — git won't descend into it so !/.idea/<file> negation patterns are silently no-ops. /.idea/* ignores only the contents, preserving git's ability to apply ! rules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Defensive pattern — explicitly re-includes subdirectory contents in case future broader ignore patterns or git version edge cases would swallow them. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new :baselineprofile module to support baseline profile generation and installation, aimed at improving app performance. It includes updates to the build configuration, dependency management via libs.versions.toml, and a refinement of AndroidX exclusions to prevent conflicts between oneui-design and standard testing libraries. Feedback suggests using a more robust check for the application plugin in the root build script instead of relying on a hardcoded module name.
Replaces project.name == "app" with plugins.withId("com.android.application").
Semantically correct: targets all application modules (all use oneui-design forks);
com.android.test modules like :baselineprofile are not matched and retain AOSP AndroidX.
withId() is a callback — safe against configuration-order issues unlike hasPlugin().
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
compileSdk, targetSdk, jvmTarget moved from hardcoded literals to version catalog entries. minSdk stays per-module (26/28 differ). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a new :baselineprofile module to support performance optimization via baseline profiles. Key changes include migrating SDK and JVM targets to the version catalog, refactoring AndroidX dependency exclusions to support test modules, and cleaning up project configuration files. Review feedback highlights a regression in the kover configuration where a literal dollar sign requires escaping in a Kotlin string template to avoid interpolation errors. Additionally, it is suggested to simplify the multi-line assignments for compileSdk and targetSdk in the app's build script to ensure consistency with the rest of the project.
Summary
:baselineprofileproducer module (com.android.test) withBaselineProfileGeneratorthat drives app cold-start for ART ahead-of-time compilationandroidx.baselineprofileplugin into:appwithdexLayoutOptimization = trueandprofileinstallerruntime dep.github/workflows/baseline-profile.yml— weekly scheduled + manual-dispatch workflow usingandroid-emulator-runnerAGP 9.x caveats (documented in plan)
benchmark-macro 1.4.xis incompatible with AGP 9.2.x — only1.5.0-alpha06+works; pinned with# Why pinned:commentkotlin.androidtocom.android.test— AGP 9.x has built-in Kotlin support; applying it explicitly throwsAgpWithBuiltInKotlinAppliedCheck:apponly — the rootbuild.gradle.ktsAndroidX exclusions (needed for oneui-design) now guarded withif (project.name == "app")to avoid stripping benchmark/UiAutomator transitive deps in:baselineprofileTest plan
./gradlew :app:assembleDebug— BUILD SUCCESSFUL./gradlew lintDebug— BUILD SUCCESSFUL, noNewerVersionAvailable./gradlew spotlessCheck— passes./gradlew detekt— passesgenerateBaselineProfile,generateReleaseBaselineProfile,copyReleaseBaselineProfileIntoSrc,mergeReleaseBaselineProfile🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Build / Config
CI / Hygiene
Tests / Verification