ci: prebuild modules in parallel with native build and parallelize apk variants - #193
Conversation
Reviewer's GuideThe PR restructures CI to precompile Java/Kotlin and module resources in parallel with native builds, then reuses the resulting Gradle build cache while assembling builtin and external APK variants concurrently. APK metadata preparation, build-type handling, artifact aggregation, and cleanup are updated across PR, pre-release, and stable workflows. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/reusable-prebuild-modules.yml" line_range="76-79" />
<code_context>
+
+ # Prebuild all module resources, Kotlin, Java, and AAR packages before native build finishes.
+ # The Gradle local build-cache will capture all compiled classes, generated resources, and DEX components.
+ ./gradlew --no-daemon --build-cache \
+ -Pupdate.channel="${{ inputs.channel }}" \
+ compile${cap_type}Sources \
+ :pack:bundle${cap_type}Aar
+
+ - name: Upload Gradle build cache
</code_context>
<issue_to_address>
**issue (bug_risk):** The prebuild job invokes `compileReleaseSources` or `compileDebugSources`, but no such Gradle task is defined by the project or Android plugin; the job fails before uploading the build cache, so every workflow that now requires this job fails before APK assembly can start.
**Triggers:** On every channel, pull-request, or release workflow run.
**Suggested fix:** Invoke the actual module-specific compile tasks, or use a valid aggregate task such as the relevant module's `assemble${cap_type}`/`compile${cap_type}Kotlin` and Java/resource tasks.
</issue_to_address>
### Comment 2
<location path=".github/workflows/reusable-prebuild-modules.yml" line_range="74-79" />
<code_context>
+ build_type="${{ inputs.build_type }}"
+ cap_type="$(tr '[:lower:]' '[:upper:]' <<< "${build_type:0:1}")${build_type:1}"
+
+ # Prebuild all module resources, Kotlin, Java, and AAR packages before native build finishes.
+ # The Gradle local build-cache will capture all compiled classes, generated resources, and DEX components.
+ ./gradlew --no-daemon --build-cache \
+ -Pupdate.channel="${{ inputs.channel }}" \
+ compile${cap_type}Sources \
+ :pack:bundle${cap_type}Aar
+
+ - name: Upload Gradle build cache
</code_context>
<issue_to_address>
**issue (broader_impact):** The step claims to prebuild all module resources, Kotlin, Java, and DEX components, but its command only requests the nonexistent aggregate source task plus `:pack:bundleReleaseAar`; it does not provide a valid task graph for the app and dependent modules, so the intended Gradle cache entries are never produced even if the task name is corrected incompletely.
**Triggers:** When the prebuild job is changed to use a command that happens to succeed without explicitly selecting all dependent modules.
**Suggested fix:** Define and invoke a verified aggregate task or the exact module task graph whose outputs the APK build consumes, including the requested build type.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 2 findings to address first, and a workflow or cache mistake could produce incorrect signed APKs or omit a variant, and those artifacts may already be published before the change is reverted. The affected releases can be replaced or rebuilt, so the impact is bounded and repairable rather than permanent.
Blocking findings: .github/workflows/reusable-prebuild-modules.yml:79, .github/workflows/reusable-prebuild-modules.yml:79
| ./gradlew --no-daemon --build-cache \ | ||
| -Pupdate.channel="${{ inputs.channel }}" \ | ||
| compile${cap_type}Sources \ | ||
| :pack:bundle${cap_type}Aar |
There was a problem hiding this comment.
issue (bug_risk): The prebuild job invokes compileReleaseSources or compileDebugSources, but no such Gradle task is defined by the project or Android plugin; the job fails before uploading the build cache, so every workflow that now requires this job fails before APK assembly can start.
Triggers: On every channel, pull-request, or release workflow run.
Suggested fix: Invoke the actual module-specific compile tasks, or use a valid aggregate task such as the relevant module's assemble${cap_type}/compile${cap_type}Kotlin and Java/resource tasks.
| # Prebuild all module resources, Kotlin, Java, and AAR packages before native build finishes. | ||
| # The Gradle local build-cache will capture all compiled classes, generated resources, and DEX components. | ||
| ./gradlew --no-daemon --build-cache \ | ||
| -Pupdate.channel="${{ inputs.channel }}" \ | ||
| compile${cap_type}Sources \ | ||
| :pack:bundle${cap_type}Aar |
There was a problem hiding this comment.
issue (broader_impact): The step claims to prebuild all module resources, Kotlin, Java, and DEX components, but its command only requests the nonexistent aggregate source task plus :pack:bundleReleaseAar; it does not provide a valid task graph for the app and dependent modules, so the intended Gradle cache entries are never produced even if the task name is corrected incompletely.
Triggers: When the prebuild job is changed to use a command that happens to succeed without explicitly selecting all dependent modules.
Suggested fix: Define and invoke a verified aggregate task or the exact module task graph whose outputs the APK build consumes, including the requested build type.
Summary by Sourcery
Parallelize module prebuilds and APK variant assembly across the CI pipelines.
New Features:
Enhancements:
CI: