forked from oppia/oppia-android
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add build stats ci workflow #11
Merged
BenHenning
merged 208 commits into
BenHenning:develop
from
oppia:add-build-stats-ci-workflow
May 23, 2024
Merged
Add build stats ci workflow #11
BenHenning
merged 208 commits into
BenHenning:develop
from
oppia:add-build-stats-ci-workflow
May 23, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This script primarily focuses on high-level differences, including: - Sizes (file + download) - New/old files, configurations, resource changes - Method counts
This workflow is set up to build multiple binaries for both develop & the local branch, then analyze and generate reports that are uploaded as artifacts and added as a comment to the PR body. This doesn't make a guarantee about exact differences since GitHub uses a detached HEAD for the commit that may not exactly match. This also introduces a new workflow for stats (that will initially only contain optional workflows since they may be very expensive/time consuming).
These allow some SDK properties to be shared across different dependencies.
This updates the script to no longer require an Android SDK path to be passed in since it now directly pulls in AAPT2 and directly performs the work of apkanalyzer using its internal library rather than calling through to the CLI library (since it's not exposed via android_sdk_repository). This also updates the report output to compute full comparisons for all APKs (rather than just the universal APK) and include it as part of the full summary (so that only 2 files are ever written regardless of the number of profiles being compared). This adds placeholder tests & documentation for all new utilities. This commit includes substantial changes to the build system: - A new dependency on https://github.com/oppia/archive-patcher - A split between production, test, and script Maven dependencies (where the license tools have been updated to only operate on production dependencies since those are the ones being shipped to users) - Two versions of Guava are now being pulled in since the scripts require a JRE version of Guava rather than the Android version used in production & test classes - rules_kotlin has been upgraded to beta 3 (from alpha 2), but the Kotlin version itself is stuck on 1.4 (to ensure interoperability with previous builds). While this change doesn't upgrade Kotlin, it does allow us to leverage better tooling per changes in rules_kotlin, including enforcing strict deps.
Also, since I forgot to add these notes in the previous commit: the executor has also been changed in this PR to support applications which block on stdout/stderr being consumed.
Conflicts: third_party/maven_prod_install.json
Remove duplicated workflow.
I'm not entirely sure why this is needed yet.
The current comment is a bit too long, so adding additional collapsing per-flavor.
This reverts the split prod/test deps since it results in one version issues. This commit also fixes the nice byte formatting in the report not working correctly for negative sizes.
Conflicts: WORKSPACE third_party/maven_install.json
This PR resolves *all* Maven conflicts and Proguard issues by ensuring everything is using the latest Kotlin runtime & libraries. Tests have not been verified as building yet (they probably won't due to visibility changes & new behaviors/API changes introduced in Kotlin 1.5 and 1.6). This is needed as part of checking #2173 for build stats (which will happen on another, temporary branch).
The check & related scripts required fairly involved reworking since the Maven install file (from which it sources Maven URL context) changed in format as part of the upgrade for rules_jvm_external. This has actually led to what seems to be more correct analysis of libraries that the build depends on, so more licenses have been added to the maven_dependencies.textproto tracking file. One unused Crashlytics dependency was removed since it was referencing an old license that doesn't exist anymore (and the artifact should be replaced in full by more recent Firebase Crashlytics dependencies that we are already using).
This addresses an underlying bug with the command executor that can, in some cases, break compute_affected_tests. It also refines some of its internal mechanisms for much better performance on expensive PRs. It also prepares the base support needed for merge queues, but the CI workflows aren't being updated in this change.
This prepares for merge queues (but doesn't quite configure the workflow for them--that will happen in a different PR), and improves how tests are computed for stacked PRs.
…xternal Conflicts: scripts/src/java/org/oppia/android/scripts/common/BUILD.bazel scripts/src/java/org/oppia/android/scripts/license/MavenDependenciesListCheck.kt scripts/src/java/org/oppia/android/scripts/license/MavenDependenciesRetriever.kt scripts/src/java/org/oppia/android/scripts/maven/GenerateMavenDependenciesList.kt scripts/src/javatests/org/oppia/android/scripts/license/MavenDependenciesListCheckTest.kt scripts/src/javatests/org/oppia/android/scripts/license/MavenDependenciesRetrieverTest.kt scripts/src/javatests/org/oppia/android/scripts/maven/GenerateMavenDependenciesListTest.kt
Also, update TODO check script to have nicer output, and support generating the exemption textproto file for easier updates in the future.
Conflicts: app/src/main/java/org/oppia/android/app/testing/InputInteractionViewTestActivity.kt app/src/main/res/layout/activity_input_interaction_view_test.xml app/src/sharedTest/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsViewTest.kt domain/src/main/java/org/oppia/android/domain/oppialogger/analytics/AnalyticsController.kt third_party/maven_install.json
Conflicts: third_party/maven_install.json
Conflicts: domain/src/main/java/org/oppia/android/domain/auth/BUILD.bazel domain/src/main/java/org/oppia/android/domain/oppialogger/survey/BUILD.bazel domain/src/main/java/org/oppia/android/domain/survey/BUILD.bazel testing/src/main/java/org/oppia/android/testing/firebase/BUILD.bazel third_party/maven_install.json
Fixing one of the test warnings required upgrading to Robolectric 4.9 (to add support for SDK 33 which the app has targeted for the past ~6 months).
Robolectric upgrade is hard: it requires upgrading Espresso in order to work around robolectric/robolectric#7367 and robolectric/robolectric#6593. However, newer Espresso makes use of new manifest features that require upgrading Bazel: bazelbuild/bazel#14285. Because upgrading Kotlin is a precursor to the Bazel upgrade, a workaround for the single test that required the Robolectric upgrade (due to using a deprecated API from SDK 33 without being able to actually use SDK 33 in the test) is the best approach here until Robolectric can actually be upgraded in the future.
This is in preparation for the codebase-wide upgrade to Kotlin 1.6.
Conflicts: WORKSPACE scripts/src/java/org/oppia/android/scripts/testing/TestBazelWorkspace.kt third_party/versions.bzl
This pulls in non-configuration changes from #4937 that are compatible with the current Kotlin 1.4.x. Kotlin 1.5 and 1.6 changes will need to come as part of a downstream PR.
These are mainly reverting a few more Kotlin 1.5/1.6-specific API changes.
…tlin1.6 Conflicts: app/src/sharedTest/java/org/oppia/android/app/customview/interaction/MathExpressionInteractionsViewTest.kt app/src/test/java/org/oppia/android/app/translation/AppLanguageResourceHandlerTest.kt data/src/test/java/org/oppia/android/data/backends/gae/NetworkLoggingInterceptorTest.kt testing/src/main/java/org/oppia/android/testing/junit/ParameterizedMethod.kt utility/src/test/java/org/oppia/android/util/logging/ConsoleLoggerTest.kt
Conflicts: WORKSPACE scripts/src/java/org/oppia/android/scripts/license/MavenDependenciesRetriever.kt third_party/maven_install.json
This mainly involved updating CODEOWNERS & fixing a bunch of TODO references for now-marked deprecations.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CI build stats.