Skip to content

Commit

Permalink
Merge branch 'master' into master-release
Browse files Browse the repository at this point in the history
  • Loading branch information
Rkareko committed Nov 24, 2023
2 parents 111c662 + 704d753 commit a25182b
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 23 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ env:
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: "fhir" # change this to invalidate cache

concurrency:
# github.head_ref uniquely identifies Pull Requests (but is not available when building branches like main or master)
# github.ref is the fallback used when building for workflows triggered by push
# Note that || are fallback values (not "concatenations")
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true # Use e.g. ${{ github.ref != 'refs/heads/main' }} (or master, until #2180) to only cancel for PRs not on branch

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Build will compile APK, test APK and run tests, lint, etc.
Expand All @@ -49,10 +56,6 @@ jobs:

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Cancel previous
uses: styfle/cancel-workflow-action@0.12.0
with:
access_token: ${{ github.token }}

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repo
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ on:
schedule:
- cron: '32 13 * * 2'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || || github.run_id }}
cancel-in-progress: true

jobs:
analyze:
name: Analyze
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/runFlank.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Fail on any error.
set -e

lib_names=("workflow:benchmark" "engine:benchmark" "datacapture" "engine" "knowledge" "workflow")
firebase_pids=()

for lib_name in "${lib_names[@]}"; do
./gradlew :$lib_name:runFlank --scan --stacktrace &
firebase_pids+=("$!")
done

for firebase_pid in ${firebase_pids[*]}; do
wait $firebase_pid
done
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.22.0")

implementation("com.android.tools.build:gradle:8.1.2")
implementation("com.android.tools.build:gradle:8.1.4")

implementation("app.cash.licensee:licensee-gradle-plugin:1.8.0")
implementation("com.osacky.flank.gradle:fladle:0.17.4")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ internal fun Search.getQuery(
filterArgs.addAll(it.args)
}
val whereArgs = mutableListOf<Any>()
val nestedArgs = mutableListOf<Any>()
val query =
when {
isCount -> {
Expand All @@ -311,11 +312,12 @@ internal fun Search.getQuery(
nestedContext != null -> {
whereArgs.add(nestedContext.param.paramName)
val start = "${nestedContext.parentType.name}/".length + 1
nestedArgs.add(nestedContext.parentType.name)
// spotless:off
"""
SELECT resourceUuid
FROM ResourceEntity a
WHERE a.resourceId IN (
WHERE a.resourceType = ? AND a.resourceId IN (
SELECT substr(a.index_value, $start)
FROM ReferenceIndexEntity a
$sortJoinStatement
Expand All @@ -342,7 +344,7 @@ internal fun Search.getQuery(
.split("\n")
.filter { it.isNotBlank() }
.joinToString("\n") { it.trim() }
return SearchQuery(query, sortArgs + type.name + whereArgs + filterArgs + limitArgs)
return SearchQuery(query, nestedArgs + sortArgs + type.name + whereArgs + filterArgs + limitArgs)
}

private val Order?.sqlString: String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1827,7 +1827,7 @@ class SearchTest {
AND a.resourceUuid IN (
SELECT resourceUuid
FROM ResourceEntity a
WHERE a.resourceId IN (
WHERE a.resourceType = ? AND a.resourceId IN (
SELECT substr(a.index_value, 9)
FROM ReferenceIndexEntity a
WHERE a.resourceType = ? AND a.index_name = ?
Expand All @@ -1844,6 +1844,7 @@ class SearchTest {
assertThat(query.args)
.isEqualTo(
listOf(
ResourceType.Patient.name,
ResourceType.Patient.name,
ResourceType.Condition.name,
Condition.SUBJECT.paramName,
Expand Down Expand Up @@ -1906,7 +1907,7 @@ class SearchTest {
AND a.resourceUuid IN (
SELECT resourceUuid
FROM ResourceEntity a
WHERE a.resourceId IN (
WHERE a.resourceType = ? AND a.resourceId IN (
SELECT substr(a.index_value, 9)
FROM ReferenceIndexEntity a
WHERE a.resourceType = ? AND a.index_name = ?
Expand All @@ -1931,6 +1932,7 @@ class SearchTest {
ResourceType.Patient.name,
Patient.ADDRESS_COUNTRY.paramName,
"IN",
ResourceType.Patient.name,
ResourceType.Immunization.name,
Immunization.PATIENT.paramName,
ResourceType.Immunization.name,
Expand Down Expand Up @@ -1974,7 +1976,7 @@ class SearchTest {
AND a.resourceUuid IN (
SELECT resourceUuid
FROM ResourceEntity a
WHERE a.resourceId IN (
WHERE a.resourceType = ? AND a.resourceId IN (
SELECT substr(a.index_value, 9)
FROM ReferenceIndexEntity a
WHERE a.resourceType = ? AND a.index_name = ?
Expand All @@ -1986,7 +1988,7 @@ class SearchTest {
) AND a.resourceUuid IN(
SELECT resourceUuid
FROM ResourceEntity a
WHERE a.resourceId IN (
WHERE a.resourceType = ? AND a.resourceId IN (
SELECT substr(a.index_value, 9)
FROM ReferenceIndexEntity a
WHERE a.resourceType = ? AND a.index_name = ?
Expand All @@ -2003,13 +2005,15 @@ class SearchTest {
assertThat(query.args)
.isEqualTo(
listOf(
ResourceType.Patient.name,
ResourceType.Patient.name,
ResourceType.Condition.name,
Condition.SUBJECT.paramName,
ResourceType.Condition.name,
Condition.CODE.paramName,
"44054006",
"http://snomed.info/sct",
ResourceType.Patient.name,
ResourceType.Condition.name,
Condition.SUBJECT.paramName,
ResourceType.Condition.name,
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# see https://docs.gradle.org/current/userguide/platforms.html

[versions]
glide = "4.14.2"
glide = "4.16.0"

[libraries]
glide = { module = "com.github.bumptech.glide:glide", version.ref = "glide" }
Expand Down
11 changes: 1 addition & 10 deletions kokoro/gcp_ubuntu/kokoro_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,7 @@ function build_only() {
function device_tests() {
./gradlew packageDebugAndroidTest --scan --stacktrace
./gradlew packageReleaseAndroidTest --scan --stacktrace
local lib_names=("workflow:benchmark" "engine:benchmark" "datacapture" "engine" "knowledge" "workflow")
firebase_pids=()
for lib_name in "${lib_names[@]}"; do
./gradlew :$lib_name:runFlank --scan --stacktrace &
firebase_pids+=("$!")
done

for firebase_pid in ${firebase_pids[*]}; do
wait $firebase_pid
done
.github/workflows/runFlank.sh
}

# Generates JaCoCo reports and uploads to Codecov: https://about.codecov.io/
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ buildscript {
classpath("com.fasterxml.jackson.core:jackson-annotations:2.15.3")
classpath("com.fasterxml.jackson.core:jackson-databind:2.15.3")
classpath("com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.15.3")
classpath("com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.15.3")
classpath("com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.16.0")
classpath("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.3")
classpath("com.fasterxml.jackson.module:jackson-module-kotlin:2.15.3")
}
Expand Down

0 comments on commit a25182b

Please sign in to comment.