Skip to content

Commit

Permalink
Merge branch 'develop' into release/3.1.0.1
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/java/org/dhis2/usescases/programEventDetail/ProgramEventDetailActivity.kt
#	form/src/main/java/org/dhis2/form/model/FieldUiModelImpl.kt
#	form/src/main/java/org/dhis2/form/ui/FormView.kt
#	form/src/main/java/org/dhis2/form/ui/event/RecyclerViewUiEvents.kt
#	gradle/libs.versions.toml
  • Loading branch information
andresmr committed Dec 5, 2024
2 parents f4d6779 + c1dd07e commit 4160a9d
Show file tree
Hide file tree
Showing 99 changed files with 1,207 additions and 2,115 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/release-generate-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,16 @@ jobs:
steps:

- uses: actions/checkout@v3
with:
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}

# Generate github release notes
- name: Generate release notes
working-directory: ./scripts
run: python3 generateReleaseNotes.py

- name: setup git config
run: |
# setup the username and email.
git config user.name "GitHub Actions Bot"
git config user.email "<[email protected]>"
- name: Commit changes
run: |
# Commit and push
git commit -am "Update release notes"
git push
uses: flex-development/[email protected]
with:
message: "Update release notes"
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}
78 changes: 45 additions & 33 deletions .github/workflows/release-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@

name: Release start

# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
release_version_name:
description: 'New release version name'
Expand All @@ -18,72 +15,87 @@ on:
required: true
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
create_branch:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
RELEASE_VERSION: ${{ inputs.release_version_name }}
RELEASE_BRANCH: 'release/${{ inputs.release_version_name }}'
TEMP_RELEASE_BRANCH: 'tmp_release/${{ inputs.release_version_name }}'

steps:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12.1

- name: setup git config
# Creates an auxiliary branch. This branch will be used to create the signed commit using the GH API.
# It is required to use an auxiliary branch because the RELEASE_BRANCH is protected and the GH API
# rejects the commit even though the user identified by the token is included in the bypass list.
- name: Create auxiliary branch
run: |
# setup the username and email.
git config user.name "GitHub Actions Bot"
git config user.email "<[email protected]>"
# override vName with new version
- name: Create release branch
run: git checkout -b release/${{ inputs.release_version_name }}
git checkout -b ${{ env.TEMP_RELEASE_BRANCH }}
git push origin ${{ env.TEMP_RELEASE_BRANCH }}
- name: Run Python script to update release branch version
run: python scripts/updateVersionName.py ${{ inputs.release_version_name }}
run: python scripts/updateVersionName.py ${{ env.RELEASE_VERSION }}

# Uses the GH API to create the signed commit.
- name: Commit and Push Changes to auxiliary branch
uses: flex-development/[email protected]
with:
message: 'Update version to ${{ env.RELEASE_VERSION }}'
ref: ${{ env.TEMP_RELEASE_BRANCH }}
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}

- name: Push
# Fetch the remote commit (signed commit) and create a new branch with the RELEASE_BRANCH name.
# This is required because the RELEASE_BRANCH is protected.
- name: Create and push release branch
run: |
git add .
git commit -m "Update version to ${{ inputs.release_version_name }}"
git push origin release/${{ inputs.release_version_name }}
git reset --hard
git pull origin ${{ env.TEMP_RELEASE_BRANCH }}
git checkout -b ${{ env.RELEASE_BRANCH }}
git push origin ${{ env.RELEASE_BRANCH }}
git push origin --delete ${{ env.TEMP_RELEASE_BRANCH }}
update_version:
# The type of runner that the job will run on
runs-on: ubuntu-latest
env:
DEVELOPMENT_VERSION: ${{ inputs.development_version_name }}
DEVELOPMENT_BRANCH: 'update_version_to${{ inputs.development_version_name }}'

steps:
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12.1

- name: setup git config
- name: Create development branch
run: |
# setup the username and email.
git config user.name "GitHub Actions Bot"
git config user.email "<[email protected]>"
- name: Create release branch
run: git checkout -b update_version_to${{ inputs.development_version_name }}
git checkout -b ${{ env.DEVELOPMENT_BRANCH }}
git push origin ${{ env.DEVELOPMENT_BRANCH }}
- name: Run Python script to update base branch version
run: python scripts/updateVersionName.py ${{ inputs.development_version_name }}
run: python scripts/updateVersionName.py ${{ env.DEVELOPMENT_VERSION }}

- name: Commit and Push Changes
run: |
git add .
git commit -m "Update version to ${{ inputs.development_version_name }}"
git push origin update_version_to${{ inputs.development_version_name }}
uses: flex-development/[email protected]
with:
message: 'Update version to ${{ env.DEVELOPMENT_VERSION }}'
ref: ${{ env.DEVELOPMENT_BRANCH }}
token: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}

- name: create pull request
run: gh pr create -B develop -H update_version_to${{ inputs.development_version_name }} --title 'Merge update_version_to${{ inputs.development_version_name }} into develop' --body 'Created by Github action'
- name: Create pull request
run: gh pr create -B develop -H update_version_to${{ env.DEVELOPMENT_VERSION }} --title 'Merge ${{ env.DEVELOPMENT_BRANCH }} into develop' --body 'Created by Github action'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .tx/config
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
[main]
host = https://www.transifex.com
lang_map = fa_AF: prs, uz@Cyrl: uz, uz@Latn: b+uz+Latn, zh_CN: zh-rCN, pt_BR: pt-rBR, es_419: b+es+419
lang_map = fa_AF: prs, uz@Cyrl: uz, uz@Latn: b+uz+Latn, zh_CN: zh-rCN, pt_BR: pt-rBR,
es_419: b+es+419, ar_EG: ar-rEG, sw_TZ: sw-rTZ, hi_IN: hi, en_US: en-rUS, ar_IQ: ar-rIQ,
ko_KR: ko-rKR, zh_HK: zh-rHK, ar_SD: ar-rSD

[o:hisp-uio:p:dhis2-android-capture-app:r:stock-strings-xml]
file_filter = stock-usecase/src/main/res/values-<lang>/strings.xml
source_file = stock-usecase/src/main/res/values/strings.xml
source_lang = en
type = ANDROID
minimum_perc = 0
resource_name = LMIS

[o:hisp-uio:p:dhis2-android-capture-app:r:analytics-strings-xml]
file_filter = dhis_android_analytics/src/main/res/values-<lang>/strings.xml
Expand Down
5 changes: 4 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
//Sets cron schedule just for PUSH job
String cron_string = JOB_NAME.startsWith('android-multibranch-PUSH') ? '0 0 * * *' : ''

pipeline {
agent {
label "ec2-android"
}

triggers {
cron('0 0 * * *')
cron(cron_string)
}

options {
Expand Down
9 changes: 0 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,6 @@ dependencies {

coreLibraryDesugaring(libs.desugar)

debugImplementation(libs.analytics.flipper)
debugImplementation(libs.analytics.soloader)
debugImplementation(libs.analytics.flipper.network)
debugImplementation(libs.analytics.flipper.leak)
debugImplementation(libs.analytics.leakcanary)

releaseImplementation(libs.analytics.leakcanary.noop)
releaseImplementation(libs.analytics.flipper.noop)

"dhisPlayServicesImplementation"(libs.google.auth)
"dhisPlayServicesImplementation"(libs.google.auth.apiphone)

Expand Down
37 changes: 0 additions & 37 deletions app/src/androidTest/java/org/dhis2/common/filters/FiltersRobot.kt
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
package org.dhis2.common.filters

import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.TypeTextAction
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.PickerActions
import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.matcher.ViewMatchers.withId
import org.dhis2.R
import org.dhis2.common.BaseRobot
import org.dhis2.common.matchers.DatePickerMatchers.Companion.matchesDate
import org.dhis2.commons.filters.FilterHolder

fun filterRobotCommon(robotBody: FiltersRobot.() -> Unit) {
FiltersRobot().apply {
Expand All @@ -19,43 +14,11 @@ fun filterRobotCommon(robotBody: FiltersRobot.() -> Unit) {
}

class FiltersRobot : BaseRobot() {
fun openFilterAtPosition(position: Int) {
onView(withId(R.id.filterRecyclerLayout)).perform(
RecyclerViewActions.actionOnItemAtPosition<FilterHolder>(position, click())
)
}

fun clickOnFromToDateOption() {
onView(withId(R.id.fromTo)).perform(click())
}

fun clickOnOrgUnitTree() {
onView(withId(R.id.ouTreeButton)).perform(click())
}

fun selectDate(year: Int, monthOfYear: Int, dayOfMonth: Int) {
onView(withId(R.id.datePicker)).perform(
PickerActions.setDate(year, monthOfYear, dayOfMonth)
)
}

fun typeOrgUnit(orgUnitName: String) {
onView(withId(R.id.orgUnitSearchEditText)).perform(TypeTextAction(orgUnitName))
}

fun clickAddOrgUnit() {
onView(withId(R.id.addButton)).perform(click())
}

fun selectNotSyncedState() {
onView(withId(R.id.stateNotSynced)).perform(click())
}

fun acceptDateSelected() {
onView(withId(R.id.acceptBtn)).perform(click())
}

fun checkDate(year: Int, monthOfYear: Int, dayOfMonth: Int) {
onView(withId(R.id.datePicker)).check(matches(matchesDate(year, monthOfYear, dayOfMonth)))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class KeyStoreRobot(private val keystore: AndroidSecureStore) {
}

companion object {
const val KEYSTORE_USERNAME = "username"
const val KEYSTORE_USERNAME = "android"
const val KEYSTORE_PASSWORD = "password"
const val USERNAME = "android"
const val PASSWORD = "Android123"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ class MockWebServerRobot(private val dhis2MockServer: Dhis2MockServer) {
}

companion object {
const val API_OLD_TRACKED_ENTITY_PATH = "/api/trackedEntityInstances/query?.*"
const val API_OLD_TRACKED_ENTITY_RESPONSE =
"mocks/teilist/old_tracked_entity_empty_response.json"
const val API_OLD_EVENTS_PATH = "/api/events?.*"
const val API_OLD_EVENTS_RESPONSE = "mocks/teilist/old_events_empty_response.json"

const val API_TRACKED_ENTITY_ATTRIBUTES_RESERVED_VALUES_PATH =
"/api/trackedEntityAttributes/lZGmxYbs97q/generateAndReserve?.*"
const val API_TRACKED_ENTITY_ATTRIBUTES_RESERVED_VALUES_RESPONSE =
"mocks/teidashboard/tracked_entity_attribute_reserved_values.json"
const val API_TRACKED_ENTITY_PATH = "/api/tracker/trackedEntities?.*"
const val API_TRACKED_ENTITY_EMPTY_RESPONSE =
"mocks/teilist/tracked_entity_empty_response.json"
const val API_EVENTS_PATH = "/api/tracker/events?.*"
const val API_EVENTS_EMPTY_RESPONSE = "mocks/teilist/events_empty_response.json"
}
}
Loading

0 comments on commit 4160a9d

Please sign in to comment.