Skip to content

Commit

Permalink
Merge branch 'main' into pld-add-codeql
Browse files Browse the repository at this point in the history
  • Loading branch information
pld authored Jul 17, 2023
2 parents 057cc81 + ffaa1a2 commit 58fe27f
Show file tree
Hide file tree
Showing 694 changed files with 25,606 additions and 23,766 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Fixes #[issue number] or Closes #[issue number]
- [ ] I have updated the [CHANGELOG.md](./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**
Expand Down
44 changes: 19 additions & 25 deletions .github/workflows/apk-release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Quest APK Release
name: OpenSRP APK Release

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+
- v[0-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+-[0-9a-zA-Z]+
- v[0-9]+.[0-9]+.[0-9]+-opensrp
- v[0-9]+.[0-9]+.[0-9]+-opensrp-[0-9a-zA-Z]+
env:
FHIRCORE_USERNAME: ${{ secrets.FHIRCORE_USERNAME }}
FHIRCORE_ACCESS_TOKEN: ${{ secrets.FHIRCORE_ACCESS_TOKEN }}
Expand Down Expand Up @@ -60,26 +59,22 @@ jobs:
run: echo $KEYSTORE_PROPERTIES | base64 -di > keystore.properties
working-directory: android
env:
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}

- name: Spotless check quest application
run: ./gradlew :quest:spotlessCheck
working-directory: android
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}

- name: Generate AAB (Android App Bundle) file
if: ${{ false }}
run: ./gradlew :quest:bundle${{steps.product-flavor.outputs.idCapitalized}} -x :quest:test${{steps.product-flavor.outputs.idCapitalized}}DebugUnitTest --stacktrace
working-directory: android
# - name: Generate AAB (Android App Bundle) file
# if: ${{ false }}
# run: ./gradlew :quest:bundle${{steps.product-flavor.outputs.idCapitalized}} -x :quest:test${{steps.product-flavor.outputs.idCapitalized}}DebugUnitTest --stacktrace
# working-directory: android

- name: Upload AAB file to tag assets
if: ${{ false }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: android/quest/build/outputs/bundle/${{steps.product-flavor.outputs.id}}/release/quest-${{steps.product-flavor.outputs.id}}-release.aab
asset_name: "quest-$tag.aab"
tag: ${{ github.ref }}
overwrite: true
# - name: Upload AAB file to tag assets
# if: ${{ false }}
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: android/quest/build/outputs/bundle/${{steps.product-flavor.outputs.id}}/release/quest-${{steps.product-flavor.outputs.id}}-release.aab
# asset_name: "$tag.aab"
# tag: ${{ github.ref }}
# overwrite: true

- name: Generate APK (Android App PacKage) file
run: ./gradlew :quest:assemble${{steps.product-flavor.outputs.idCapitalized}} -x :quest:test${{steps.product-flavor.outputs.idCapitalized}}DebugUnitTest --stacktrace
Expand All @@ -90,8 +85,7 @@ jobs:
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: android/quest/build/outputs/apk/${{steps.product-flavor.outputs.id}}/release/quest-${{steps.product-flavor.outputs.id}}-release.apk
asset_name: "quest-$tag.apk"
asset_name: "opensrp-$(echo $tag | cut -d- -f1).apk"
tag: ${{ github.ref }}
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') }}
prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }}
overwrite: true

24 changes: 13 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

Expand Down Expand Up @@ -47,7 +45,7 @@ jobs:
uses: gradle/gradle-build-action@v2

- name: Spotless check engine module
run: ./gradlew :engine:spotlessCheck --stacktrace
run: ./gradlew -PlocalPropertiesFile=local.properties :engine:spotlessCheck :engine:ktlintCheck --stacktrace
working-directory: android

- name: Load AVD cache
Expand Down Expand Up @@ -80,7 +78,7 @@ jobs:
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew :engine:clean && ./gradlew :engine:fhircoreJacocoReport --stacktrace
script: ./gradlew -PlocalPropertiesFile=local.properties :engine:clean :engine:fhircoreJacocoReport --stacktrace

- name: Upload Engine module test coverage report to Codecov
if: matrix.api-level == 30 # Only upload coverage on API level 30
Expand Down Expand Up @@ -119,7 +117,7 @@ jobs:
uses: gradle/gradle-build-action@v2

- name: Spotless check geowidget module
run: ./gradlew :geowidget:spotlessCheck --stacktrace
run: ./gradlew -PlocalPropertiesFile=local.properties :geowidget:spotlessCheck --stacktrace
working-directory: android

- name: Load AVD cache
Expand Down Expand Up @@ -152,7 +150,7 @@ jobs:
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew :geowidget:clean && ./gradlew :geowidget:fhircoreJacocoReport --stacktrace
script: ./gradlew -PlocalPropertiesFile=local.properties :geowidget:clean :geowidget:fhircoreJacocoReport --stacktrace

- name: Upload Geowidget module test coverage report to Codecov
if: matrix.api-level == 30 # Only upload coverage on API level 30
Expand All @@ -165,6 +163,10 @@ jobs:
matrix:
api-level: [30]
steps:
- name: Cancel Previous workflow runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
Expand All @@ -177,16 +179,16 @@ jobs:

- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: android
working-directory: android

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties && cat ~/.gradle/gradle.properties

- name: Setup Gradle cache
uses: gradle/gradle-build-action@v2

- name: Spotless check quest application
run: ./gradlew :quest:spotlessCheck
run: ./gradlew -PlocalPropertiesFile=local.properties :quest:spotlessCheck --stacktrace :quest:ktlintCheck --stacktrace
working-directory: android

- name: Load AVD cache
Expand Down Expand Up @@ -216,10 +218,10 @@ jobs:
working-directory: android
api-level: ${{ matrix.api-level }}
arch: x86_64
force-avd-creation: false
force-avd-creation: true
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: ./gradlew :quest:clean && ./gradlew :quest:fhircoreJacocoReport --stacktrace
script: ./gradlew -PlocalPropertiesFile=local.properties :quest:clean :quest:fhircoreJacocoReport --stacktrace

- name: Upload Quest module test coverage report to Codecov
if: matrix.api-level == 30 # Only upload coverage on API level 30
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: Docs
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build-and-deploy-docusaurus:
Expand Down Expand Up @@ -63,6 +61,6 @@ jobs:
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: android/docs # The folder the action should deploy.
folder: android/build/dokka # The folder the action should deploy.
target-folder: dokka

65 changes: 65 additions & 0 deletions .github/workflows/sonarqube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: SonarQube Analysis

on:
push:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Cancel previous workflow runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Check out codebase
uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache SonarQube packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle

- name: Decode & Generate Keystore file
run: echo $ENCODED_KEYSTORE | base64 -di > "${HOME}"/fhircore.keystore.jks
env:
ENCODED_KEYSTORE: ${{ secrets.KEYSTORE_FILE }}

- name: Decode & Generate local.properties file
run: echo $LOCAL_PROPERTIES | base64 -di > local.properties
working-directory: android
env:
LOCAL_PROPERTIES: ${{ secrets.LOCAL_PROPERTIES }}

- name: Decode & Generate keystore.properties file
run: echo $KEYSTORE_PROPERTIES | base64 -di > keystore.properties
working-directory: android
env:
KEYSTORE_PROPERTIES: ${{ secrets.KEYSTORE_PROPERTIES }}

- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
run: ./gradlew sonar --stacktrace
working-directory: android
89 changes: 86 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,98 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.2] - 2023-xx-xx
## [0.2.4] - 2023-06-24
### Added
- Insights feature to show stats on any _Unsynced_ Resources on the device
- Generic date service function to add or subtract days, weeks, months or years from/to current date
- Add ability to configure resource Id used to open profiles

### Fixed
- Order the Registers after every form interaction tied to it
- Refactor register search to use SDK Search API to perform database query
- Incorrect error shown for failed authentication when the credentials are invalid.
- [P2P] Possible p2p sync slow regression #2536

### Changed
-


## [0.2.3] - 2023-06-24
### Added
- Allow completion of Overdue Tasks
- Allow ordering of registers by related resources last updated
- Invalidation/refresh cache after form completion
- Button background color app configurability
- Use _revinclude when fetching related resources to improve performance
- Refactor handling of questionnaire submission to use generic event bus
- Refactor register search to support configurable forward or reverse include
- Add "Record all" feature in card view
- Functionality to aggregate count for related resources
- Incremental rendering of content of LIST widget used mostly on profile screen
- The ability to define a regex and separator on the `RulesFactory.RulesEngineService#joinToString(java.util.List<java.lang.String>, java.lang.String, java.lang.String)`
- Use Sentry to track and monitor performance bottlenecks on quest and FHIR Core release app variants
- Add functionality to allow usage of computed rules on DataQuery values
- Allow configs to pass multiple subjects to measure evaluate interface so we can create reports per another resource (e.g. a MeasureReport per Practitioner)
- Introduce an open function on ViewProperties#interpolate to retrieve values from computed values map
- Update the CarePlan Closure configs to define the PlanDefs to closure separately.
- Configurable population resource using ActionParameter
- Migrate build script to Kotlin DSL
- Sorting of resources via rules engine
- Configuration for sorting LIST widget resources
- Closing CarePlans and Related resources configuration update
- Configuration for button content color
- Configuration for button and overflow menu item icons
- [Event Management] Add support for extra resources to close
- Make other-patients name in menu configurable
- Allow computation of configured rules on `QuestionnaireConfig` e.g. for autogenerating a unique ID for Patient registration
- Additional (optional) `ActionParameter` on `QuestionnaireConfig` class for providing extra data to the Questionnaire
- Added a `limitTo` service function that limits lists sizes to a define limit
- Implement configurable image/icon widget
- Added functionality to filter related resources for list view
- Added the sick child workflow automated closure

### Fixed
- Logout while offline causes flicker(multiple render) of Login Page
- Allow user to complete overdue task
- Allow launching of overflow menu items (Questionnaire/Profile)
- Invalidation/refresh cache after form completion
- Successful subsequent login even when PractitionerDetails is not saved
- Account for dependencies when generating activity schedules
- Add title to Profile pages
- Catch exception when defaultRepository.loadResource tries to load a non-existent resource
- Fix navigate back from Household registers to practitioner profile
- Harmonize launching Questionnaires
- Supply Chain Report Generation fails for some months
- Member icons display wrapping; hiding some texts
- Member icons count on register not tallying with retrieved resources on profile
- Issue with loading related resources
- Fix P2P sync progress showing greater than 100%
- Background worker performance
- The `requested` to `ready` task status update background worker
- Calculate DUE dates for dependent Tasks
- Triggering QuestionnaireResponse extraction for Questionnaires closed via a Confirm Dialog
- Fix the OVERDUE service status setting on the `RulesFactory#generateTaskServiceStatus()`
- Fix change HH head breaking if a HH head is not already assigned
- `Task.status` for tasks created today and DUE today not update to `ready`

### Changed
- Refactored how the related resources SELECT and COUNT queries search results are represented.
- RepositoryResourceData now uses two map to represent SELECT/COUNT SQL query results
- Retrieve related resources all at once for resources include via _include SEARCH API
- Enhanced security in Authentication, Authorization and Credentials managagment

## [0.2.2] - 2023-04-17
### Added
- Filter out inactive families using custom search parameters
- Adds support for text-overflow configurability
- Adds Interpolation for planDefinitions property on QuesitonnaireConfig

### Fixed
- Order the Registers after every form interaction tied to it
- Fixed index already exists exception
- Minor bug fixes for care plan generation
- Fixes app crash when resourceType is not found

### Changed
- Refactor register search to use SDK Search API to perform database query

## [0.2.1] - 2023-03-27
### Added
Expand Down
2 changes: 1 addition & 1 deletion CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fhircore.smartregister.org
docs.opensrp.io
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[![Android CI with Gradle](https://github.com/opensrp/fhircore/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/opensrp/fhircore/actions/workflows/ci.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/opensrp/fhircore/branch/main/graph/badge.svg?token=IJUTHZUGGH)](https://codecov.io/gh/opensrp/fhircore)
[![Codecov Test Coverage](https://codecov.io/gh/opensrp/fhircore/branch/main/graph/badge.svg?token=IJUTHZUGGH)](https://codecov.io/gh/opensrp/fhircore)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![project chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://chat.fhir.org/#narrow/stream/370552-OpenSRP)
[![Zulip Chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://chat.fhir.org/#narrow/stream/370552-OpenSRP)
[![Slack Chat](https://img.shields.io/badge/slack-join_chat-purple)](https://join.slack.com/t/opensrp/shared_invite/zt-1xvw5fsjo-5RPlKqHmpU57SumJavgCzA)

# OpenSRP FHIR Core

Expand All @@ -23,7 +24,7 @@ For remote data storage and login, the mobile application requires:
FHIRcore also interoperates well with:
- [OpenSRP Web](https://github.com/OpenSRP/web) to access healthcare data from the same HAPI FHIR server.

<img align=center width=400 src="docs/assets/fhircore.png">
<img align=center width=400 src="static/img/fhircore.png">

## Getting Started

Expand All @@ -33,7 +34,7 @@ This repository contains the folders
* **[android](android)**: for building the Android application.
* **[docs](docs)**: a library of documents describing the FHIR Core solution.

We recommend reviewing the [docs](https://fhircore.smartregister.org/) before setting up the Android Studio Project in the [android](android) folder.
We recommend reviewing the [docs](https://docs.smartregister.org/) before setting up the Android Studio Project in the [android](android) folder.

For starter resources on the FHIR specification:

Expand Down
Loading

0 comments on commit 58fe27f

Please sign in to comment.