From 887ff86a10f7fec8aa26564f100ca9867d0d8839 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Fri, 18 Apr 2025 01:35:57 -0400 Subject: [PATCH 1/6] dataconnect.yml: use firebase-tools to launch fdc emulator instead of gradle --- .github/workflows/dataconnect.yml | 38 +++++-------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/.github/workflows/dataconnect.yml b/.github/workflows/dataconnect.yml index 038145c897e..59dd7011ae9 100644 --- a/.github/workflows/dataconnect.yml +++ b/.github/workflows/dataconnect.yml @@ -25,7 +25,7 @@ env: FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }} FDC_ANDROID_EMULATOR_API_LEVEL: ${{ inputs.androidEmulatorApiLevel || '34' }} FDC_NODEJS_VERSION: ${{ inputs.nodeJsVersion || '20' }} - FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '13.29.1' }} + FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.2.0' }} FDC_FIREBASE_TOOLS_DIR: /tmp/firebase-tools FDC_FIREBASE_COMMAND: /tmp/firebase-tools/node_modules/.bin/firebase FDC_PYTHON_VERSION: ${{ inputs.pythonVersion || '3.13' }} @@ -76,7 +76,6 @@ jobs: npm install --fund=false --audit=false --save --save-exact firebase-tools@${{ env.FDC_FIREBASE_TOOLS_VERSION }} - name: Restore Gradle Cache - id: restore-gradle-cache uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2 if: github.event_name != 'schedule' with: @@ -172,43 +171,19 @@ jobs: ~/.android/adb* key: avd-cache-zhdsn586je-api${{ env.FDC_ANDROID_EMULATOR_API_LEVEL }}-${{ github.run_id }} - - name: Data Connect Emulator Start - id: data-connect-emulator + - name: Start Firebase Emulators run: | - set -euo pipefail - set -xv - - echo 'emulator.postgresConnectionUrl=postgresql://postgres:password@127.0.0.1:5432?sslmode=disable' > firebase-dataconnect/dataconnect.local.properties - - ./gradlew \ - ${{ (inputs.gradleInfoLog && '--info') || '' }} \ - :firebase-dataconnect:connectors:runDebugDataConnectEmulator \ - >firebase.emulator.dataconnect.log 2>&1 & - - echo "FIREBASE_DATA_CONNECT_EMULATOR_PID=$!" >> "$GITHUB_ENV" - - - name: Firebase Auth Emulator Start - id: firebase-auth-emulator - run: | - set -euo pipefail - set -xv - + set -xveuo pipefail + export FIREBASE_DATACONNECT_POSTGRESQL_STRING='postgresql://postgres:password@127.0.0.1:5432?sslmode=disable' cd firebase-dataconnect/emulator - ${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth >firebase.emulator.auth.log 2>&1 & - - echo "FIREBASE_AUTH_EMULATOR_PID=$!" >> "$GITHUB_ENV" + ${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth,dataconnect >firebase.emulators.log 2>&1 & - name: Logcat Log Capture Start - id: logcat-capture continue-on-error: true run: | - set -euo pipefail - set -xv - + set -xveuo pipefail "$ANDROID_HOME/platform-tools/adb" logcat >logcat.log 2>&1 & - echo "LOGCAT_PID=$!" >> "$GITHUB_ENV" - - name: Gradle connectedCheck id: connectedCheck uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d #v2.33.0 @@ -360,7 +335,6 @@ jobs: run: echo '${{ secrets.GITHUB_TOKEN }}' | gh auth login --with-token - name: Create Job Results File - id: create-job-results-file run: | set -xveuo pipefail cat >'${{ runner.temp }}/job_results.txt' < Date: Fri, 18 Apr 2025 03:08:18 -0400 Subject: [PATCH 2/6] work --- .github/workflows/dataconnect.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dataconnect.yml b/.github/workflows/dataconnect.yml index 59dd7011ae9..a9e895df32f 100644 --- a/.github/workflows/dataconnect.yml +++ b/.github/workflows/dataconnect.yml @@ -175,14 +175,13 @@ jobs: run: | set -xveuo pipefail export FIREBASE_DATACONNECT_POSTGRESQL_STRING='postgresql://postgres:password@127.0.0.1:5432?sslmode=disable' + export DATACONNECT_EMULATOR_BINARY_PATH="$PWD"/firebase-dataconnect/connectors/build/intermediates/dataconnect/debug/executable/dataconnect-* cd firebase-dataconnect/emulator ${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth,dataconnect >firebase.emulators.log 2>&1 & - - name: Logcat Log Capture Start + - name: Start Logcat Capture continue-on-error: true - run: | - set -xveuo pipefail - "$ANDROID_HOME/platform-tools/adb" logcat >logcat.log 2>&1 & + run: "$ANDROID_HOME/platform-tools/adb" logcat >logcat.log 2>&1 & - name: Gradle connectedCheck id: connectedCheck From b9d41e64d5521656d26ffcf92885149eb1f23fa0 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Fri, 18 Apr 2025 03:08:29 -0400 Subject: [PATCH 3/6] add missing emulator versions --- .../plugin/DataConnectExecutableVersions.json | 56 ++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/firebase-dataconnect/gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/plugin/DataConnectExecutableVersions.json b/firebase-dataconnect/gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/plugin/DataConnectExecutableVersions.json index 2ad055edfa9..a18792c90e7 100644 --- a/firebase-dataconnect/gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/plugin/DataConnectExecutableVersions.json +++ b/firebase-dataconnect/gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/plugin/DataConnectExecutableVersions.json @@ -1,5 +1,5 @@ { - "defaultVersion": "1.9.2", + "defaultVersion": "2.2.0", "versions": [ { "version": "1.3.4", @@ -576,6 +576,60 @@ "os": "linux", "size": 26316952, "sha512DigestHex": "0bd4fcb4bdb66aab502000c19df824fc8df192906e712edd0000192beeb0ba3d29f2a627fc3097735dbab2d9bcbc3715e12fb8afb26e17c2e3e40103357b49ae" + }, + { + "version": "2.0.0", + "os": "windows", + "size": 26884096, + "sha512DigestHex": "720fc3b4be8da10e684eae252f962eed8d30f370068414642ab8e7974f9a370bc1b5038f47d2acc77f266ca224c0c22afc1177ae4510dca7d249ba423844abae" + }, + { + "version": "2.0.0", + "os": "macos", + "size": 26440448, + "sha512DigestHex": "bf812823aedd709c88e7c757412fe7dedfe1e05f8526863d714637f5adcf3e894c9780b759b919a6f96ab5a5ef579d60e57969cbc3b4f0ff7bc91697311c85fd" + }, + { + "version": "2.0.0", + "os": "linux", + "size": 26353816, + "sha512DigestHex": "37a3b7f4fca4a71c5c336fd7edebd4472bb51b31ff4abac80b31f8ef55831726b439f9f7ef1152cee6006019cd22cef51572874e5e6680962826fbc4c6166530" + }, + { + "version": "2.1.0", + "os": "windows", + "size": 26884096, + "sha512DigestHex": "299525effb3d645868aadd82cbeac28a528d0ecbbbf78d0e830478d03618de9e7356fdfd5599d9cd29fa86250c3543d656f9fe10e2d35c771cb42b31e904e534" + }, + { + "version": "2.1.0", + "os": "macos", + "size": 26440448, + "sha512DigestHex": "fac00b743d08eb9f0fbb4adceac63633a5364152551916ad2c787f4e5a3f8f51a5cd50350374279e04776cbf9e8d9b89d289c6f9e06f153820f9345b0a32733b" + }, + { + "version": "2.1.0", + "os": "linux", + "size": 26357912, + "sha512DigestHex": "75661fd65f8fcb78b8ac3585816c18e821fe0b993a94c5fa7f8f928f5827da3112ecee0de246c07bffcead4291172beeccf27708f1fcf19720bae9352885768b" + }, + { + "version": "2.2.0", + "os": "windows", + "size": 26982912, + "sha512DigestHex": "6e861a3603300474536c314318826d6609aeda04476996f1695ebe0dd4b508653dabee91935fcc2054d8c40965a630618241c7fbc55f490a3c109f240e69684d" + }, + { + "version": "2.2.0", + "os": "macos", + "size": 26538752, + "sha512DigestHex": "018d73ae8c4bdc9032125bd01715a181253e411e6b0b507324a897b549efab25d9aaea11d3fe7b9e9dab38592b3967cd46df3650a5a76fb7ea80e9bea3225812" + }, + { + "version": "2.2.0", + "os": "linux", + "size": 26452120, + "sha512DigestHex": "aab441e47115489b968f90d588b08f7a5848cef79849653bde84ffea5612404ec142c3bc87c6a466036a7e3e4228eff667a56ba633d3af93be0082ef4819c25f" } ] } \ No newline at end of file From 603f93d235cb70009d10b2da52d48edb1f331ed6 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Fri, 18 Apr 2025 03:09:28 -0400 Subject: [PATCH 4/6] dataconnect_demo_app.yml: upgrade firebase-tools from 13.28.0 to 14.2.0 --- .github/workflows/dataconnect_demo_app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dataconnect_demo_app.yml b/.github/workflows/dataconnect_demo_app.yml index 99672ba351a..e6e99e53464 100644 --- a/.github/workflows/dataconnect_demo_app.yml +++ b/.github/workflows/dataconnect_demo_app.yml @@ -18,7 +18,7 @@ on: env: FDC_NODE_VERSION: ${{ inputs.nodeVersion || '20' }} - FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '13.28.0' }} + FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.2.0' }} FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }} FDC_FIREBASE_TOOLS_DIR: ${{ github.workspace }}/firebase-tools FDC_FIREBASE_COMMAND: ${{ github.workspace }}/firebase-tools/node_modules/.bin/firebase From f5d30779df668b7f5ca34a28be3bda3dac34d87e Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Fri, 18 Apr 2025 03:27:06 -0400 Subject: [PATCH 5/6] dataconnect.yml: specify DATACONNECT_EMULATOR_BINARY_PATH to match the version used for codegen diff --git a/.github/workflows/dataconnect.yml b/.github/workflows/dataconnect.yml index a9e895df3..0e77b04ce 100644 --- a/.github/workflows/dataconnect.yml +++ b/.github/workflows/dataconnect.yml @@ -174,14 +174,24 @@ jobs: - name: Start Firebase Emulators run: | set -xveuo pipefail + + # Use the same dataconnect binary as was used for code generation in gradle assemble + DATACONNECT_EMULATOR_BINARY_PATH="$(find "$PWD"/firebase-dataconnect/connectors/build/intermediates/dataconnect/debug/executable -type f)" + if [[ -n $DATACONNECT_EMULATOR_BINARY_PATH ]] ; then + echo "INTERNAL ERROR v7kg2dfhbc: unable to find data connect binary" >&2 + exit 1 + fi + export DATACONNECT_EMULATOR_BINARY_PATH + export FIREBASE_DATACONNECT_POSTGRESQL_STRING='postgresql://postgres:password@127.0.0.1:5432?sslmode=disable' - export DATACONNECT_EMULATOR_BINARY_PATH="$PWD"/firebase-dataconnect/connectors/build/intermediates/dataconnect/debug/executable/dataconnect-* cd firebase-dataconnect/emulator ${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth,dataconnect >firebase.emulators.log 2>&1 & - name: Start Logcat Capture continue-on-error: true - run: "$ANDROID_HOME/platform-tools/adb" logcat >logcat.log 2>&1 & + run: | + set -xveuo pipefail + "$ANDROID_HOME/platform-tools/adb" logcat >logcat.log 2>&1 & - name: Gradle connectedCheck id: connectedCheck --- .github/workflows/dataconnect.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dataconnect.yml b/.github/workflows/dataconnect.yml index a9e895df32f..0e77b04cece 100644 --- a/.github/workflows/dataconnect.yml +++ b/.github/workflows/dataconnect.yml @@ -174,14 +174,24 @@ jobs: - name: Start Firebase Emulators run: | set -xveuo pipefail + + # Use the same dataconnect binary as was used for code generation in gradle assemble + DATACONNECT_EMULATOR_BINARY_PATH="$(find "$PWD"/firebase-dataconnect/connectors/build/intermediates/dataconnect/debug/executable -type f)" + if [[ -n $DATACONNECT_EMULATOR_BINARY_PATH ]] ; then + echo "INTERNAL ERROR v7kg2dfhbc: unable to find data connect binary" >&2 + exit 1 + fi + export DATACONNECT_EMULATOR_BINARY_PATH + export FIREBASE_DATACONNECT_POSTGRESQL_STRING='postgresql://postgres:password@127.0.0.1:5432?sslmode=disable' - export DATACONNECT_EMULATOR_BINARY_PATH="$PWD"/firebase-dataconnect/connectors/build/intermediates/dataconnect/debug/executable/dataconnect-* cd firebase-dataconnect/emulator ${{ env.FDC_FIREBASE_COMMAND }} emulators:start --only=auth,dataconnect >firebase.emulators.log 2>&1 & - name: Start Logcat Capture continue-on-error: true - run: "$ANDROID_HOME/platform-tools/adb" logcat >logcat.log 2>&1 & + run: | + set -xveuo pipefail + "$ANDROID_HOME/platform-tools/adb" logcat >logcat.log 2>&1 & - name: Gradle connectedCheck id: connectedCheck From 3d2db81b12a16435acab5d1935ce2a7b5ad41708 Mon Sep 17 00:00:00 2001 From: Denver Coneybeare Date: Fri, 18 Apr 2025 03:36:38 -0400 Subject: [PATCH 6/6] dataconnect.yml: fix -n to -z --- .github/workflows/dataconnect.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dataconnect.yml b/.github/workflows/dataconnect.yml index 0e77b04cece..543425ab14a 100644 --- a/.github/workflows/dataconnect.yml +++ b/.github/workflows/dataconnect.yml @@ -177,7 +177,7 @@ jobs: # Use the same dataconnect binary as was used for code generation in gradle assemble DATACONNECT_EMULATOR_BINARY_PATH="$(find "$PWD"/firebase-dataconnect/connectors/build/intermediates/dataconnect/debug/executable -type f)" - if [[ -n $DATACONNECT_EMULATOR_BINARY_PATH ]] ; then + if [[ -z $DATACONNECT_EMULATOR_BINARY_PATH ]] ; then echo "INTERNAL ERROR v7kg2dfhbc: unable to find data connect binary" >&2 exit 1 fi