Skip to content

ci+build: GitHub Actions CI, R8/resource shrinking (−82% APK), more unit tests#10

Closed
fabiodalez-dev wants to merge 1 commit into
feat/offline-catalog-cachefrom
feat/ci-r8-theme-tests
Closed

ci+build: GitHub Actions CI, R8/resource shrinking (−82% APK), more unit tests#10
fabiodalez-dev wants to merge 1 commit into
feat/offline-catalog-cachefrom
feat/ci-r8-theme-tests

Conversation

@fabiodalez-dev

Copy link
Copy Markdown
Owner

First of a series of "make the app production-grade" changes. Stacked on #9 (offline cache) — base is feat/offline-catalog-cache; retarget to main once #9 merges.

What

  • CI — new .github/workflows/android-ci.yml: on every PR/push to main it runs unit tests + Android lint + assembleDebug on JDK 21 with Gradle caching, and uploads reports. The repo had no CI before.
  • R8 + resource shrinkingisMinifyEnabled = true + isShrinkResources = true for release. Keep rules already existed in proguard-rules.pro; assembleRelease runs R8 cleanly and the APK drops 24 MB → 4.3 MB (−82%).
  • TestsDateFormatTest (8 cases) for the locale/zone-aware date formatting. Full unit suite now 37 green.

Verified

  • assembleRelease (R8 + shrink) builds; release APK 4.3 MB.
  • testDebugUnitTest 37/37 green.

Note

A minified release should get one device/emulator smoke-test (login → catalog → loan request) before shipping — reflection-based runtime breakage can't be caught at build time.

…t tests

- CI: add .github/workflows/android-ci.yml — on every PR/push to main it runs
  unit tests, Android lint, and assembleDebug on JDK 21 with Gradle caching,
  and uploads test/lint reports. The repo had no CI before.
- Release build: enable R8 (`isMinifyEnabled`) + `isShrinkResources`. The keep
  rules for Retrofit/OkHttp/kotlinx.serialization/Coil/Room already lived in
  proguard-rules.pro; `assembleRelease` now runs R8 cleanly and the APK drops
  from ~24 MB (debug) to ~4.3 MB (−82%). A minified release should still get one
  device smoke-test before shipping (reflection breakage only shows at runtime).
- Tests: add DateFormatTest (8 cases) for the locale/zone-aware date formatting
  used in loans/profile/notifications — em-dash on empty, raw passthrough on
  parse failure, formatted output otherwise. Full unit suite: 37 green.

Verified: assembleRelease (R8) builds; testDebugUnitTest 37/37 green.
@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@fabiodalez-dev, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 008a5014-4c1c-4876-96d1-4eb463a6863a

📥 Commits

Reviewing files that changed from the base of the PR and between 7923205 and 9be3535.

📒 Files selected for processing (3)
  • .github/workflows/android-ci.yml
  • app/build.gradle.kts
  • app/src/test/java/com/pinakes/app/DateFormatTest.kt
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ci-r8-theme-tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@fabiodalez-dev

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

fabiodalez-dev added a commit that referenced this pull request Jul 2, 2026
- #11 CatalogSyncWorker: retry only TRANSIENT failures; give up (success) on
  permanent ones (401/403/app_disabled/validation/not_found) so the periodic
  chain isn't stuck retrying an unrecoverable condition. Classification is a
  pure isPermanentFailure() so it's unit-testable without Android/Hilt.
- #13 CatalogSyncWorkerTest: rewritten — the old 'no-op on plain context' test
  was written for the pre-Hilt (ServiceLocator) worker and broke under #14's
  EntryPointAccessors migration. Now covers the real branch (permanent vs
  transient) via the pure function.
- #9 HomeViewModel: don't flip loading=false on an empty cache emission —
  keep the skeleton until the first refresh resolves, so a cold start no
  longer flashes the 'empty library' state while the network is in flight.
- #10 CI: build the release variant too (assembleRelease) so R8/minify is
  exercised in CI, not only at runtime.

Merged the 7-PR stack (#8 navbar/reserve, #9 offline cache, #10 CI/R8,
#11 WorkManager sync, #12 Sentry, #13 tests, #14 Hilt) into main; the
libs.versions.toml conflict (#13 work-testing vs #14 Hilt libs) resolved as a
union. Full build green: 67 unit tests, assembleDebug + assembleRelease.
@fabiodalez-dev

Copy link
Copy Markdown
Owner Author

Landed in main via the integrated stack merge (main @ 754d25e). Every commit of this branch is now reachable from main; the review fixes were applied on top in the same integration (see commit 754d25e). Closing as merged.

@fabiodalez-dev fabiodalez-dev deleted the feat/ci-r8-theme-tests branch July 2, 2026 14:43
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