Skip to content

Commit 14d29f6

Browse files
committed
Merge remote-tracking branch 'origin/main' into tomandersen/or_query
2 parents 100c811 + 055e879 commit 14d29f6

File tree

139 files changed

+5204
-427
lines changed

Some content is hidden

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

139 files changed

+5204
-427
lines changed

.github/workflows/build-report.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Generate Test Report Table
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 15 * * *" # 3pm UTC = 7am PST / 8am PDT, 6 hours after testapps run
7+
8+
env:
9+
GITHUB_TOKEN: ${{ github.token }}
10+
numDays: 7
11+
numDaysExtended: 30
12+
numTestsSummary: 10
13+
14+
jobs:
15+
generate-report:
16+
runs-on: ubuntu-20.04
17+
steps:
18+
- name: Setup python
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: 3.9
22+
- uses: actions/checkout@v3
23+
with:
24+
fetch-depth: 0
25+
- name: Install Desktop SDK prerequisites
26+
uses: nick-invision/retry@v2
27+
with:
28+
timeout_minutes: 15
29+
max_attempts: 3
30+
command: |
31+
python3 scripts/gha/install_prereqs_desktop.py --gha_build
32+
python3 -m pip install requests python-dateutil progress attrs
33+
- name: Fetch GitHub jobs (with retry)
34+
uses: nick-invision/retry@v2
35+
with:
36+
timeout_minutes: 20
37+
max_attempts: 3
38+
shell: bash
39+
command: python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --write_cache build_status_short.cache
40+
- name: Fetch extended GitHub jobs (with retry)
41+
uses: nick-invision/retry@v2
42+
with:
43+
timeout_minutes: 80
44+
max_attempts: 3
45+
shell: bash
46+
command: python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDaysExtended }} --write_cache build_status.cache
47+
- name: Generate report files
48+
run: |
49+
python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --output_markdown --read_cache build_status_short.cache > report_short.md
50+
python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDaysExtended }} --output_markdown --read_cache build_status.cache > report_extended.md
51+
python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDaysExtended }} --output_markdown --read_cache build_status.cache --report=test_summary --summary_count=${{ env.numTestsSummary }} > test_summary.md
52+
python3 scripts/gha/report_build_status.py --token ${{ github.token }} --days ${{ env.numDays }} --nooutput_header --read_cache build_status_short.cache > report.txt
53+
- name: Generate comment string
54+
run: |
55+
echo -n > comment.md
56+
cat >> comment.md <<EOF
57+
EOF
58+
cat report_short.md >> comment.md
59+
cat >> comment.md <<EOF
60+
61+
<details><summary>View extended history (last ${{ env.numDaysExtended }} days)</summary>
62+
63+
EOF
64+
cat report_extended.md >> comment.md
65+
cat >> comment.md <<EOF
66+
</details>
67+
<details><summary>Top ${{ env.numTestsSummary }} flakes/failures (last ${{ env.numDaysExtended }} days)</summary>
68+
69+
EOF
70+
cat test_summary.md >> comment.md
71+
cat >> comment.md <<EOF
72+
</details>
73+
<details><summary>📄</summary><pre>
74+
EOF
75+
cat report.txt >> comment.md
76+
cat >> comment.md <<EOF
77+
</pre></details>
78+
79+
***
80+
81+
EOF
82+
- name: Show comment string
83+
run: |
84+
cat comment.md
85+
- name: Update GitHub issue (with retry)
86+
uses: nick-invision/retry@v2
87+
with:
88+
timeout_minutes: 5
89+
max_attempts: 3
90+
shell: bash
91+
command: python3 scripts/gha/update_issue_comment.py --token ${{ github.token }} --issue_title '[C++] Nightly Integration Testing Report' --start_tag build-dashboard-comment-start --end_tag build-dashboard-comment-end < comment.md

.github/workflows/integration_tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,12 +190,15 @@ jobs:
190190
apis="analytics,app_check,auth,database,dynamic_links,functions,gma,installations,messaging,remote_config,storage"
191191
elif [[ "${{ github.event.schedule }}" == "0 10 * * *" || "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
192192
# at 2am PST/3am PDT and 3am PST/4am PDT. Running integration tests for firestore and generate test report.
193+
echo "::warning ::Running Firestore nightly tests"
193194
apis="firestore"
194195
else
196+
echo "::warning ::Running main nightly tests"
195197
apis=$( python scripts/gha/print_matrix_configuration.py -c -w integration_tests -k apis -o "${{github.event.inputs.apis}}" ${TEST_MATRIX_PARAM} )
196198
fi
197199
if [[ "${{ github.event.schedule }}" == "0 11 * * *" ]]; then
198-
# at 3am PST/4am PDT. Running firestore desktop integration test aginst tip-of-tree ios repo
200+
# at 3am PST/4am PDT. Running firestore desktop integration test aginst tip-of-tree ios repo
201+
echo "::warning ::Running against Firestore tip-of-tree"
199202
matrix_platform="Desktop"
200203
matrix_os=$( python scripts/gha/print_matrix_configuration.py -w integration_tests ${TEST_MATRIX_PARAM} -k os -o "ubuntu-20.04,macos-12")
201204
else

.github/workflows/reviewer-roulette.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [ labeled ]
66

77
env:
8-
reviewerList: "jonsimantov a-maurice DellaBitta cynthiajoan chkuang-g AlmostMatt"
8+
reviewerList: "jonsimantov a-maurice cynthiajoan chkuang-g AlmostMatt"
99

1010
jobs:
1111
assign_random_reviewer:

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
.DS_Store
22

3+
# CMake "user presets" files
4+
# https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html
5+
CMakeUserPresets.json
6+
37
# Python byte-compiled / optimized / DLL files
48
__pycache__/
59
*.py[cod]
@@ -10,6 +14,9 @@ __pycache__/
1014
**/build/
1115
**/.externalNativeBuild/
1216

17+
### IDE generated files
18+
.vscode/
19+
1320
# Unencrypted secret files
1421
google-services.json
1522
GoogleService-Info.plist

Android/firebase_dependencies.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def firebaseDependenciesMap = [
2727
'dynamic_links' : ['com.google.firebase:firebase-dynamic-links'],
2828
'firestore' : ['com.google.firebase:firebase-firestore'],
2929
'functions' : ['com.google.firebase:firebase-functions'],
30-
'gma' : ['com.google.android.gms:play-services-ads:22.0.0'],
30+
'gma' : ['com.google.android.gms:play-services-ads:22.1.0'],
3131
'installations' : ['com.google.firebase:firebase-installations'],
3232
'invites' : ['com.google.firebase:firebase-invites'],
3333
// Messaging has an additional local dependency to include.
@@ -158,7 +158,7 @@ project.afterEvaluate {
158158

159159
// Add the bill-of-materials
160160
project.dependencies {
161-
implementation platform('com.google.firebase:firebase-bom:32.0.0')
161+
implementation platform('com.google.firebase:firebase-bom:32.1.1')
162162
}
163163
for (String lib : firebaseCpp.dependencies.libSet) {
164164
// Generate and include the proguard file

analytics/integration_test/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use_frameworks! :linkage => :static
55

66
target 'integration_test' do
77
platform :ios, '11.0'
8-
pod 'Firebase/Analytics', '10.9.0'
8+
pod 'Firebase/Analytics', '10.11.0'
99
end
1010

1111
target 'integration_test_tvos' do
1212
platform :tvos, '12.0'
13-
pod 'Firebase/Analytics', '10.9.0'
13+
pod 'Firebase/Analytics', '10.11.0'
1414
end
1515

1616
post_install do |installer|

analytics/ios_headers/FIREventNames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2023 Google LLC
22

3-
// Copied from Firebase Analytics iOS SDK 10.9.0.
3+
// Copied from Firebase Analytics iOS SDK 10.11.0.
44

55
/// @file FIREventNames.h
66
///

analytics/ios_headers/FIRParameterNames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2023 Google LLC
22

3-
// Copied from Firebase Analytics iOS SDK 10.9.0.
3+
// Copied from Firebase Analytics iOS SDK 10.11.0.
44

55
/// @file FIRParameterNames.h
66
///

analytics/ios_headers/FIRUserPropertyNames.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2023 Google LLC
22

3-
// Copied from Firebase Analytics iOS SDK 10.9.0.
3+
// Copied from Firebase Analytics iOS SDK 10.11.0.
44

55
/// @file FIRUserPropertyNames.h
66
///

app/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ if (IOS)
549549
${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma.h
550550
${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/ad_view.h
551551
${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/interstitial_ad.h
552+
${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/internal/native_ad.h
552553
${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/rewarded_ad.h
553554
${FIREBASE_SOURCE_DIR}/gma/src/include/firebase/gma/types.h)
554555
set(installations_HDRS

app/app_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ android {
5050
}
5151

5252
dependencies {
53-
implementation platform('com.google.firebase:firebase-bom:32.0.0')
53+
implementation platform('com.google.firebase:firebase-bom:32.1.1')
5454
implementation 'com.google.firebase:firebase-analytics'
5555
}
5656

app/google_api_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ android {
5353
}
5454

5555
dependencies {
56-
implementation platform('com.google.firebase:firebase-bom:32.0.0')
56+
implementation platform('com.google.firebase:firebase-bom:32.1.1')
5757
implementation 'com.google.firebase:firebase-analytics'
5858
implementation 'com.google.android.gms:play-services-base:18.2.0'
5959
implementation project(':app:app_resources')

app/integration_test/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ platform :ios, '11.0'
44
use_frameworks! :linkage => :static
55

66
target 'integration_test' do
7-
pod 'Firebase/Analytics', '10.9.0'
7+
pod 'Firebase/Analytics', '10.11.0'
88
end
99

1010
post_install do |installer|

app/integration_test/src/integration_test.cc

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "app_framework.h" // NOLINT
2424
#include "firebase_test_framework.h" // NOLINT
2525

26+
using ::testing::UnorderedElementsAre;
2627
// The TO_STRING macro is useful for command line defined strings as the quotes
2728
// get stripped.
2829
#define TO_STRING_EXPAND(X) #X
@@ -65,4 +66,34 @@ TEST_F(FirebaseAppTest, TestDefaultAppWithDefaultOptions) {
6566
default_app = nullptr;
6667
}
6768

69+
TEST_F(FirebaseAppTest, TestGetAll) {
70+
EXPECT_EQ(firebase::App::GetApps().size(), 0);
71+
72+
firebase::App* default_app = firebase::App::Create(APP_CREATE_PARAMS);
73+
EXPECT_THAT(firebase::App::GetApps(), UnorderedElementsAre(default_app));
74+
75+
firebase::App* second_app =
76+
firebase::App::Create(firebase::AppOptions(), "2ndApp");
77+
EXPECT_THAT(firebase::App::GetApps(),
78+
UnorderedElementsAre(default_app, second_app));
79+
80+
firebase::App* third_app =
81+
firebase::App::Create(firebase::AppOptions(), "3rdApp");
82+
EXPECT_THAT(firebase::App::GetApps(),
83+
UnorderedElementsAre(default_app, second_app, third_app));
84+
85+
delete third_app;
86+
third_app = nullptr;
87+
EXPECT_THAT(firebase::App::GetApps(),
88+
UnorderedElementsAre(default_app, second_app));
89+
90+
delete default_app;
91+
default_app = nullptr;
92+
EXPECT_THAT(firebase::App::GetApps(), UnorderedElementsAre(second_app));
93+
94+
delete second_app;
95+
second_app = nullptr;
96+
EXPECT_EQ(firebase::App::GetApps().size(), 0);
97+
}
98+
6899
} // namespace firebase_testapp_automated

app/invites_resources/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ android {
4949
}
5050

5151
dependencies {
52-
implementation platform('com.google.firebase:firebase-bom:32.0.0')
52+
implementation platform('com.google.firebase:firebase-bom:32.1.1')
5353
implementation 'com.google.firebase:firebase-analytics'
5454
implementation 'com.google.firebase:firebase-dynamic-links'
5555
implementation project(':app:app_resources')

app/src/app_android.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <string.h>
2121

2222
#include <string>
23+
#include <vector>
2324

2425
#include "app/src/app_common.h"
2526
#include "app/src/assert.h"
@@ -509,6 +510,8 @@ App* App::GetInstance(const char* name) {
509510
return app_common::FindAppByName(name);
510511
}
511512

513+
std::vector<App*> App::GetApps() { return app_common::GetAllApps(); }
514+
512515
JNIEnv* App::GetJNIEnv() const { return util::GetThreadsafeJNIEnv(java_vm()); }
513516

514517
static void RegisterLibraryWithVersionRegistrar(JNIEnv* env,

app/src/app_common.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,19 @@ App* GetAnyApp() {
338338
return nullptr;
339339
}
340340

341+
std::vector<App*> GetAllApps() {
342+
std::vector<App*> result;
343+
App* const default_app = GetDefaultApp();
344+
MutexLock lock(*g_app_mutex);
345+
if (g_apps) {
346+
for (auto it = g_apps->begin(); it != g_apps->end(); ++it) {
347+
if (it->second->app != default_app) result.push_back(it->second->app);
348+
}
349+
if (default_app) result.push_back(default_app);
350+
}
351+
return result;
352+
}
353+
341354
void RemoveApp(App* app) {
342355
assert(app);
343356
MutexLock lock(*g_app_mutex);

app/src/app_common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include <map>
2323
#include <string>
24+
#include <vector>
2425

2526
#include "app/src/include/firebase/app.h"
2627
#include "app/src/logger.h"
@@ -60,6 +61,9 @@ App* GetDefaultApp();
6061
// will be returned.
6162
App* GetAnyApp();
6263

64+
// Get all existing apps
65+
std::vector<App*> GetAllApps();
66+
6367
// Remove an app from the set of apps.
6468
// Call this method before destroying an app.
6569
void RemoveApp(App* app);

app/src/app_desktop.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <fstream>
2222
#include <memory>
2323
#include <string>
24+
#include <vector>
2425

2526
#include "app/src/app_common.h"
2627
#include "app/src/function_registry.h"
@@ -143,10 +144,12 @@ App* App::Create(const AppOptions& options, const char* name) { // NOLINT
143144
app = new App();
144145
app->name_ = name;
145146
app->options_ = options_with_defaults;
147+
std::string unique_name =
148+
std::string(app->options_.package_name()) + "." + app->name_;
146149
app = app_common::AddApp(app, &app->init_results_);
147150
app->internal_->heartbeat_controller_ =
148151
std::make_shared<heartbeat::HeartbeatController>(
149-
name, *app_common::FindAppLoggerByName(name),
152+
unique_name, *app_common::FindAppLoggerByName(name),
150153
app->internal_->date_provider_);
151154
#ifndef SWIG
152155
// Log a heartbeat after creating an App. In the Unity SDK this will happen
@@ -165,6 +168,8 @@ App* App::GetInstance(const char* name) { // NOLINT
165168
return app_common::FindAppByName(name);
166169
}
167170

171+
std::vector<App*> App::GetApps() { return app_common::GetAllApps(); }
172+
168173
#ifdef INTERNAL_EXPERIMENTAL
169174
internal::FunctionRegistry* App::function_registry() {
170175
return &internal_->function_registry;

app/src/app_ios.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ static void PlatformOptionsToAppOptions(FIROptions* platform_options, AppOptions
281281

282282
App* App::GetInstance(const char* name) { return app_common::FindAppByName(name); }
283283

284+
std::vector<App*> App::GetApps() { return app_common::GetAllApps(); }
285+
284286
void App::RegisterLibrary(const char* library, const char* version, void* /* platform_resource */) {
285287
[FIRApp registerLibrary:@(library) withVersion:@(version)];
286288
app_common::RegisterLibrariesFromUserAgent(

app/src/app_stub.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ App* App::GetInstance(const char* name) {
6666
return app_common::FindAppByName(name);
6767
}
6868

69+
std::vector<App*> App::GetApps() { return app_common::GetAllApps(); }
70+
6971
#ifdef INTERNAL_EXPERIMENTAL
7072
internal::FunctionRegistry* App::function_registry() {
7173
return static_cast<internal::FunctionRegistry*>(data_);

app/src/filesystem.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <string>
2121

2222
namespace firebase {
23-
2423
/**
2524
* Returns a system-defined best directory in which to create application
2625
* data. Values vary wildly across platforms. They include:

0 commit comments

Comments
 (0)