oppia / oppia-android

A free, online & offline learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
300 stars 502 forks source link

Fixes part of #4120, part of #1051: Fix a lot of build-time warnings #5402

Closed BenHenning closed 4 weeks ago

BenHenning commented 1 month ago

Explanation

Fixes part of #4120 Fixes part of #1051

Similar to #5400, this brings forward changes that would otherwise go in #4937 to simplify the transition to Kotlin 1.6.

Part of #4937 is introducing warnings-as-errors for both Kotlin and Java in order to reduce developer error, simplify the codebase, and minimize warnings when building (which can result in developer habits of ignoring warnings that might have real consequences to end users of the app). In order to keep the main migration PR smaller, this PR fixes all existing warnings and any new ones detected with the Kotlin 1.6 compiler that are not tied to Kotlin 1.5/1.6 API changes (those are part of #4937, instead). Fortunately, most of the changes could be brought forward into this PR.

Specific things to note:

Note that overall the PR has relied heavily on tooling to detect warnings to fix, and automated tests to verify that the changes have no side effects.

Note also that this PR does not actually enable warnings-as-errors; that will happen in a downstream PR.

Essential Checklist

For UI-specific PRs only

N/A -- While this changes UI code, it should change very few UI behaviors and only failure cases for those it does affect. It's largely infrastructural-only and falls mainly under refactoring/cleanup work.

BenHenning commented 1 month ago

PTAL @adhiamboperes.

Note that this PR is pretty straightforward to review, but it's very large and caused my computer to have some issues when trying to view the actual changes. It probably is worth breaking this into chunks when reviewing it.

I think it'd also be completely fine to delegate review of most or all of it to other people. I've self-reviewed the changes and find them non-concerning, but I defer to whatever you want to do as the primary reviewer & approver of the PR.

oppiabot[bot] commented 1 month ago

Unassigning @adhiamboperes since they have already approved the PR.

oppiabot[bot] commented 1 month ago

Hi @BenHenning, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to merge this PR once the CI checks pass and you're happy with it. Thanks!

BenHenning commented 1 month ago

@seanlip PTAL for owners-specific changes.

seanlip commented 1 month ago

@BenHenning Owners approval does not seem to be required for this PR, unless I'm missing something?

BenHenning commented 4 weeks ago

Hmm not sure why I saw that originally @seanlip. Thanks for double checking!

Thanks @adhiamboperes for the review!

Enabling auto-merge now that this is up-to-date with the latest develop changes.