Skip to content

Commit 64369f4

Browse files
firebase-workflow-trigger[bot]jonsimantovtom-andersenAlmostMatta-maurice
authored
Automatic merge of main into feature_branch/ump-sdk - Aug 07, 2023 (#1419)
* iOS: Remove Analytics dependency from GMA integration test (#1386) * Try using CoreOnly instead of Analytics cocoapod for tests. * Update readme. * Add stub workflow for updating feature branches. * Add script to merge main into all active feature branches on a regular schedule. (#1394) * Add workflow for automatically updating feature branches weekly. * Corrected filename, and added inputs. * Remove trailing spaces. * Fix workflow. * Fix workflow name. * Fix syntax. * Fix syntax. * List remote branches instead. * Clean up script. * Untab. * Add branch list for debugging. * Untab. * Specify remote branches. * Skip second stage if no first. * Typo * Error. * List all branches. * Fix logic. * Fix spacing. * Fix output * Fix parameters. * Fix merge to use origin. * Remove debug echos. * Add git config. * Fix PR creation. * Fix PR creation. * Fix automatic push. * Increase retry. (#1402) * Add Firestore test history report (#1403) * Add --firestore flag to report Firestore history. * Add Firestore report to nightly cron job. * Remove multiline commands. * Revert "Remove multiline commands." This reverts commit 6393ae9. * Fix tabbing. * Fix packaging test detection for Firestore. * Revert "OR Query Implementation (#1335)" (#1399) This reverts commit 11332d4. * Wrap the real-time RemoteConfig test in flaky-block to automatically retry. (#1406) * Only use flaky_test on android * Update the iOS version used by FTL (#1408) * Kick off nightly packaging an hour earlier (#1409) * Fix crash on gma::Initialize without a Firebase App (#1320) Initialize Util before using Util::FIndClass. Also add an integration test for initializing gma without a firebase app. * build: pass along the CMake path (#1410) When building the subproject, we would invoke `cmake` directly, relying on the path lookup of the tool, which may or may not match the currently executing CMake. Use `CMAKE_COMMAND` which gives us the path to the current CMake executable ensuring that we use the same CMake for building the dependencies. * Add log to gsutil fetch. (#1411) * Update mobile dependencies - Thu Aug 03 2023 (#1413) * Update mobile dependencies - Thu Aug 03 2023 ### Android - com.google.firebase.firebase_bom → 32.2.2 ### iOS - Firebase/Analytics → 10.13.0 - Firebase/AppCheck → 10.13.0 - Firebase/Auth → 10.13.0 - Firebase/Core → 10.13.0 - Firebase/CoreOnly → 10.13.0 - Firebase/Crashlytics → 10.13.0 - Firebase/Database → 10.13.0 - Firebase/DynamicLinks → 10.13.0 - Firebase/Firestore → 10.13.0 - Firebase/Functions → 10.13.0 - Firebase/Installations → 10.13.0 - Firebase/Messaging → 10.13.0 - Firebase/RemoteConfig → 10.13.0 - Firebase/Storage → 10.13.0 - Google-Mobile-Ads-SDK → 10.9.0 > Created by [Update Android and iOS dependencies workflow](https://github.com/firebase/firebase-cpp-sdk/actions/runs/5755777170). * Ensure using a Swift bridging header that supports both arm64 and x86_64. * Add release note about i386 no longer being supported. * Remove armv7 as well. --------- Co-authored-by: firebase-workflow-trigger-bot <[email protected]> Co-authored-by: Jon Simantov <[email protected]> Co-authored-by: [email protected] <[email protected]> * feat(auth): Add emulator support (#1400) * add auth emulator support * fix ios number parse * update the documentation part * reduce lint warning * more lint warnings * code format * use environment to decide using emulator or not * fix a typo * add readme entry for FirebaseApp.GetApps() * update for review comment * add missing ` --------- Co-authored-by: Cynthia Jiang <[email protected]> --------- Co-authored-by: Jon Simantov <[email protected]> Co-authored-by: Tom Andersen <[email protected]> Co-authored-by: Matthew Hyndman <[email protected]> Co-authored-by: a-maurice <[email protected]> Co-authored-by: Saleem Abdulrasool <[email protected]> Co-authored-by: firebase-workflow-trigger[bot] <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com> Co-authored-by: firebase-workflow-trigger-bot <[email protected]> Co-authored-by: Cynthia J <[email protected]> Co-authored-by: Cynthia Jiang <[email protected]>
1 parent 570104d commit 64369f4

File tree

77 files changed

+5992
-1855
lines changed

Some content is hidden

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

77 files changed

+5992
-1855
lines changed

.github/workflows/cpp-packaging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
# Run a full packaging step any time a new branch is merged into main.
66
- main
77
schedule:
8-
- cron: "0 9 * * *" # 9am UTC = 1am PST / 2am PDT
8+
- cron: "0 8 * * *" # 8am UTC = 12am PST / 1am PDT
99
workflow_dispatch:
1010
inputs:
1111
preserveIntermediateArtifacts:

.github/workflows/update-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
cd -
143143
# Copy all *-Swift.h header files into ios_pod/swift_headers/
144144
echo "Copying headers..."
145-
find "${ziptmp}" -name '*-Swift.h' -print0 | xargs -0 -n 1 -J REPLACETEXT cp -f REPLACETEXT ios_pod/swift_headers/
145+
find "${ziptmp}" -name '*-Swift.h' -path '*ios*arm64*x86_64*simulator*' -print0 | xargs -0 -n 1 -J REPLACETEXT cp -f REPLACETEXT ios_pod/swift_headers/
146146
copyright_line="// Copyright $(date +%Y) Google LLC"
147147
# Add a note to each file about its source.
148148
for ios_header in ios_pod/swift_headers/*.h; do

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ gcs_key_file.json
2828
*_build/
2929
cmake-build-*/
3030
testing/test_framework/external/
31+
CMakeFiles/
32+
CMakeCache.txt
3133

3234
# XCode user specific folders
3335
**/xcuserdata/

Android/firebase_dependencies.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.2.0')
161+
implementation platform('com.google.firebase:firebase-bom:32.2.2')
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.12.0'
8+
pod 'Firebase/Analytics', '10.13.0'
99
end
1010

1111
target 'integration_test_tvos' do
1212
platform :tvos, '12.0'
13-
pod 'Firebase/Analytics', '10.12.0'
13+
pod 'Firebase/Analytics', '10.13.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.12.0.
3+
// Copied from Firebase Analytics iOS SDK 10.13.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.12.0.
3+
// Copied from Firebase Analytics iOS SDK 10.13.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.12.0.
3+
// Copied from Firebase Analytics iOS SDK 10.13.0.
44

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

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.2.0')
53+
implementation platform('com.google.firebase:firebase-bom:32.2.2')
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.2.0')
56+
implementation platform('com.google.firebase:firebase-bom:32.2.2')
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.12.0'
7+
pod 'Firebase/Analytics', '10.13.0'
88
end
99

1010
post_install do |installer|

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.2.0')
52+
implementation platform('com.google.firebase:firebase-bom:32.2.2')
5353
implementation 'com.google.firebase:firebase-analytics'
5454
implementation 'com.google.firebase:firebase-dynamic-links'
5555
implementation project(':app:app_resources')

app/src/include/firebase/app.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,8 @@ class App {
571571
/// Get the App with the given name, or nullptr if none have been created.
572572
static App* GetInstance(const char* name);
573573

574-
#if !defined(DOXYGEN)
575-
// Hidden from the public documentation for now
576574
/// Get all the apps, including the default one.
577575
static std::vector<App*> GetApps();
578-
#endif // !defined(DOXYGEN)
579576

580577
#ifndef SWIG
581578
// <SWIG>

app/src/tests/runner/ios/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<string>Main</string>
3131
<key>UIRequiredDeviceCapabilities</key>
3232
<array>
33-
<string>armv7</string>
33+
<string>arm64</string>
3434
</array>
3535
<key>UISupportedInterfaceOrientations</key>
3636
<array>
@@ -46,4 +46,4 @@
4646
<string>UIInterfaceOrientationLandscapeRight</string>
4747
</array>
4848
</dict>
49-
</plist>
49+
</plist>

app_check/app_check_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.2.0')
52+
implementation platform('com.google.firebase:firebase-bom:32.2.2')
5353
implementation 'com.google.firebase:firebase-appcheck'
5454
}
5555

app_check/integration_test/Podfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ use_frameworks! :linkage => :static
44

55
target 'integration_test' do
66
platform :ios, '11.0'
7-
pod 'Firebase/AppCheck', '10.12.0'
8-
pod 'Firebase/Database', '10.12.0'
9-
pod 'Firebase/Auth', '10.12.0'
10-
pod 'Firebase/Storage', '10.12.0'
11-
pod 'Firebase/Functions', '10.12.0'
7+
pod 'Firebase/AppCheck', '10.13.0'
8+
pod 'Firebase/Database', '10.13.0'
9+
pod 'Firebase/Auth', '10.13.0'
10+
pod 'Firebase/Storage', '10.13.0'
11+
pod 'Firebase/Functions', '10.13.0'
1212
end
1313

1414
target 'integration_test_tvos' do
1515
platform :tvos, '12.0'
16-
pod 'Firebase/AppCheck', '10.12.0'
17-
pod 'Firebase/Database', '10.12.0'
18-
pod 'Firebase/Auth', '10.12.0'
19-
pod 'Firebase/Storage', '10.12.0'
20-
pod 'Firebase/Functions', '10.12.0'
16+
pod 'Firebase/AppCheck', '10.13.0'
17+
pod 'Firebase/Database', '10.13.0'
18+
pod 'Firebase/Auth', '10.13.0'
19+
pod 'Firebase/Storage', '10.13.0'
20+
pod 'Firebase/Functions', '10.13.0'
2121
end
2222

2323
post_install do |installer|

auth/auth_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.2.0')
52+
implementation platform('com.google.firebase:firebase-bom:32.2.2')
5353
implementation 'com.google.firebase:firebase-analytics'
5454
implementation 'com.google.firebase:firebase-auth'
5555
implementation project(':app:app_resources')

auth/integration_test/Podfile

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

55
target 'integration_test' do
66
platform :ios, '11.0'
7-
pod 'Firebase/Auth', '10.12.0'
7+
pod 'Firebase/Auth', '10.13.0'
88
end
99

1010
target 'integration_test_tvos' do
1111
platform :tvos, '12.0'
12-
pod 'Firebase/Auth', '10.12.0'
12+
pod 'Firebase/Auth', '10.13.0'
1313
end
1414

1515
post_install do |installer|

auth/src/android/auth_android.cc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <assert.h>
1818
#include <jni.h>
1919

20+
#include <string>
21+
2022
#include "app/src/assert.h"
2123
#include "app/src/embedded_file.h"
2224
#include "app/src/include/firebase/internal/mutex.h"
@@ -53,6 +55,7 @@ using util::JniStringToString;
5355
X(RemoveIdTokenListener, "removeIdTokenListener", \
5456
"(Lcom/google/firebase/auth/FirebaseAuth$IdTokenListener;)V"), \
5557
X(SignOut, "signOut", "()V"), \
58+
X(UseEmulator, "useEmulator", "(Ljava/lang/String;I)V"), \
5659
X(FetchSignInMethodsForEmail, "fetchSignInMethodsForEmail", \
5760
"(Ljava/lang/String;)" \
5861
"Lcom/google/android/gms/tasks/Task;"), \
@@ -185,6 +188,31 @@ void UpdateCurrentUser(AuthData* auth_data) {
185188
}
186189
}
187190

191+
const char* const kEmulatorLocalHost = "10.0.2.2";
192+
const char* const kEmulatorPort = "9099";
193+
void CheckEmulator(AuthData* auth_data) {
194+
JNIEnv* env = Env(auth_data);
195+
196+
// Use emulator as long as this env variable is set, regardless its value.
197+
if (std::getenv("USE_AUTH_EMULATOR") == nullptr) {
198+
LogDebug("Using Auth Prod for testing.");
199+
return;
200+
}
201+
202+
// Use AUTH_EMULATOR_PORT if it is set to non empty string,
203+
// otherwise use the default port.
204+
uint32_t port = std::stoi(kEmulatorPort);
205+
if (std::getenv("AUTH_EMULATOR_PORT") != nullptr) {
206+
port = std::stoi(std::getenv("AUTH_EMULATOR_PORT"));
207+
}
208+
209+
jstring j_host = env->NewStringUTF(kEmulatorLocalHost);
210+
env->CallVoidMethod(AuthImpl(auth_data),
211+
auth::GetMethodId(auth::kUseEmulator), j_host, port);
212+
env->DeleteLocalRef(j_host);
213+
firebase::util::CheckAndClearJniExceptions(env);
214+
}
215+
188216
// Release cached Java classes.
189217
static void ReleaseClasses(JNIEnv* env) {
190218
ReleaseAuthClasses(env);
@@ -269,6 +297,8 @@ void Auth::InitPlatformAuth(AuthData* auth_data) {
269297
// Ensure our User is in-line with underlying API's user.
270298
// It's possible for a user to already be logged-in on start-up.
271299
UpdateCurrentUser(auth_data);
300+
301+
CheckEmulator(auth_data);
272302
}
273303

274304
void Auth::DestroyPlatformAuth(AuthData* auth_data) {

auth/src/desktop/auth_desktop.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#define FIREBASE_AUTH_SRC_DESKTOP_AUTH_DESKTOP_H_
1717

1818
#include <memory>
19+
#include <string>
1920

2021
#include "app/rest/request.h"
2122
#include "app/src/scheduler.h"

auth/src/desktop/rpcs/auth_request.cc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "app/src/heartbeat/heartbeat_controller_desktop.h"
2424
#include "app/src/include/firebase/app.h"
2525
#include "app/src/include/firebase/internal/mutex.h"
26+
#include "firebase/log.h"
2627

2728
namespace firebase {
2829
namespace auth {
@@ -37,6 +38,8 @@ AuthRequest::AuthRequest(::firebase::App& app, const char* schema,
3738
// dependencies upon other parts of this library. This complication is due to
3839
// the way the tests are currently configured where each library has minimal
3940
// dependencies.
41+
42+
CheckEmulator();
4043
static std::string auth_user_agent; // NOLINT
4144
static std::string extended_auth_user_agent; // NOLINT
4245
static Mutex* user_agent_mutex = new Mutex();
@@ -77,5 +80,40 @@ AuthRequest::AuthRequest(::firebase::App& app, const char* schema,
7780
}
7881
}
7982

83+
std::string AuthRequest::GetUrl() {
84+
if (emulator_url.empty()) {
85+
std::string url(kHttps);
86+
url += kServerURL;
87+
return url;
88+
} else {
89+
std::string url(kHttp);
90+
url += emulator_url;
91+
url += kServerURL;
92+
return url;
93+
}
94+
}
95+
96+
void AuthRequest::CheckEmulator() {
97+
if (!emulator_url.empty()) {
98+
LogDebug("Emulator Url already set: %s", emulator_url.c_str());
99+
return;
100+
}
101+
// Use emulator as long as this env variable is set, regardless its value.
102+
if (std::getenv("USE_AUTH_EMULATOR") == nullptr) {
103+
LogDebug("Using Auth Prod for testing.");
104+
return;
105+
}
106+
107+
emulator_url.append(kEmulatorLocalHost);
108+
emulator_url.append(":");
109+
// Use AUTH_EMULATOR_PORT if it is set to non empty string,
110+
// otherwise use the default port.
111+
if (std::getenv("AUTH_EMULATOR_PORT") == nullptr) {
112+
emulator_url.append(kEmulatorPort);
113+
} else {
114+
emulator_url.append(std::getenv("AUTH_EMULATOR_PORT"));
115+
}
116+
}
117+
80118
} // namespace auth
81119
} // namespace firebase

auth/src/desktop/rpcs/auth_request.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#ifndef FIREBASE_AUTH_SRC_DESKTOP_RPCS_AUTH_REQUEST_H_
1818
#define FIREBASE_AUTH_SRC_DESKTOP_RPCS_AUTH_REQUEST_H_
1919

20+
#include <string>
21+
2022
#include "app/rest/request_json.h"
2123
#include "app/src/include/firebase/app.h"
2224
#include "auth/request_generated.h"
@@ -28,6 +30,16 @@ namespace auth {
2830
// Key name for header when sending language code data.
2931
extern const char* kHeaderFirebaseLocale;
3032

33+
const char* const kHttps = "https://";
34+
35+
const char* const kHttp = "http://";
36+
37+
const char* const kServerURL =
38+
"www.googleapis.com/identitytoolkit/v3/relyingparty/";
39+
40+
const char* const kEmulatorLocalHost = "localhost";
41+
const char* const kEmulatorPort = "9099";
42+
3143
class AuthRequest
3244
: public firebase::rest::RequestJson<fbs::Request, fbs::RequestT> {
3345
public:
@@ -39,6 +51,12 @@ class AuthRequest
3951
bool deliver_heartbeat)
4052
: AuthRequest(app, reinterpret_cast<const char*>(schema),
4153
deliver_heartbeat) {}
54+
55+
std::string GetUrl();
56+
57+
private:
58+
void CheckEmulator();
59+
std::string emulator_url;
4260
};
4361

4462
} // namespace auth

auth/src/desktop/rpcs/create_auth_uri_request.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include "auth/src/desktop/rpcs/create_auth_uri_request.h"
1616

17+
#include <string>
18+
1719
#include "app/src/assert.h"
1820
#include "app/src/include/firebase/app.h"
1921
#include "app/src/log.h"
@@ -27,11 +29,8 @@ CreateAuthUriRequest::CreateAuthUriRequest(::firebase::App& app,
2729
: AuthRequest(app, request_resource_data, true) {
2830
FIREBASE_ASSERT_RETURN_VOID(api_key);
2931

30-
const char api_host[] =
31-
"https://www.googleapis.com/identitytoolkit/v3/relyingparty/"
32-
"createAuthUri?key=";
33-
std::string url;
34-
url.reserve(strlen(api_host) + strlen(api_key));
32+
const char api_host[] = "createAuthUri?key=";
33+
std::string url = GetUrl();
3534
url.append(api_host);
3635
url.append(api_key);
3736
set_url(url.c_str());

0 commit comments

Comments
 (0)