Migrate commcare-core from sibling directory to git submodule#3608
Migrate commcare-core from sibling directory to git submodule#3608
Conversation
Replace the sibling-directory dependency on commcare-core with a git submodule, following the same pattern used by formplayer. This simplifies onboarding (clone --recurse-submodules) and CI (single checkout). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
With commcare-core as a git submodule, CI uses `submodules: true` on actions/checkout instead of the Python checkout_cross_request_repo.py script. The browserstack-tests job is unchanged as it only uses pre-built artifacts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update all references from sibling directory (../commcare-core/) to git submodule (libs/commcare-core/) in AGENTS.md, README.md, and app/build.gradle. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis pull request migrates commcare-core from a sibling directory (../commcare-core) to a git submodule located at libs/commcare-core. The changes update the Gradle build configuration to reference the new submodule location, modify the GitHub Actions workflow to enable submodule checkout while removing custom Python scripts, and update developer documentation to reflect the new repository structure and cloning process. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
🧹 Nitpick comments (2)
docs/superpowers/plans/2026-03-11-commcare-core-git-submodule.md (1)
36-40: Add language specifiers to fenced code blocks.Several code blocks throughout this document lack language specifiers (lines 37, 53, etc.). While this doesn't affect functionality, it improves readability and satisfies markdown lint rules.
For expected output blocks, use
text:-``` +```text Cloning into '/Users/.../commcare-android/libs/commcare-core'...🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/superpowers/plans/2026-03-11-commcare-core-git-submodule.md` around lines 36 - 40, Several fenced code blocks in the markdown (notably the expected output block containing "Cloning into '/Users/.../commcare-android/libs/commcare-core'...") are missing language specifiers; update those fenced blocks to use the text language (i.e., change ``` to ```text) so expected-output snippets render and satisfy markdown linting..github/workflows/commcare-android-pr-workflow.yml (1)
14-17: Consider addingsubmodules: trueto the linter workflow's checkout step.The
linter.ymlfile at line 22 usesactions/checkout@v4withoutsubmodules: true. Since the codebase has extensive imports fromorg.commcare.core.*(network, encryption, parsing, etc.), the commcare-core submodule may be needed if the linter performs deep static analysis on Java/Kotlin code. Currently,libs/commcare-core/will be empty during linting.However, since super-linter (v8.2.1) is primarily a style/format linter and only validates changed files (
VALIDATE_ALL_CODEBASE: false), it may work without the submodule. Update this only if you experience linting failures related to unresolved imports or type checking.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/commcare-android-pr-workflow.yml around lines 14 - 17, The linter workflow's checkout step (actions/checkout@v4 in linter.yml) does not fetch git submodules so libs/commcare-core/ may be empty during linting; update the checkout step used by linter.yml to include submodules: true (same key used in .github/workflows/commcare-android-pr-workflow.yml) so the commcare-core submodule is populated before super-linter runs, ensuring imports under org.commcare.core are available to any deeper static analysis.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/commcare-android-pr-workflow.yml:
- Around line 14-17: The linter workflow's checkout step (actions/checkout@v4 in
linter.yml) does not fetch git submodules so libs/commcare-core/ may be empty
during linting; update the checkout step used by linter.yml to include
submodules: true (same key used in
.github/workflows/commcare-android-pr-workflow.yml) so the commcare-core
submodule is populated before super-linter runs, ensuring imports under
org.commcare.core are available to any deeper static analysis.
In `@docs/superpowers/plans/2026-03-11-commcare-core-git-submodule.md`:
- Around line 36-40: Several fenced code blocks in the markdown (notably the
expected output block containing "Cloning into
'/Users/.../commcare-android/libs/commcare-core'...") are missing language
specifiers; update those fenced blocks to use the text language (i.e., change
``` to ```text) so expected-output snippets render and satisfy markdown linting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 31574c63-ec6b-423f-aa39-798c23b82df0
📒 Files selected for processing (8)
.github/workflows/commcare-android-pr-workflow.yml.gitmodulesAGENTS.mdREADME.mdapp/build.gradledocs/superpowers/plans/2026-03-11-commcare-core-git-submodule.mdlibs/commcare-coresettings.gradle
💤 Files with no reviewable changes (1)
- app/build.gradle
There was a problem hiding this comment.
Looks like we can delete this file now?
690be5e to
d1061fb
Compare
Product Description
No user-facing changes. This is an infrastructure change to how commcare-core is integrated into commcare-android.
Technical Summary
Replaces the sibling-directory local Gradle module dependency on commcare-core (
../commcare-core/) with a git submodule atlibs/commcare-core/, following the same pattern already used by formplayer.Motivation:
git clone --recurse-submodulesgets everything in one step — no manual sibling directory setupactions/checkoutwithsubmodules: truereplaces the Pythoncheckout_cross_request_repo.pyscriptKey changes:
libs/commcare-core/trackingmastersettings.gradleto point tolibs/commcare-coreinstead of../commcare-coresubmodules: trueonactions/checkoutAGENTS.md,README.md, andapp/build.gradleto reflect new setup instructionsbrowserstack-testsjob unchanged (only uses pre-built artifacts)Cross-repo PR workflow after this change:
Developers update the submodule pointer in the commcare-android PR to test against a commcare-core feature branch. Once the commcare-core PR merges, the pointer is updated to the merged master commit.
Benchmarked against: formplayer's existing git submodule setup for commcare-core.
Safety Assurance
Safety story
./gradlew projectssucceeds):commcare-coreis unchanged, soapp/build.gradledependencies (implementationandtestImplementation testsAsJar) require no changesAutomated test coverage
QA Plan
--recurse-submodulesworksgit submodule update --initworks for existing checkoutsLabels and Review