Skip to content

Port shrinker DCE test (#217) and CodeQL fix (#218) to develop#221

Open
kirich1409 wants to merge 1 commit into
developfrom
chore/port-shrinker-test-codeql-fix
Open

Port shrinker DCE test (#217) and CodeQL fix (#218) to develop#221
kirich1409 wants to merge 1 commit into
developfrom
chore/port-shrinker-test-codeql-fix

Conversation

@kirich1409
Copy link
Copy Markdown
Contributor

Port #217 + #218 from main to develop

main had diverged from develop with three commits (a competing old-scope release 1.0.0 plus two valuable fixes). This salvages the two valuable ones onto develop; the competing release commit (405886f) is intentionally discarded — develop already carries the correct redesign-scope 1.0.0 content and the Wiki docs migration (#193).

Ported

  • test(shrinker): cover -keep defeating flag dead-code elimination #217test(shrinker): cover -keep defeating flag DCE. Adds JarAssertions, ProguardRulesWriter helper, and the R8BooleanFlagEliminationTest case modelling a consumer -keep rule that pins a flag-guarded class as a GC root (defeating tree-shaking while -assumevalues still folds the branch). Cherry-picked cleanly; compiles and passes against develop's redesigned shrinker module. Its docs/guides/r8-verification.md edit was dropped (that doc lives in the Wiki now).
  • ci(codeql): force Kotlin recompile so CodeQL sees source #218 — CodeQL recompile fix. 3-way merge: keeps develop's branches: [main, develop] + paths-ignore triggers, 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)

405886f VERSION_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.

Copilot AI review requested due to automatic review settings May 30, 2026 21:05
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Re-trigger cubic

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.

2 participants