fix: CI/firebase fixes and expanded R8 dead-code-elimination tests#152
fix: CI/firebase fixes and expanded R8 dead-code-elimination tests#152kirich1409 merged 4 commits intomainfrom
Conversation
Review Summary by QodoFix Firebase exception wrapping and remove docs PR trigger
WalkthroughsDescription• Fix Firebase exception handling to consistently wrap all exceptions in FetchException • Remove docs build trigger from pull_request workflow events • Remove stale ADR 001 references from documentation and navigation Diagramflowchart LR
A["Firebase Exception Handling"] -->|"Remove redundant RuntimeException re-throw"| B["Consistent FetchException Wrapping"]
C["CI/CD Workflow"] -->|"Remove pull_request trigger"| D["Docs build on main/tags only"]
E["Documentation Files"] -->|"Remove missing ADR 001 references"| F["Clean navigation and links"]
File Changes1. providers/firebase/src/main/kotlin/dev/androidbroadcast/featured/firebase/FirebaseConfigValueProvider.kt
|
Code Review by Qodo
1.
|
...rebase/src/main/kotlin/dev/androidbroadcast/featured/firebase/FirebaseConfigValueProvider.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
This PR streamlines documentation publishing in CI while cleaning up stale docs navigation and making Firebase Remote Config fetch errors consistently surface as FetchException within the Firebase provider module.
Changes:
- Remove the docs workflow
pull_requesttrigger so docs build/publish runs only onpush(main/tags). - Remove stale ADR references from MkDocs navigation and best-practices guide.
- Simplify
FirebaseConfigValueProvider.fetch()exception handling by removing a redundantRuntimeExceptionrethrow.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
providers/firebase/src/main/kotlin/dev/androidbroadcast/featured/firebase/FirebaseConfigValueProvider.kt |
Adjusts exception handling during Firebase Remote Config await() to wrap failures. |
mkdocs.yml |
Removes a nav entry pointing to a non-existent ADR page. |
docs/guides/best-practices.md |
Removes an in-text link to the removed/non-existent ADR. |
.github/workflows/docs.yml |
Stops running the docs workflow on PRs; keeps it on push to main/tags. |
| try { | ||
| task.await() | ||
| } catch (e: RuntimeException) { | ||
| throw e | ||
| } catch (e: Exception) { | ||
| throw FetchException("Firebase Remote Config fetch failed", e) | ||
| } |
There was a problem hiding this comment.
fetch() now wraps all Exceptions in FetchException, which will also catch kotlinx.coroutines.CancellationException thrown by task.await(). That breaks structured concurrency by converting coroutine cancellation into a fetch failure. Add a dedicated catch (e: CancellationException) { throw e } (and import it) before the generic catch (e: Exception) so cancellation is propagated unchanged.
Docs are now built and published only on push to main or release tags. Running a full Dokka + MkDocs build on every PR is slow and its failure should not block merging. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…atrix and int flags
- Replace single-branch caller with a bifurcated caller (if + else) so one
input JAR covers the full 2×2 boolean matrix:
· flag=false → if-branch eliminated, else-branch present
· flag=true → else-branch eliminated, if-branch present
· no assumevalues → both branches survive (baseline)
- Add Int flag test family: asserts that -assumevalues return 0 causes R8 to
constant-fold `0 > 0` to false and eliminate the guarded class
- Extract sideEffectClassBytes(name) helper to deduplicate branch-target bytecode
- Add -keepclassmembers for the surviving branch's sideEffect field to prevent
R8 from eliminating it via write-only field optimisation (dead class stays
unprotected so R8 can eliminate it freely)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract runBooleanR8/runIntR8/runR8WithJar helpers to eliminate repeated three-line jar/rules/output setup from every test method - Expand Opcodes.* wildcard to explicit imports (ktlint standard:no-wildcard-imports) - Apply spotless formatting Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…Exception Removing the RuntimeException catch in the previous commit inadvertently caused CancellationException (a RuntimeException subclass) to be swallowed and wrapped in FetchException, breaking structured concurrency. Also restore pull_request trigger in docs.yml — publish-docs is already gated with `if: github.event_name == 'push'` so docs are validated on PRs but not published. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
22eb01c to
baeb076
Compare
Summary
CI / Firebase fixes
pull_requesttrigger from docs build workflow — docs are only deployed on push tomainbest-practices.mdandmkdocs.yml(file does not exist)FirebaseConfigValueProvider: remove redundantRuntimeExceptionre-throw so all exceptions are consistently wrapped inFetchExceptionR8 elimination test coverage
Expanded
R8EliminationTestfrom 2 cases to 5, covering the full flag-branch matrix:return falsereturn trueAlso added an Int flag family:
-assumevalues return 0causes R8 to fold0 > 0tofalseand eliminate the guarded class; without the rule the class survives.Key finding during implementation: R8 eliminates write-only fields and their owning class as an additional optimisation. The surviving branch's
sideEffectfield must be pinned with-keepclassmembers; the dead branch's class is intentionally left unprotected so R8 can remove it.Test plan
R8EliminationTestcases pass locally (./gradlew :featured-gradle-plugin:test)FetchException🤖 Generated with Claude Code