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

Fix #4389, #4407: Future-proof event analytics logging infrastructure #4421

Merged
merged 37 commits into from
Sep 8, 2022

Conversation

BenHenning
Copy link
Sponsor Member

@BenHenning BenHenning commented Jul 4, 2022

Explanation

Fixes #4389
Fixes #4407

This PR "future-proofs" the learner analytics logging infrastructure by:

  • Introducing separate event names that should be more understandable to data analysts than used in the Kenya version of the app (though compatibility is still kept with existing Kenya logged metrics by means of a separate implementation used only in that build of the app).
  • Logging a new event_type parameter that contains the actual proto integer of the event rather than just logging a string representation (so that we can rename both the events in code, and the corresponding strings logged to Firebase). The event names, at this point, act as a nice point-of-reference while analyzing events but are no longer meant to be the primary identifying keys for events (event_type should be used for this purpose, instead).
  • The device's Android SDK version, the app's version name, and the app's version code are now logged with all events for better event dimension slicing and analysis.
  • Effort is now made to ensure event names don't exceed 40 characters (Firebase's limit) to help avoid events being potentially rejected during upload.

Specifics about tests and exemptions:

  • EventTypeToHumanReadableNameConverter is exempted from tests since it's an interface.
  • KenyaAlphaEventTypeToHumanReadableNameConverterImpl is exempted from tests since it's temporary, and its values are at least indirectly tested through KenyaAlphaEventBundleCreatorTest.
  • KenyaAlphaEventBundleCreatorTest was added as a fork of EventBundleCreatorTest to ensure the existing Kenya-specific event names are properly logged, but it will be removed in the future (as tracked by Remove Kenya user study specific constructs once study is over #4419). Note that this suite wasn't updated to verify the new fields like EventBundleCreatorTest was.
  • A BUILD.bazel file was added for the existing logging/firebase and logging/performancemetrics tests since one was added for the tests under logging/ (and subpackages must also have BUILD files if parent packages do).

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

N/A -- This is a metrics infrastructure change that will have zero effect on the UI (except maybe how events are displayed in the developer options menu, but that's not important to include here since it isn't end user-facing).

This simplifies application component management significantly and
allows individual build flavors to have their own unique module lists.
This also introduces dedicated beta & GA build flavors which is a
necessary prerequisite.

It also introduces an extra beta, alpha, and dev mode labels for the splash
screen (the latter 2 were extra) with 2 second minimum wait timers for
beta and alpha to ensure they are seen. A 5-second safety timer was
added to ensure the splash screen can always be passed even if something
goes wrong at the domain level (since there are now quite a few moving
pieces to determine the user's current onboarding state).
This new build flavor automatically enables the study-specific learner
study feature flag.
This is mainly done by:
1. Logging an immutable event type for each event and de-coupling the
event names so that the latter can be changed over time to improve event
management quality-of-life.

2. Logging the Android SDK version, app version name, and app version
code with each event.

3. Ensuring the existing Kenya-specific alpha versions of the app
continue to use their existing event names so that historical data can
be matched (since those queries rely on event names rather than this new
event type).
@oppiabot
Copy link

oppiabot bot commented Jul 11, 2022

Hi @BenHenning, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Jul 11, 2022
@oppiabot oppiabot bot closed this Jul 18, 2022
@BenHenning BenHenning reopened this Jul 18, 2022
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Jul 18, 2022
@oppiabot
Copy link

oppiabot bot commented Jul 25, 2022

Hi @BenHenning, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Jul 25, 2022
@oppiabot oppiabot bot closed this Aug 1, 2022
There's a bunch left to do here, this is mainly needed so that I can
transfer changes to a different machine.
@BenHenning BenHenning reopened this Aug 2, 2022
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Aug 2, 2022
@oppiabot
Copy link

oppiabot bot commented Aug 9, 2022

Hi @BenHenning, I'm going to mark this PR as stale because it hasn't had any updates for 7 days. If no further activity occurs within 7 days, it will be automatically closed so that others can take up the issue.
If you are still working on this PR, please make a follow-up commit within 3 days (and submit it for review, if applicable). Please also let us know if you are stuck so we can help you!

@oppiabot oppiabot bot added the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Aug 9, 2022
@oppiabot oppiabot bot closed this Aug 16, 2022
Conflicts:
	build_flavors.bzl
	scripts/assets/test_file_exemptions.textproto
…oduce-beta-ga-notices

Conflicts:
	.github/workflows/build_tests.yml
	build_flavors.bzl
	scripts/assets/test_file_exemptions.textproto
	version.bzl
@BenHenning BenHenning changed the title Fix #4389, #4407: Future-proof event analytics logging infrastructure Fix #4389, #4407: Future-proof event analytics logging infrastructure [Blocked on #4417] Aug 25, 2022
@BenHenning BenHenning reopened this Sep 5, 2022
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Sep 5, 2022
@BenHenning BenHenning changed the base branch from introduce-alpha-kenya-build-flavor to introduce-beta-ga-notices September 5, 2022 05:33
@BenHenning
Copy link
Sponsor Member Author

BenHenning commented Sep 5, 2022

Remaining TODOs before merge:

  • Finish description
  • Review code
  • Bring up-to-date with develop

Conflicts:
	app/src/main/java/org/oppia/android/app/splash/SplashActivityPresenter.kt
…frastructure

Conflicts:
	utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
	utility/src/test/java/org/oppia/android/util/logging/EventBundleCreatorTest.kt
@BenHenning BenHenning self-assigned this Sep 8, 2022
@BenHenning
Copy link
Sponsor Member Author

I've found nothing of concern during the self-review. This PR should be mergeable once it's brought up-to-date with develop and its base PR has been merged.

@BenHenning BenHenning marked this pull request as ready for review September 8, 2022 05:38
Base automatically changed from introduce-beta-ga-notices to develop September 8, 2022 05:40
@BenHenning BenHenning requested a review from a team as a code owner September 8, 2022 05:40
Copy link
Member

@seanlip seanlip left a comment

Choose a reason for hiding this comment

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

LGTM for .github/CODEOWNERS.

@BenHenning
Copy link
Sponsor Member Author

Thanks @seanlip!

@BenHenning BenHenning changed the title Fix #4389, #4407: Future-proof event analytics logging infrastructure [Blocked on #4417] Fix #4389, #4407: Future-proof event analytics logging infrastructure Sep 8, 2022
@oppiabot
Copy link

oppiabot bot commented Sep 8, 2022

Assigning @rt4914 for code owner reviews. Thanks!

@oppiabot oppiabot bot assigned rt4914 Sep 8, 2022
…frastructure

Conflicts:
	utility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
	utility/src/test/java/org/oppia/android/util/logging/EventBundleCreatorTest.kt
…a/oppia-android into future-proof-metrics-infrastructure
@BenHenning
Copy link
Sponsor Member Author

Since this PR is part of broader urgent work for the Beta MR1 release, I'm force-merging this without review. I've self-reviewed it and found no major issues. Furthermore, #4567 is tracking ensuring that this does get reviewed by someone else later after it's been merged.

@BenHenning BenHenning merged commit 1fcd774 into develop Sep 8, 2022
@BenHenning BenHenning deleted the future-proof-metrics-infrastructure branch September 8, 2022 07:40
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.

Make sure analytics include Android version Future-proof metrics infrastructure
3 participants