Skip to content
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
merged 208 commits into from
May 23, 2024

Conversation

BenHenning
Copy link
Owner

CI build stats.

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.
BenHenning and others added 29 commits May 16, 2024 22:41
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:
	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.
@BenHenning BenHenning merged commit 6fd8628 into BenHenning:develop May 23, 2024
10 of 24 checks passed
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