Port shrinker DCE test (#217) and CodeQL fix (#218) to develop#221
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
There was a problem hiding this comment.
Pull request overview
Ports two fixes from main to develop: (1) adds a shrinker regression test covering a consumer -keep rule that prevents tree-shaking of a flag-guarded class even when -assumevalues still folds the branch; and (2) updates the CodeQL workflow to force a real Kotlin recompile so CodeQL consistently observes source code during the build.
Changes:
- Add
writeBooleanRulesWithKeptDeadBranch()and a new R8 test asserting kept dead-branch classes survive while the call site is still eliminated. - Introduce
assertClassDoesNotReference()to verify the caller bytecode no longer references the dead-branch class after folding. - Fix CodeQL Kotlin analysis by switching to manual build-mode and forcing Gradle tasks to rerun without build cache.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| featured-shrinker-tests/src/test/kotlin/dev/androidbroadcast/featured/shrinker/rules/ProguardRulesWriter.kt | Adds a ProGuard rules fixture modeling a consumer -keep pinning the dead-branch class. |
| featured-shrinker-tests/src/test/kotlin/dev/androidbroadcast/featured/shrinker/r8/R8BooleanFlagEliminationTest.kt | Adds a regression test asserting -keep defeats tree-shaking while folding still removes the call site. |
| featured-shrinker-tests/src/test/kotlin/dev/androidbroadcast/featured/shrinker/assertions/JarAssertions.kt | Adds an ASM-based assertion to ensure one class’s bytecode doesn’t reference another. |
| .github/workflows/codeql.yml | Forces a manual, non-cached, rerun Gradle build so CodeQL sees Kotlin compilation. |
Port #217 + #218 from main to develop
mainhad diverged fromdevelopwith three commits (a competing old-scoperelease 1.0.0plus two valuable fixes). This salvages the two valuable ones ontodevelop; the competing release commit (405886f) is intentionally discarded —developalready carries the correct redesign-scope 1.0.0 content and the Wiki docs migration (#193).Ported
test(shrinker): cover -keep defeating flag DCE. AddsJarAssertions,ProguardRulesWriterhelper, and theR8BooleanFlagEliminationTestcase modelling a consumer-keeprule that pins a flag-guarded class as a GC root (defeating tree-shaking while-assumevaluesstill folds the branch). Cherry-picked cleanly; compiles and passes against develop's redesigned shrinker module. Itsdocs/guides/r8-verification.mdedit was dropped (that doc lives in the Wiki now).branches: [main, develop]+paths-ignoretriggers, adopts main's build-step fix (build-mode: manual+assembleDebug --no-build-cache --rerun-tasks) that prevents the "no source code seen during build" (exit 32) failure.Discarded (superseded by develop)
405886fVERSION_NAME / CHANGELOG /docs/guides/*restructure /mkdocs.yml— develop's release prep (#219) is the source of truth.Prereq for the v1.0.0 release: once merged, develop becomes a superset of main's valuable content, unblocking the develop→main release merge.