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 part of #4410, #4300, #2432: Create dedicated alpha application component #4414

Merged
merged 6 commits into from
Aug 19, 2022

Conversation

BenHenning
Copy link
Sponsor Member

@BenHenning BenHenning commented Jul 2, 2022

Explanation

Fixes part of #4410, #4300, and #2432.

This PR refactors the existing approach for managing application-level build dependencies by splitting up OppiaApplication ApplicationComponent into two: one for the developer build, and one for alpha. The existing OppiaApplication was retrofitted to be a base abstract class for both of the flavor-specific applications, and also for the e2e test TestApplication class (which subsequently simplified that).

This has overall resulted in a decrease in complexity since it now allows us to select specific dependencies per flavor of the app which should significantly simplify ongoing release automation work, plus other flavor-specific gating that we may want to do in the future without having to rely on a human to manually enable/disable certain modules during release time.

A few other small things of note:

  • ApplicationContext was removed since it seems to be barely used, and is confusing compared to the regular Context binding that's used almost everywhere
  • This PR has led to the app module application package having its own Bazel BUILD file (which is a nice help toward continued modularization work)
  • Most of this PR is tested by observing that the corresponding builds still work as expected, other than the changes to the manifest transformation utility
  • A bunch of the new classes have been exempted for requiring tests since they (mostly) cannot be effectively tested, or are maintaining the status quo for testing these classes

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 an infrastructure-only change.

This simplifies application component management significantly and
allows individual build flavors to have their own unique module lists.
@oppiabot
Copy link

oppiabot bot commented Jul 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 Jul 9, 2022
@oppiabot oppiabot bot closed this Jul 16, 2022
@BenHenning BenHenning reopened this Jul 16, 2022
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Jul 16, 2022
@oppiabot
Copy link

oppiabot bot commented Jul 29, 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 29, 2022
@oppiabot oppiabot bot closed this Aug 5, 2022
@BenHenning BenHenning reopened this Aug 5, 2022
@oppiabot oppiabot bot removed the stale Corresponds to items that haven't seen a recent update and may be automatically closed. label Aug 5, 2022
@oppiabot
Copy link

oppiabot bot commented Aug 13, 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 stale Corresponds to items that haven't seen a recent update and may be automatically closed. and removed stale Corresponds to items that haven't seen a recent update and may be automatically closed. labels Aug 13, 2022
@BenHenning BenHenning self-assigned this Aug 17, 2022
@BenHenning BenHenning marked this pull request as ready for review August 17, 2022 09:03
@BenHenning
Copy link
Sponsor Member Author

Force-merging this due to the time sensitivity of the release for which it's tied. I've review the PR myself, but I'll make sure it's reviewed post-merge.

@BenHenning BenHenning merged commit 7562fdf into develop Aug 19, 2022
@BenHenning BenHenning deleted the create-dedicated-alpha-application-component branch August 19, 2022 00:26
BenHenning added a commit that referenced this pull request Aug 19, 2022
## Explanation
Fixes #4410

This PR builds on #4414 by introducing a new alpha component that's specific to the team's ongoing research project in Kenya. This build serves three benefits:
1. It allows us to ensure end users can easily distinguish between alpha & study-specific alpha flavors of the app (since they will now have different build flavors).
2. It ensures we can explicitly version the binaries such that the study binary always takes precedence on Play Store.
3. It allows us to define study-specific parameters without needing manual changes during release (such as automatically enabling the learner study feature, which this PR is doing for the new build flavor).

A few important things to note:
- There are no new tests for the new components since they are mostly uninteresting to test (similar to other build flavor components).
- The new components are temporary are will be reoved (#4419 is tracking this).
- This PR is a recreation of #4420 since the new build flavor was being originally being introduced after the new beta & GA flavors (but this is no longer the case due to the beta release being delayed).
- The new build flavor is not being added to CI build tests mainly because it's unlikely for this build to break versus the alpha build (as the two are so similar), and because of the temporary nature of this version of the app.
- The new classes needed to be exempted for Gradle builds since Gradle was having difficulty with the fact that the new study-specific alpha component was a separate Dagger graph (our Gradle configuration, unlike Bazel, can't manage multiple Dagger graphs in the same build tree). This seems like a reasonable thing to do since the study-specific version of the app can't be built on Gradle, anyway.
This 
## Essential Checklist
- [x] 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: ...".)
- [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation.
- [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).

## For UI-specific PRs only
This PR has no user-facing side effects except the fact that the version name is different now for the study-specific version of the app (which doesn't seem particularly important to show a video/screenshot for).

Commits:

* Create dedicated alpha application component.

This simplifies application component management significantly and
allows individual build flavors to have their own unique module lists.

* Fix broken test per earlier changes.

* Add Kenya study-specific alpha build flavor.

This new build flavor automatically enables the study-specific learner
study feature flag.

Cherry-pick of eef2f4c from the
original #4420.

* Update build_flavors.bzl

Remove beta version declaration since that doesn't belong in this branch.

* Post-CP fixes.

* Fix Gradle builds.

* Update TransformAndroidManifestTest.kt

Correct typos.
@BenHenning BenHenning restored the create-dedicated-alpha-application-component branch August 25, 2022 04:19
@BenHenning BenHenning deleted the create-dedicated-alpha-application-component branch August 25, 2022 04:19
@BenHenning BenHenning restored the create-dedicated-alpha-application-component branch September 5, 2022 01:04
@BenHenning BenHenning deleted the create-dedicated-alpha-application-component branch September 5, 2022 01:05
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.

None yet

1 participant