Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request consolidates the repository into a single Gradle build, introducing shared convention plugins under build-logic/ to manage Kotlin Multiplatform, Android, Compose, Wasm, Detekt, and Kover configurations. It also restructures the shared submodules, updates documentation to reflect the new architecture, and adds local development scripts like a Spanner emulator launcher. The review feedback highlights critical compilation errors in LocalSettings.kt and settings.gradle.kts due to non-existent layout properties, a process management bug in spanner-emulator.sh that leaves detached emulator processes running, and a task isolation violation in WasmAppConventionPlugin.kt when copying files under the WASM_OPT=none configuration.
|
✦ Closing this PR for now. The review series is being re-cut into smaller PRs, and nothing new opens until the author approves the revised plan in #2629. The branch stays, and the review fixes made here are already in the source branch, so they carry over to the new PRs. |
Collect One review series: W01 Build system, CI workflows, and tooling (1/90)
Tracking issue: #2629 · Stacked on:
c1· Reviewer: @rfontanarosaFYI: @gino-m @shobhitagarwal1612
Context
Collect One is the Kotlin Multiplatform successor to Ground: a single shared codebase for the web
console, the mobile app (Android, iOS, browser), and a Spanner-backed user-data service. Forms use
ProtoForms, a lossless proto3 encoding of ODK XForms. Product and architecture background:
docs/product/prd.md,docs/technical/client/architecture.md(they land in the docs slices D01–D03).This PR is one slice of the
wip/baobabtree. It only adds the files listed below.c1already holdsthe first repo scaffolding (#2630), so nine of the files here show as edits rather than additions.
This is the first slice of a re-cut series: the tree is now one root Gradle build, and the series is
sliced along the code's dependency graph. No Gradle module lands here. The root build includes a
module only when its
build.gradle.ktsis on disk, so this PR configures as an empty build and everylater slice adds modules to it.
What's in this PR
settings.gradle.kts: the one Gradle build of the repository.includeIfPresent(":path")includesa module only if its build script exists;
collectone.serverOnly(Gradle property orlocal.properties) limits the build to:shared:coreand:server.build.gradle.kts: loads every Gradle plugin once withapply false, appliescollectone.kovertomerge coverage, and sets the merged line-coverage minimum checked by
:koverVerifyJvmTests.gradle/libs.versions.toml: the single version catalog for plugins and libraries.gradle.properties,gradle/gradle-daemon-jvm.properties,gradle/wrapper/gradle-wrapper.properties,gradlew,gradlew.bat: Gradle 8.14.5, daemon on JDK 21 (downloaded through the foojay resolver),configuration cache and build cache on.
gradle-wrapper.jaris not checked in:gradlewdownloadsit and verifies a pinned SHA-256.
build-logic/: an included build with thecollectone.*convention plugins:collectone.kmp.library(KmpLibraryConventionPlugin): JVM (Java 17 bytecode, JUnit 5) andWasm browser targets;
collectone.kmp.androidadds the Android target and SDK levels.collectone.kmp.compose,collectone.android.app,collectone.jvm.server(JDK 21 toolchain).collectone.wasm.app(WasmAppConventionPlugin,WasmSourceMaps.kt): webpack bundle, thegenerated
user-data-service-config.jsandfirebase-config.js, Binaryen modes(
WASM_OPT=full|fast|none), and source-map hydration for browser dev tools.collectone.detektandcollectone.kover(ajvmTestsreport variant; generated code excluded).LocalSettings: reads a setting from a Gradle property, then the environment, thenlocal.properties.ProjectConfig.kt: Android SDK levels, JDK versions, per-module Maven group.ProtoSchemaDescriptorsFactory: a Wire schema handler that generates a Kotlin table of messagefields and enum constants, used by the ProtoJSON and textproto codecs in common code.
config/detekt/detekt.yml: shared detekt rules on top of the defaults..github/workflows/check.yml: adds theserver Spanner testsandjvm tests, coverage, and detektjobs next to the existing format and license job.
.github/workflows/goldens.yml: the Playwrightgolden-screenshot job. Their steps are guarded by
hashFiles(...), so they are skipped until themodule they need lands.
scripts/: newspanner-emulator.sh(downloads and runs a pinned emulator),wasm-opt-wrapper.sh(caps cores and serializes
wasm-optruns),launchpad.sh. Small edits toktfmt.sh,buf-format.sh(cache directory name) andlicense-check.sh(also checks.sq/.sqm, skipsdetekt-baseline.xml).README.md,shared/README.md,GEMINI.md: updated for the single build, the module layout, localconfiguration keys, coverage and CI.
.dockerignore,.gitignore: server image context and ignoredlocal credentials files.
Where it fits
Everything else in the series builds on this: each module's
build.gradle.ktsapplies thecollectone.*plugins and reads versions from the catalog, and CI picks modules up as they appear.It depends on nothing but
c1.Not in this PR
.protoschemas → P01–P03 Protos:shared:coresources and its build file → K01–K07 Core:serverand its Dockerfile → S01–S04 Servermodule scaffolding
devtools/launchpad/(whatscripts/launchpad.shstarts) → H04 iOS host and local dev launchpade2eTests/(whatgoldens.ymlruns) → E01, E02 Playwright E2ESuggested reading order
README.md("Building", "Test Coverage", "Continuous Integration"), thenshared/README.mdsettings.gradle.kts,build.gradle.kts,gradle/libs.versions.tomlbuild-logic/build.gradle.kts, thenProjectConfig.kt,LocalSettings.kt, theKmp*andAndroidApp/JvmServerplugins,DetektConventionPlugin.kt,KoverConventionPlugin.ktWasmAppConventionPlugin.kt,WasmSourceMaps.kt,scripts/wasm-opt-wrapper.shProtoSchemaDescriptorsFactory.kt.github/workflows/check.yml,.github/workflows/goldens.yml,scripts/spanner-emulator.shFocus areas
includeIfPresentinsettings.gradle.kts: is conditional inclusion acceptable as the way to keepeach slice buildable, and should it stay after the series lands?
apply falseandbuild-logiccompiles againstthem as
compileOnly, so every module shares one copy at the catalog version.gradlewis modified from the stock script to fetchgradle-wrapper.jar(pinned URL and SHA-256)instead of committing the binary. Note the jar's tag (v8.12.1) differs from the distribution (8.14.5).
AndroidAppConventionPlugindisables thecheck*AarMetadatatasks to assemble with compile SDK 35and AGP 8.5.2. Worth a second opinion.
ProtoSchemaDescriptorsFactory: map fields as synthetic<FieldName>Entrymessages,oneofmembers in declaration order, and the hard-coded layouts of well-known types.
build.gradle.kts; CI runs:koverVerifyJvmTestsonly onceshared/webandserverare both present.c1andwip/baobab. The READMEsays
main; that wording describes the final repository.compose-multiplatform1.13.0-beta02).Safe to skim
gradlew.bat, the stock parts ofgradlew,gradle/gradle-daemon-jvm.properties(generatedtoolchain URLs),
gradle/wrapper/gradle-wrapper.properties[libraries]and[plugins]tables ofgradle/libs.versions.tomlREADME.mdsections that restate the module layout and the configuration key tableSize
LICENSEandAUTHORSare in the slice but identical toc1, so the diff shows 36 files.Testing
bash scripts/ktfmt.sh --check: PASS (16 Kotlin files).bash scripts/license-check.sh --check: PASS(25 files).
./gradlew help: PASS, so the root build andbuild-logiccompile and configure with nomodules present. There are no Gradle modules in this slice, so no
jvmTestordetekttasks ran.CI:
Check(ktfmt, license headers; the buf, JVM test, detekt and Spanner steps are skipped untiltheir inputs exist) and
Goldens(skipped untile2eTests/lands).No deviations from the
wip/baobabtree, and no currency amounts in the slice.