Skip to content

Commit 135d202

Browse files
committed
Merge branch 'refs/heads/main' into Instant
2 parents a27d72d + 1654b31 commit 135d202

File tree

838 files changed

+25067
-28907
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

838 files changed

+25067
-28907
lines changed

.gemini/config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
have_fun: false
2+
code_review:
3+
disable: false
4+
comment_severity_threshold: LOW
5+
max_review_comments: -1
6+
pull_request_opened:
7+
help: true
8+
summary: false
9+
code_review: true

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,35 @@ name: ⚠️ Report a Bug
33
about: Think you found a bug in the SDK? Report it here.
44
---
55

6-
<!-- DO NOT DELETE
6+
<!-- DO NOT DELETE
77
validate_template=true
88
template_path=.github/ISSUE_TEMPLATE/bug.md
99
-->
1010

1111
### [READ] Step 1: Are you in the right place?
1212

13-
Issues filed here should be about bugs in __the code in this repository__.
14-
If you have a general question, need help debugging, or fall into some
15-
other category use one of these other channels:
13+
Issues filed here should be about bugs in **the code in this repository**. If you have a general
14+
question, need help debugging, or fall into some other category use one of these other channels:
1615

17-
* For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/)
18-
with the firebase tag.
19-
* For general Firebase discussion, use the [firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk)
20-
google group.
21-
* For help troubleshooting your application that does not fall under one
22-
of the above categories, reach out to the personalized
23-
[Firebase support channel](https://firebase.google.com/support/).
16+
- For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/)
17+
with the firebase tag.
18+
- For general Firebase discussion, use the
19+
[firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk) google group.
20+
- For help troubleshooting your application that does not fall under one of the above categories,
21+
reach out to the personalized [Firebase support channel](https://firebase.google.com/support/).
2422

2523
### [REQUIRED] Step 2: Describe your environment
2624

27-
* Android Studio version: _____
28-
* Firebase Component: _____ (Database, Firestore, Storage, Functions, etc)
29-
* Component version: _____
25+
- Android Studio version: **\_**
26+
- Firebase Component: **\_** (Database, Firestore, Storage, Functions, etc)
27+
- Component version: **\_**
3028

3129
### [REQUIRED] Step 3: Describe the problem
3230

3331
#### Steps to reproduce:
3432

35-
What happened? How can we make the problem occur?
36-
This could be a description, log/console output, etc.
33+
What happened? How can we make the problem occur? This could be a description, log/console output,
34+
etc.
3735

3836
#### Relevant Code:
3937

.github/ISSUE_TEMPLATE/fr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: 💡 Feature Request
33
about: Have a feature you'd like to see in the Android SDK? Request it here.
44
---
55

6-
<!-- DO NOT DELETE
6+
<!-- DO NOT DELETE
77
validate_template=false
88
template_path=.github/ISSUE_TEMPLATE/fr.md
99
-->
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Firebase AI Daily Tests
2+
3+
on:
4+
schedule:
5+
- cron: 2 7 * * * # Runs automatically once a day
6+
workflow_dispatch: # Allow triggering the workflow manually
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
dailies:
13+
name: "Daily Tests"
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
with:
19+
submodules: true
20+
21+
- name: Enable KVM
22+
run: |
23+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
24+
sudo udevadm control --reload-rules
25+
sudo udevadm trigger --name-match=kvm
26+
27+
- name: Set up JDK 17
28+
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
29+
with:
30+
java-version: 17
31+
distribution: temurin
32+
cache: gradle
33+
34+
- name: Add google-services.json
35+
env:
36+
INTEG_TESTS_GOOGLE_SERVICES: ${{ secrets.INTEG_TESTS_GOOGLE_SERVICES }}
37+
run: |
38+
echo $INTEG_TESTS_GOOGLE_SERVICES | base64 -d > google-services.json
39+
- uses: google-github-actions/auth@71f986410dfbc7added4569d411d040a91dc6935 # v2.1.8
40+
with:
41+
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT }}
42+
43+
- uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
44+
45+
- name: Run tests
46+
uses: reactivecircus/android-emulator-runner@62dbb605bba737720e10b196cb4220d374026a6d #v2.33.0
47+
env:
48+
FIREBASE_CI: 1
49+
FTL_RESULTS_BUCKET: android-ci
50+
FTL_RESULTS_DIR: ${{ format('logs/{0}/{1}_{2}/artifacts/', github.workflow, github.run_id, github.run_attempt) }}
51+
FIREBASE_APP_CHECK_DEBUG_SECRET: ${{ secrets.FIREBASE_APP_CHECK_DEBUG_SECRET }}
52+
with:
53+
api-level: 34
54+
arch: x86_64
55+
ram-size: 4096M
56+
heap-size: 4096M
57+
script: |
58+
adb logcat -v time > logcat.txt &
59+
./gradlew firebase-ai:connectedCheck withErrorProne -PtargetBackend="prod"
60+
61+
- name: Upload logs
62+
if: failure()
63+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
64+
with:
65+
name: logcat.txt
66+
path: logcat.txt
67+
retention-days: 7
68+
if-no-files-found: ignore

.github/workflows/check-vertexai-responses.yml renamed to .github/workflows/check-firebaseai-responses.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Check Vertex AI Responses
1+
name: Check Firebase AI Responses
22

33
on: pull_request
44

@@ -10,30 +10,30 @@ jobs:
1010
steps:
1111
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1212
- name: Clone mock responses
13-
run: firebase-vertexai/update_responses.sh
13+
run: firebase-ai/update_responses.sh
1414
- name: Find cloned and latest versions
1515
run: |
1616
CLONED=$(git describe --tags)
1717
LATEST=$(git tag --sort=v:refname | tail -n1)
1818
echo "cloned_tag=$CLONED" >> $GITHUB_ENV
1919
echo "latest_tag=$LATEST" >> $GITHUB_ENV
20-
working-directory: firebase-vertexai/src/test/resources/vertexai-sdk-test-data
20+
working-directory: firebase-ai/src/test/resources/vertexai-sdk-test-data
2121
- name: Find comment from previous run if exists
2222
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
2323
id: fc
2424
with:
2525
issue-number: ${{github.event.number}}
26-
body-includes: Vertex AI Mock Responses Check
26+
body-includes: Firebase AI Mock Responses Check
2727
- name: Comment on PR if newer version is available
2828
if: ${{env.cloned_tag != env.latest_tag && !steps.fc.outputs.comment-id}}
2929
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
3030
with:
3131
issue-number: ${{github.event.number}}
3232
body: >
33-
### Vertex AI Mock Responses Check :warning:
33+
### Firebase AI Mock Responses Check :warning:
3434
35-
A newer major version of the mock responses for Vertex AI unit tests is available.
36-
[update_responses.sh](https://github.com/firebase/firebase-android-sdk/blob/main/firebase-vertexai/update_responses.sh)
35+
A newer major version of the mock responses for Firebase AI unit tests is available.
36+
[update_responses.sh](https://github.com/firebase/firebase-android-sdk/blob/main/firebase-ai/update_responses.sh)
3737
should be updated to clone the latest version of the responses: `${{env.latest_tag}}`
3838
- name: Delete comment when version gets updated
3939
if: ${{env.cloned_tag == env.latest_tag && steps.fc.outputs.comment-id}}

.github/workflows/check_format.yml

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,44 +9,13 @@ on:
99
- main
1010

1111
jobs:
12-
determine_changed:
13-
name: "Determine changed modules"
14-
runs-on: ubuntu-22.04
15-
if: (github.repository == 'Firebase/firebase-android-sdk' && github.event_name == 'push') || github.event_name == 'pull_request'
16-
outputs:
17-
modules: ${{ steps.changed-modules.outputs.modules }}
18-
steps:
19-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20-
with:
21-
fetch-depth: 2
22-
submodules: true
23-
24-
- name: Set up JDK 17
25-
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
26-
with:
27-
java-version: 17
28-
distribution: temurin
29-
cache: gradle
30-
31-
- id: changed-modules
32-
run: |
33-
git diff --name-only HEAD~1 | xargs printf -- '--changed-git-paths %s\n' | xargs ./gradlew writeChangedProjects --output-file-path=modules.json
34-
echo modules=$(cat modules.json) >> $GITHUB_OUTPUT
35-
3612
check_format:
3713
name: "Check Format"
3814
runs-on: ubuntu-22.04
39-
needs:
40-
- determine_changed
41-
strategy:
42-
fail-fast: false
43-
matrix:
44-
module: ${{ fromJSON(needs.determine_changed.outputs.modules) }}
4515

4616
steps:
4717
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4818
with:
49-
fetch-depth: 2
5019
submodules: true
5120

5221
- name: Set up JDK 17
@@ -56,18 +25,5 @@ jobs:
5625
distribution: temurin
5726
cache: gradle
5827

59-
- name: ${{ matrix.module }} Check Format
60-
run: |
61-
./gradlew ${{matrix.module}}:spotlessCheck
62-
63-
# A job that fails if any job in the check_format matrix fails,
64-
# to be used as a required check for merging.
65-
check_all:
66-
runs-on: ubuntu-22.04
67-
if: always()
68-
name: Check Format (matrix)
69-
needs: check_format
70-
steps:
71-
- name: Check matrix
72-
if: needs.check_format.result != 'success'
73-
run: exit 1
28+
- name: Run Spotless
29+
run: ./gradlew ${{matrix.module}}:spotlessCheck

.github/workflows/ci_tests.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
runs-on: ubuntu-22.04
3939
needs:
4040
- determine_changed
41+
if: ${{ needs.determine_changed.outputs.modules != '[]' }}
4142
strategy:
4243
fail-fast: false
4344
matrix:
@@ -56,9 +57,9 @@ jobs:
5657
distribution: temurin
5758
cache: gradle
5859

59-
- name: Clone mock responses
60-
if: matrix.module == ':firebase-vertexai'
61-
run: firebase-vertexai/update_responses.sh
60+
- name: Clone ai mock responses
61+
if: matrix.module == ':firebase-ai'
62+
run: firebase-ai/update_responses.sh
6263

6364
- name: Add google-services.json
6465
env:
@@ -72,6 +73,7 @@ jobs:
7273
run: |
7374
./gradlew ${{matrix.module}}:check withErrorProne
7475
- name: Compute upload file name
76+
if: always()
7577
run: |
7678
MODULE=${{matrix.module}}
7779
echo "ARTIFACT_NAME=${MODULE//:/_}" >> $GITHUB_ENV
@@ -88,12 +90,11 @@ jobs:
8890
# to be used as a required check for merging.
8991
check_all:
9092
runs-on: ubuntu-22.04
91-
if: always()
9293
name: Unit Tests (matrix)
9394
needs: unit_tests
95+
if: ${{ failure() }}
9496
steps:
95-
- name: Check test matrix
96-
if: needs.unit_tests.result != 'success'
97+
- name: Check test matrix results
9798
run: exit 1
9899

99100

@@ -165,5 +166,8 @@ jobs:
165166

166167
- name: Publish Test Results
167168
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
169+
if: always()
168170
with:
169171
files: "artifacts/**/*.xml"
172+
comment_mode: off
173+
compare_to_earlier_commit: false

.github/workflows/dataconnect.yml

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ on:
1313
pull_request:
1414
paths:
1515
- .github/workflows/dataconnect.yml
16+
- gradlew
17+
- build.gradle.kts
18+
- gradle.properties
19+
- gradlew.bat
20+
- settings.gradle.kts
21+
- subprojects.cfg
22+
- 'gradle/**'
23+
- 'plugins/**'
24+
- '!plugins/**/*.md'
1625
- 'firebase-dataconnect/**'
1726
- '!firebase-dataconnect/demo/**'
1827
- '!firebase-dataconnect/scripts/**'
@@ -25,7 +34,7 @@ env:
2534
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
2635
FDC_ANDROID_EMULATOR_API_LEVEL: ${{ inputs.androidEmulatorApiLevel || '34' }}
2736
FDC_NODEJS_VERSION: ${{ inputs.nodeJsVersion || '20' }}
28-
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.2.0' }}
37+
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.16.0' }}
2938
FDC_FIREBASE_TOOLS_DIR: /tmp/firebase-tools
3039
FDC_FIREBASE_COMMAND: /tmp/firebase-tools/node_modules/.bin/firebase
3140
FDC_PYTHON_VERSION: ${{ inputs.pythonVersion || '3.13' }}
@@ -66,6 +75,12 @@ jobs:
6675
with:
6776
node-version: ${{ env.FDC_NODEJS_VERSION }}
6877

78+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
79+
with:
80+
python-version: ${{ env.FDC_PYTHON_VERSION }}
81+
82+
- run: pip install -r firebase-dataconnect/ci/requirements.txt
83+
6984
- name: Install Firebase Tools ("firebase" command-line tool)
7085
run: |
7186
set -euo pipefail
@@ -119,6 +134,7 @@ jobs:
119134
120135
./gradlew \
121136
--profile \
137+
--warning-mode all \
122138
${{ (inputs.gradleInfoLog && '--info') || '' }} \
123139
:firebase-dataconnect:assembleDebugAndroidTest
124140
@@ -207,7 +223,7 @@ jobs:
207223
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
208224
disable-animations: true
209225
script: |
210-
set -eux && ./gradlew ${{ (inputs.gradleInfoLog && '--info') || '' }} :firebase-dataconnect:connectedCheck :firebase-dataconnect:connectors:connectedCheck
226+
set -eux && ./gradlew --warning-mode all ${{ (inputs.gradleInfoLog && '--info') || '' }} :firebase-dataconnect:connectedCheck :firebase-dataconnect:connectors:connectedCheck
211227
212228
- name: Upload Log Files
213229
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
@@ -229,6 +245,15 @@ jobs:
229245
if: steps.connectedCheck.outcome != 'success'
230246
run: |
231247
set -euo pipefail
248+
249+
if [[ ! -e logcat.log ]] ; then
250+
echo "WARNING dsdta43sxk: logcat log file not found; skipping scanning for test failures" >&2
251+
else
252+
echo "Scanning logcat output for failure details"
253+
python firebase-dataconnect/ci/logcat_error_report.py --logcat-file=logcat.log
254+
echo
255+
fi
256+
232257
echo 'Failing because the outcome of the "Gradle connectedCheck" step ("${{ steps.connectedCheck.outcome }}") was not successful'
233258
exit 1
234259
@@ -247,6 +272,17 @@ jobs:
247272
with:
248273
args: -color /github/workspace/.github/workflows/dataconnect.yml
249274

275+
shellcheck:
276+
continue-on-error: false
277+
runs-on: ubuntu-latest
278+
steps:
279+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
280+
with:
281+
show-progress: false
282+
sparse-checkout: 'firebase-dataconnect/'
283+
- name: shellcheck
284+
run: find . -name '*.sh' -print0 | xargs --verbose -0 shellcheck --norc --enable=all --shell=bash
285+
250286
python-ci-unit-tests:
251287
continue-on-error: false
252288
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)