Skip to content

Fix debug mode detection and update eCHIS app configuration#3828

Open
roywanyaga wants to merge 1 commit intomainfrom
fix/debug-mode-detection-and-echis-updates
Open

Fix debug mode detection and update eCHIS app configuration#3828
roywanyaga wants to merge 1 commit intomainfrom
fix/debug-mode-detection-and-echis-updates

Conversation

@roywanyaga
Copy link
Contributor

  • Fix debug mode detection in AppSettingViewModel and ConfigurationRegistry - Check for /debug suffix directly in app ID instead of build variant - Use case-insensitive matching for debug suffix - Skip remote config fetch when using debug mode

  • Update eCHIS flavor configuration

    • Change app label from 'MOH UG eCHIS' to 'eCHIS' (shorter, won't truncate)
    • Remove echisSupervisor product flavor (consolidated into single echis flavor) - Add strings.xml for split screen name customization
  • Add NDK version for 16KB page size support - Set ndkVersion to 27.2.12479018 for Android 15+ compatibility

  • Update dependencies

    • Remove defunct OSSRH Maven repositories (sunset June 30, 2025)
    • Change kujaku-library from 0.10.8-SNAPSHOT to 0.9.0 stable version
  • Add unit tests - Add 6 tests for AppSettingViewModel debug mode detection - Add 7 tests for ConfigurationRegistry debug mode handling - Test coverage for null/empty app IDs, case sensitivity, and whitespace trimming

IMPORTANT: Where possible all PRs must be linked to a Github issue

Fixes [link to issue]

Engineer Checklist

  • I have written Unit tests for any new feature(s) and edge cases for bug fixes
  • I have added any strings visible on UI components to the strings.xml file
  • I have updated the CHANGELOG.md file for any notable changes to the codebase
  • I have run ./gradlew spotlessApply and ./gradlew spotlessCheck to check my code follows the project's style guide
  • I have built and run the FHIRCore app to verify my change fixes the issue and/or does not break the app
  • I have checked that this PR does NOT introduce breaking changes that require an update to Content and/or Configs? If it does add a sample here or a link to exactly what changes need to be made to the content.

Code Reviewer Checklist

  • I have verified Unit tests have been written for any new feature(s) and edge cases
  • I have verified any strings visible on UI components are in the strings.xml file
  • I have verifed the CHANGELOG.md file has any notable changes to the codebase
  • I have verified the solution has been implemented in a configurable and generic way for reuseable components
  • I have built and run the FHIRCore app to verify the change fixes the issue and/or does not break the app

   - Fix debug mode detection in AppSettingViewModel and ConfigurationRegistry
     - Check for /debug suffix directly in app ID instead of build variant
     - Use case-insensitive matching for debug suffix
     - Skip remote config fetch when using debug mode

   - Update eCHIS flavor configuration
     - Change app label from 'MOH UG eCHIS' to 'eCHIS' (shorter, won't truncate)
     - Remove echisSupervisor product flavor (consolidated into single echis flavor)
     - Add strings.xml for split screen name customization

   - Add NDK version for 16KB page size support
     - Set ndkVersion to 27.2.12479018 for Android 15+ compatibility

   - Update dependencies
     - Remove defunct OSSRH Maven repositories (sunset June 30, 2025)
     - Change kujaku-library from 0.10.8-SNAPSHOT to 0.9.0 stable version

   - Add unit tests
     - Add 6 tests for AppSettingViewModel debug mode detection
     - Add 7 tests for ConfigurationRegistry debug mode handling
     - Test coverage for null/empty app IDs, case sensitivity, and whitespace trimming
@roywanyaga roywanyaga requested review from ellykits and qiarie March 3, 2026 13:45
@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.1%. Comparing base (aaebbb6) to head (3200732).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main   #3828     +/-   ##
=========================================
+ Coverage     25.0%   25.1%   +0.1%     
+ Complexity     844     842      -2     
=========================================
  Files          297     297             
  Lines        16102   15832    -270     
  Branches      2689    2631     -58     
=========================================
- Hits          4038    3987     -51     
+ Misses       11580   11368    -212     
+ Partials       484     477      -7     
Flag Coverage Δ
geowidget 21.6% <ø> (+3.0%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...core/engine/configuration/ConfigurationRegistry.kt 62.6% <ø> (+0.8%) ⬆️
...hircore/quest/ui/appsetting/AppSettingViewModel.kt 5.9% <ø> (+<0.1%) ⬆️

... and 11 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

kt3k-coveralls-ver="2.12.0"
ktlint = "0.50.0"
kujaku-library = "0.10.8-SNAPSHOT"
kujaku-library = "0.9.0"
Copy link
Member

Choose a reason for hiding this comment

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

how big are the differences between 0.10.8 with 0.9.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure but 0.10.8 is not working.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a downgrade. Are we able to trace where 0.10.8 was published from? We could republish an update from that

maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots")
// Old OSSRH repos removed - service was sunset June 30, 2025
// See: https://central.sonatype.org/pages/ossrh-eol/
Copy link
Member

Choose a reason for hiding this comment

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

have you tested publishing some artifacts and make sure this url works?

val appId = sharedPreferencesHelper.retrieveApplicationId()?.trim()
if (appId?.endsWith(DEBUG_SUFFIX, ignoreCase = true) == true) {
Timber.d("Skipping remote config fetch - app ID '$appId' has /debug suffix, using local assets")
return
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make this optional/configurable?

kt3k-coveralls-ver="2.12.0"
ktlint = "0.50.0"
kujaku-library = "0.10.8-SNAPSHOT"
kujaku-library = "0.9.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a downgrade. Are we able to trace where 0.10.8 was published from? We could republish an update from that

Comment on lines +101 to +103
// Check directly for /debug suffix, regardless of build variant
appId.endsWith(ConfigurationRegistry.DEBUG_SUFFIX, ignoreCase = true) ->
loadConfigurations(context)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we make this optional?

@ellykits
Copy link
Collaborator

@qiarie can you point the kujaku upgrade PR here. Should fix the issue with the downgrade.

@ellykits
Copy link
Collaborator

This PR is failing CI checks. @roywanyaga or @qiarie

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