8000 Fixes part of #5345 : Introduced Feature Flag Screen by theayushyadav11 · Pull Request #5861 · oppia/oppia-android · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fixes part of #5345 : Introduced Feature Flag Screen #5861

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

Merged
merged 223 commits into from
Jul 7, 2025

Conversation

theayushyadav11
Copy link
Collaborator
@theayushyadav11 theayushyadav11 commented Jun 12, 2025

Fixes part of #5345
This pull request introduces a new "Feature Flags" functionality in the developer options of the app, allowing developers to view and modify feature flags. The changes include adding a new activity, fragment, view models, and necessary wiring to integrate this feature into the existing developer options structure.

Feature Flags Functionality Integration:

  • New Activity and Fragment for Feature Flags:

    • Added FeatureFlagActivity and FeatureFlagFragment to provide a dedicated UI for managing feature flags. (FeatureFlagActivity.kt [1]], FeatureFlagFragment.kt [2]])
    • Added FeatureFlagActivityPresenter and FeatureFlagFragmentPr 10000 esenter to handle the UI logic for the activity and fragment. (FeatureFlagActivityPresenter.kt [1]], FeatureFlagFragmentPresenter.kt [2]])
  • View Models for Feature Flags:

    • Introduced FeatureFlagViewModel and FeatureFlagItemViewModel to manage the state and data of feature flags in the UI. (app/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagItemViewModel.kt [FeatureFlagItemViewModel.ktR1-R12])

Developer Options Updates:

  • Routing to Feature Flags:

    • Added RouteToFeatureFlagsListener interface and implemented it in DeveloperOptionsActivity to enable navigation to the new feature flags activity. (app/src/main/java/org/oppia/android/app/devoptions/RouteToFeatureFlagsListener.kt [1]], DeveloperOptionsActivity.kt [2]], [3]])
  • Integration with Developer Options UI:

    • Updated DeveloperOptionsViewModel and DeveloperOptionsOverrideAppBehaviorsViewModel to include a new option for navigating to the feature flags screen. (app/src/main/java/org/oppia/android/app/devoptions/DeveloperOptionsViewModel.kt [1]], [2]], app/src/main/java/org/oppia/android/app/devoptions/devoptionsitemviewmodel/DeveloperOptionsOverrideAppBehaviorsViewModel.kt [3]], [4]])

Configuration and Dependency Updates:

  • Bazel Build File Updates:

    • Added new files for feature flags to LISTENERS, VIEW_MODELS, and dependencies in BUILD.bazel. (app/BUILD.bazel [1]], [2]], [3]])
  • Manifest and Dependency Injection:

    • Registered FeatureFlagActivity in the Android manifest. (app/src/main/AndroidManifest.xml [app/src/main/AndroidManifest.xmlR307-R310])
    • Updated ActivityComponentImpl to support dependency injection for FeatureFlagActivity. (app/src/main/java/org/oppia/android/app/activity/ActivityComponentImpl.kt [1]], [2]])

Screenshots

Screenshot 1 Screenshot 2

Event Log Screen

Screenshot 2 Screenshot 2

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

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • For PRs introducing new UI elements or color changes, both light and dark mode screenshots must be included
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

BenHenning and others added 30 commits May 31, 2025 15:36
This comes from #5725. These configurations have been adapted for being
interoperable with the existing platform parameter system, but there's
downstream work needed yet for actually making the app build and work.
This removes a bunch of stuff from #5725 but introduces some of the
initial interop pieces needed to work without substantial integration
requirements.

A lot more needs to change yet to get the components properly hooked up
and the app building, not to mention tests.
The dev build actually opens and runs, though it's still relying on the
old parameter values.

This also introduces support for flavor-specific overrides, though they
are as yet untested. These may have been lost at some point in the
development of #5725 since they weren't present in the latest changes.
This actually introduces full interoperability between the new and old
system, and in a way that should guarantee start-up safety (mostly).

Tests still need to be fixed.
Plus some other clean-ups.

This hopefully avoids a dependency explosion for test updates, though of
course this functionality will need to be reintroduced in a later
branch.

This is effectively a no-op since remote syncing is broken in the app.
This also fixes a bunch of tests, but there are a bunch left to go in
order to get tests set up correctly. This is a very strong start,
however.

New tests still need to be added.
This includes removing a lot of old platform parameter test code that
needs to be updated. Otherwise, it's primarily about using the test
platform parameter module in a bunch of places (since that automatically
initializes platform parameters and feature flags for prod code), which
in turn requires AssetModule (and both AssetModule and
TestPlatformParameterModule require explicit dependencies in Bazel).

There are still 31 known failing tests to fix, but the majority have
been addressed in this commit.
This includes adding KDocs and temporary test exemptions, plus removing
the platform parameters static check since it's not really needed
anymore with the new Dagger-bound feature flag map plus other tests for
verifying feature flag logging.
@oppiabot oppiabot bot assigned adhiamboperes and unassigned theayushyadav11 Jul 3, 2025
Copy link
oppiabot bot commented Jul 3, 2025

Unassigning @theayushyadav11 since a re-review was requested. @theayushyadav11, please make sure you have addressed all review comments. Thanks!

Copy link
github-actions bot commented Jul 3, 2025

Coverage Report

Results

Number of files assessed: 16
Overall Coverage: 77.35%
Coverage Analysis: FAIL

Failure Cases

File Failure Reason Status
//app:src/sharedTest/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsFragmentTest Source File: FeatureFlagsFragment.kt not found in the coverage data
//app:src/sharedTest/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsActivityTest Source File: FeatureFlagsActivity.kt not found in the coverage data

Passing coverage

Files with passing code coverage
File Coverage Lines Hit Status Min Required
EventBundleCreator.ktutility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
77.35% 338 / 437 70%

Exempted coverage

Files exempted from coverage
File Exemption Reason
RouteToFeatureFlagsListener.ktapp/src/main/java/org/oppia/android/app/devoptions/RouteToFeatureFlagsListener.kt
This file is exempted from having a test file; skipping coverage check.
DeveloperOptionsActivity.ktapp/src/main/java/org/oppia/android/app/devoptions/DeveloperOptionsActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
FeatureFlagsViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsViewModel.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagsTestActivity.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/testing/FeatureFlagsTestActivity.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagItemViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagsFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagsActivityPresenter.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
DeveloperOptionsOverrideAppBehaviorsViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/devoptionsitemviewmodel/DeveloperOptionsOverrideAppBehaviorsViewModel.kt
This file is exempted from having a test file; skipping coverage check.
EventLogItemViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/vieweventlogs/EventLogItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
DeveloperOptionsViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/DeveloperOptionsViewModel.kt
This file is exempted from having a test file; skipping coverage check.
FragmentComponentImpl.ktapp/src/main/java/org/oppia/android/app/fragment/FragmentComponentImpl.kt
This file is exempted from having a test file; skipping coverage check.
ActivityComponentImpl.ktapp/src/main/java/org/oppia/android/app/activity/ActivityComponentImpl.kt
This file is exempted from having a test file; skipping coverage check.
TestPlatformParameterModule.kttesting/src/main/java/org/oppia/android/testing/platformparameter/TestPlatformParameterModule.kt
This file is exempted from having a test file; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

Copy link
Collaborator
@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

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

Thanks @theayushyadav11! I have a few very minor changes. Should be able to merge by next pass. PTAL.

@theayushyadav11
Copy link
Collaborator Author

Hi @adhiamboperes , I have updated as requested PTAL.

@oppiabot oppiabot bot assigned adhiamboperes and unassigned theayushyadav11 Jul 3, 2025
Copy link
oppiabot bot commented Jul 3, 2025

Unassigning @theayushyadav11 since a re-review was requested. @theayushyadav11, please make sure you have addressed all review comments. Thanks!

Copy link
github-actions bot commented Jul 4, 2025

Coverage Report

Results

Number of files assessed: 16
Overall Coverage: 77.35%
Coverage Analysis: PASS

Passing coverage

Files with passing code coverage
File Coverage Lines Hit Status Min Required
EventBundleCreator.ktutility/src/main/java/org/oppia/android/util/logging/EventBundleCreator.kt
77.35% 338 / 437 70%

Exempted coverage

Files exempted from coverage
File Exemption Reason
RouteToFeatureFlagsListener.ktapp/src/main/java/org/oppia/android/app/devoptions/RouteToFeatureFlagsListener.kt
This file is exempted from having a test file; skipping coverage check.
DeveloperOptionsActivity.ktapp/src/main/java/org/oppia/android/app/devoptions/DeveloperOptionsActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
FeatureFlagsFragment.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsFragment.kt
This file is incompatible with code coverage tooling; skipping coverage check.
FeatureFlagsViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsViewModel.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagsTestActivity.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/testing/FeatureFlagsTestActivity.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagsActivity.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsActivity.kt
This file is incompatible with code coverage tooling; skipping coverage check.
FeatureFlagItemViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagsFragmentPresenter.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsFragmentPresenter.kt
This file is exempted from having a test file; skipping coverage check.
FeatureFlagsActivityPresenter.ktapp/src/main/java/org/oppia/android/app/devoptions/featureflags/FeatureFlagsActivityPresenter.kt
This file is exempted from having a test file; skipping coverage check.
DeveloperOptionsOverrideAppBehaviorsViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/devoptionsitemviewmodel/DeveloperOptionsOverrideAppBehaviorsViewModel.kt
This file is exempted from having a test file; skipping coverage check.
EventLogItemViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/vieweventlogs/EventLogItemViewModel.kt
This file is exempted from having a test file; skipping coverage check.
DeveloperOptionsViewModel.ktapp/src/main/java/org/oppia/android/app/devoptions/DeveloperOptionsViewModel.kt
This file is exempted from having a test file; skipping coverage check.
FragmentComponentImpl.ktapp/src/main/java/org/oppia/android/app/fragment/FragmentComponentImpl.kt
This file is exempted from having a test file; skipping coverage check.
ActivityComponentImpl.ktapp/src/main/java/org/oppia/android/app/activity/ActivityComponentImpl.kt
This file is exempted from having a test file; skipping coverage check.
TestPlatformParameterModule.kttesting/src/main/java/org/oppia/android/testing/platformparameter/TestPlatformParameterModule.kt
This file is exempted from having a test file; skipping coverage check.

Refer test_file_exemptions.textproto for the comprehensive list of file exemptions and their required coverage percentages.

To learn more, visit the Oppia Android Code Coverage wiki page

Copy link
Collaborator
@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

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

Thanks @theayushyadav11! This LGTM.

@adhiamboperes
Copy link
Collaborator

@BenHenning, PTAL for owners.

Copy link
Member
@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Approved for codeowners (I think the main Android manifest was the only file that needed approval).

@BenHenning
Copy link
Member

@theayushyadav11 I think you can bring this up-to-date with the latest develop commit and then start the merge process.

@adhiamboperes
Copy link
Collaborator

Develop was added cleanly, merging.

@adhiamboperes adhiamboperes merged commit 925f80c into develop Jul 7, 2025
38 checks passed
@adhiamboperes adhiamboperes deleted the feature-flag-screen branch July 7, 2025 21:53
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.

4 participants
0