Skip to content

Commit d75b095

Browse files
committed
Merge branch 'fireperf-aqs' into td/aqs-usage
2 parents 3f2b6e7 + 7d9c0bf commit d75b095

File tree

13 files changed

+137
-89
lines changed

13 files changed

+137
-89
lines changed

.github/workflows/dataconnect.yml

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,16 @@ jobs:
6464
with:
6565
node-version: ${{ env.FDC_NODEJS_VERSION }}
6666

67-
- name: install firebase-tools
67+
- name: Install Firebase Tools ("firebase" command-line tool)
6868
run: |
69+
set -euo pipefail
6970
set -v
7071
mkdir -p ${{ env.FDC_FIREBASE_TOOLS_DIR }}
7172
cd ${{ env.FDC_FIREBASE_TOOLS_DIR }}
7273
echo '{}' > package.json
7374
npm install --fund=false --audit=false --save --save-exact firebase-tools@${{ env.FDC_FIREBASE_TOOLS_VERSION }}
7475
75-
- name: Restore Gradle cache
76+
- name: Restore Gradle Cache
7677
id: restore-gradle-cache
7778
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2
7879
if: github.event_name != 'schedule'
@@ -84,9 +85,11 @@ jobs:
8485
restore-keys: |
8586
gradle-cache-jqnvfzw6w7-
8687
87-
- name: tool versions
88+
- name: Print Command-Line Tool Versions
8889
continue-on-error: true
8990
run: |
91+
set -euo pipefail
92+
9093
function run_cmd {
9194
echo "==============================================================================="
9295
echo "Running Command: $*"
@@ -105,6 +108,7 @@ jobs:
105108
106109
- name: Gradle assembleDebugAndroidTest
107110
run: |
111+
set -euo pipefail
108112
set -v
109113
110114
# Speed up build times and also avoid configuring firebase-crashlytics-ndk
@@ -117,23 +121,24 @@ jobs:
117121
${{ (inputs.gradleInfoLog && '--info') || '' }} \
118122
:firebase-dataconnect:assembleDebugAndroidTest
119123
120-
- name: Save Gradle cache
124+
- name: Save Gradle Cache
121125
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2
122126
if: github.event_name == 'schedule'
123127
with:
124128
path: |
125129
~/.gradle/caches
126130
~/.gradle/wrapper
127-
key: ${{ steps.restore-gradle-cache.outputs.cache-primary-key }}
131+
key: gradle-cache-jqnvfzw6w7-${{ github.run_id }}
128132

129-
- name: Enable KVM group permissions for Android Emulator
133+
- name: Enable KVM Group Permissions for Android Emulator
130134
run: |
135+
set -euo pipefail
131136
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
132137
| sudo tee /etc/udev/rules.d/99-kvm4all.rules
133138
sudo udevadm control --reload-rules
134139
sudo udevadm trigger --name-match=kvm
135140
136-
- name: Restore AVD cache
141+
- name: Restore AVD Cache
137142
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2
138143
if: github.event_name != 'schedule'
139144
id: restore-avd-cache
@@ -146,28 +151,30 @@ jobs:
146151
avd-cache-zhdsn586je-api${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}-
147152
148153
- name: Create AVD
149-
if: github.event_name == 'schedule' || steps.restore-avd-cache.outputs.cache-hit != 'true'
154+
if: github.event_name == 'schedule' || steps.restore-avd-cache.outputs.cache-matched-key == ''
150155
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d #v2.33.0
151156
with:
152157
api-level: ${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}
153158
arch: x86_64
154159
force-avd-creation: false
155160
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
156161
disable-animations: true
157-
script: echo "Generated AVD snapshot for caching."
162+
script: 'echo "Generated AVD snapshot for caching; event_name=${{ github.event_name }}, cache-matched-key=${{ steps.restore-avd-cache.outputs.cache-matched-key }}"'
158163

159-
- name: Save AVD cache
164+
- name: Save AVD Cache
160165
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2
161166
if: github.event_name == 'schedule'
162167
with:
163168
path: |
164169
~/.android/avd/*
165170
~/.android/adb*
166-
key: ${{ steps.restore-avd-cache.outputs.cache-primary-key }}
171+
key: avd-cache-zhdsn586je-api${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}-${{ github.run_id }}
167172

168-
- name: Data Connect Emulator
173+
- name: Data Connect Emulator Start
174+
id: data-connect-emulator
169175
run: |
170-
set -x
176+
set -euo pipefail
177+
set -xv
171178
172179
echo 'emulator.postgresConnectionUrl=postgresql://postgres:[email protected]:5432?sslmode=disable' > firebase-dataconnect/dataconnect.local.properties
173180
@@ -176,14 +183,29 @@ jobs:
176183
:firebase-dataconnect:connectors:runDebugDataConnectEmulator \
177184
>firebase.emulator.dataconnect.log 2>&1 &
178185
179-
- name: Firebase Auth Emulator
186+
echo "FIREBASE_DATA_CONNECT_EMULATOR_PID=$!" >> "$GITHUB_ENV"
187+
188+
- name: Firebase Auth Emulator Start
189+
id: firebase-auth-emulator
180190
run: |
181-
set -x
191+
set -euo pipefail
192+
set -xv
193+
182194
cd firebase-dataconnect/emulator
183195
${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth >firebase.emulator.auth.log 2>&1 &
184196
185-
- name: Capture Logcat Logs
186-
run: adb logcat >logcat.log &
197+
echo "FIREBASE_AUTH_EMULATOR_PID=$!" >> "$GITHUB_ENV"
198+
199+
- name: Logcat Log Capture Start
200+
id: logcat-capture
201+
continue-on-error: true
202+
run: |
203+
set -euo pipefail
204+
set -xv
205+
206+
"$ANDROID_HOME/platform-tools/adb" logcat >logcat.log 2>&1 &
207+
208+
echo "LOGCAT_PID=$!" >> "$GITHUB_ENV"
187209
188210
- name: Gradle connectedCheck
189211
id: connectedCheck
@@ -201,25 +223,26 @@ jobs:
201223
script: |
202224
set -eux && ./gradlew ${{ (inputs.gradleInfoLog && '--info') || '' }} :firebase-dataconnect:connectedCheck :firebase-dataconnect:connectors:connectedCheck
203225
204-
- name: Upload log file artifacts
226+
- name: Upload Log Files
205227
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
206228
with:
207229
name: integration_test_logs
208230
path: "**/*.log"
209231
if-no-files-found: warn
210232
compression-level: 9
211233

212-
- name: Upload Gradle build report artifacts
234+
- name: Upload Gradle Build Reports
213235
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
214236
with:
215237
name: integration_test_gradle_build_reports
216238
path: firebase-dataconnect/**/build/reports/
217239
if-no-files-found: warn
218240
compression-level: 9
219241

220-
- name: Verify "Gradle connectedCheck" step was successful
242+
- name: Verify "Gradle connectedCheck" Step Was Successful
221243
if: steps.connectedCheck.outcome != 'success'
222244
run: |
245+
set -euo pipefail
223246
echo 'Failing because the outcome of the "Gradle connectedCheck" step ("${{ steps.connectedCheck.outcome }}") was not successful'
224247
exit 1
225248

firebase-dataconnect/CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Unreleased
2-
* [changed] Removed the "beta" suffix from the version of the Firebase Data
3-
Connect Android SDK, thus graduating it from "beta" to "generally available".
4-
([#6792](https://github.com/firebase/firebase-android-sdk/pull/6792))
2+
3+
4+
# 16.0.0
55
* [changed] DataConnectOperationException added, enabling support for partial
66
errors; that is, any data that was received and/or was able to be decoded is
77
now available via the "response" property of the exception thrown when a
@@ -80,3 +80,4 @@
8080
([#6299](https://github.com/firebase/firebase-android-sdk/pull/6299))
8181
* [changed] Added `equals` and `hashCode` methods to `GeneratedConnector`.
8282
([#6177](https://github.com/firebase/firebase-android-sdk/pull/6177))
83+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=16.0.0
2-
latestReleasedVersion=16.0.0-beta05
1+
version=16.0.1
2+
latestReleasedVersion=16.0.0

firebase-dataconnect/src/androidTest/kotlin/com/google/firebase/dataconnect/QuerySubscriptionIntegrationTest.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,7 @@ class QuerySubscriptionIntegrationTest : DataConnectIntegrationTestBase() {
483483
val noName1Query =
484484
schema.getPerson(personId).withDataDeserializer(serializer<GetPersonDataNoName1>())
485485

486-
backgroundScope.launch { noName1Query.subscribe().flow.collect() }
487-
488-
noName1Query.execute()
486+
keepCacheAlive(noName1Query)
489487

490488
schema.updatePerson(id = personId, name = "Name1").execute()
491489

@@ -571,7 +569,7 @@ class QuerySubscriptionIntegrationTest : DataConnectIntegrationTestBase() {
571569
*/
572570
private suspend fun TestScope.keepCacheAlive(query: QueryRef<*, *>) {
573571
val cachePrimed = SuspendingFlag()
574-
backgroundScope.launch { query.subscribe().flow.onEach { cachePrimed.set() }.collect() }
572+
backgroundScope.launch { query.subscribe().flow.collect { cachePrimed.set() } }
575573
cachePrimed.await()
576574
}
577575

firebase-dataconnect/src/test/kotlin/com/google/firebase/dataconnect/serializers/LocalDateSerializerUnitTest.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,11 @@ class LocalDateSerializerUnitTest {
205205
}
206206

207207
fun Arb.Companion.unparseableDash(): Arb<String> {
208-
val invalidString = string(1..5, codepoints.filterNot { it.value == '-'.code })
208+
val invalidString =
209+
string(
210+
1..5,
211+
codepoints.filterNot { it.value == '-'.code || it.value in '0'.code..'9'.code }
212+
)
209213
return arbitrary { rs ->
210214
val flags = Array(3) { rs.random.nextBoolean() }
211215
if (!flags[0]) {

firebase-functions/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
# Unreleased
2+
3+
4+
# 21.2.1
25
* [fixed] Fixed issue that caused the SDK to crash when trying to stream a function that does not exist.
36

7+
8+
## Kotlin
9+
The Kotlin extensions library transitively includes the updated
10+
`firebase-functions` library. The Kotlin extensions library has no additional
11+
updates.
12+
413
# 21.2.0
514
* [feature] Streaming callable functions are now supported.
615
* [fixed] Fixed an issue that prevented the App Check token from being handled correctly in case of error.
@@ -235,3 +244,4 @@ updates.
235244
optional region to override the default "us-central1".
236245
* [feature] New `useFunctionsEmulator` method allows testing against a local
237246
instance of the [Cloud Functions Emulator](https://firebase.google.com/docs/functions/local-emulator).
247+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
version=21.2.1
2-
latestReleasedVersion=21.2.0
1+
version=21.2.2
2+
latestReleasedVersion=21.2.1
33
android.enableUnitTestBinaryResources=true

firebase-perf/src/main/java/com/google/firebase/perf/FirebasePerformance.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
import com.google.firebase.remoteconfig.RemoteConfigComponent;
4747
import com.google.firebase.sessions.BuildConfig;
4848
import com.google.firebase.sessions.api.FirebaseSessionsDependencies;
49-
import com.google.firebase.sessions.api.SessionSubscriber;
5049
import java.lang.annotation.Retention;
5150
import java.lang.annotation.RetentionPolicy;
5251
import java.net.URL;
@@ -97,8 +96,6 @@ public class FirebasePerformance implements FirebasePerformanceAttributable {
9796
// once during initialization and cache it.
9897
private final ImmutableBundle mMetadataBundle;
9998

100-
private final SessionSubscriber sessionSubscriber;
101-
10299
/** Valid HttpMethods for manual network APIs */
103100
@StringDef({
104101
HttpMethod.GET,
@@ -172,7 +169,6 @@ public static FirebasePerformance getInstance() {
172169
this.mPerformanceCollectionForceEnabledState = false;
173170
this.configResolver = configResolver;
174171
this.mMetadataBundle = new ImmutableBundle(new Bundle());
175-
this.sessionSubscriber = new FirebasePerformanceSessionSubscriber(false);
176172
return;
177173
}
178174
DebugEnforcementCheck.setEnforcement(BuildConfig.DEBUG);
@@ -190,9 +186,8 @@ public static FirebasePerformance getInstance() {
190186
sessionManager.setApplicationContext(appContext);
191187

192188
mPerformanceCollectionForceEnabledState = configResolver.getIsPerformanceCollectionEnabled();
193-
this.sessionSubscriber =
194-
new FirebasePerformanceSessionSubscriber(isPerformanceCollectionEnabled());
195-
FirebaseSessionsDependencies.register(this.sessionSubscriber);
189+
FirebaseSessionsDependencies.register(
190+
new FirebasePerformanceSessionSubscriber(isPerformanceCollectionEnabled()));
196191

197192
if (logger.isLogcatEnabled() && isPerformanceCollectionEnabled()) {
198193
logger.info(
@@ -468,10 +463,4 @@ private static ImmutableBundle extractMetadata(Context appContext) {
468463
Boolean getPerformanceCollectionForceEnabledState() {
469464
return mPerformanceCollectionForceEnabledState;
470465
}
471-
472-
@NonNull
473-
@VisibleForTesting
474-
SessionSubscriber getSessionSubscriber() {
475-
return sessionSubscriber;
476-
}
477466
}

0 commit comments

Comments
 (0)