Skip to content

Commit

Permalink
Automatic merge of main into feature_branch/ump-sdk - Aug 14, 2023 (#…
Browse files Browse the repository at this point in the history
…1425)

* 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 <firebase-workflow-trigger-bot@google.com>
Co-authored-by: Jon Simantov <jsimantov@google.com>
Co-authored-by: almostmatt@google.com <almostmatt@google.com>

* 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 <cynthiajiang@google.com>

* Update merge-to-main script (#1420)

* Before creating the merge-main PR, branch it off main, so merge conflicts can be addressed in the branch rather than by committing to main.

* Format.

* Update release version number for M135, 11.4.0 (#1421)

* feat(auth): enable emulator support on desktop (#1423)

* 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 `

* make json request always do restrict json

* add readme info

* prepare for review

* some minor tweak

* code format

* update review comments

* update the unit test after request json change

---------

Co-authored-by: Cynthia Jiang <cynthiajiang@google.com>

* Internal Updates. (#1422)

* Add logic to trim webp parameter from native image urls

---------

Co-authored-by: Jon Simantov <jsimantov@google.com>
Co-authored-by: Tom Andersen <tom-andersen@users.noreply.github.com>
Co-authored-by: Matthew Hyndman <almostmatt@google.com>
Co-authored-by: a-maurice <amaurice@google.com>
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
Co-authored-by: firebase-workflow-trigger[bot] <80733318+firebase-workflow-trigger[bot]@users.noreply.github.com>
Co-authored-by: firebase-workflow-trigger-bot <firebase-workflow-trigger-bot@google.com>
Co-authored-by: Cynthia J <cynthiajoan@users.noreply.github.com>
Co-authored-by: Cynthia Jiang <cynthiajiang@google.com>
Co-authored-by: nakirekommula <126601200+nakirekommula@users.noreply.github.com>
  • Loading branch information
10 people committed Aug 15, 2023
1 parent 64369f4 commit 2c253aa
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 56 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/update-feature-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ env:
defaultBranchPattern: "feature_branch/*"
defaultMainBranch: "main"
triggerTestsLabel: "tests-requested: quick"
branchPrefix: "workflow/auto-merge-feature-branch-"


jobs:
list_feature_branches:
Expand Down Expand Up @@ -85,6 +87,11 @@ jobs:
python scripts/gha/install_prereqs_desktop.py
python -m pip install requests
- name: Name new branch
run: |
date_str=$(date "+%Y%m%d-%H%M%S")
echo "NEW_BRANCH=${{env.branchPrefix}}${{github.run_number}}-${date_str}" >> $GITHUB_ENV
- name: Create merge PR
id: create-pr
run: |
Expand Down Expand Up @@ -115,7 +122,10 @@ jobs:
> Created on ${date_str} by [${{github.workflow}} workflow]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID).
"
pr_number=$(python scripts/gha/create_pull_request.py --token ${{ steps.generate-token.outputs.token }} --base "${{ matrix.branch_name }}" --head "${main_branch}" --title "${pr_title}" --body "${pr_body}")
git checkout main
git checkout -b "${NEW_BRANCH}"
git push --set-upstream origin "${NEW_BRANCH}"
pr_number=$(python scripts/gha/create_pull_request.py --token ${{ steps.generate-token.outputs.token }} --base "${{ matrix.branch_name }}" --head "${NEW_BRANCH}" --title "${pr_title}" --body "${pr_body}")
echo "created_pr_number=${pr_number}" >> $GITHUB_OUTPUT
- name: Set test trigger label.
Expand Down
1 change: 1 addition & 0 deletions app/rest/request_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class RequestJson : public Request {
explicit RequestJson(const char* schema) : application_data_(new FbsTypeT()) {
flatbuffers::IDLOptions fbs_options;
fbs_options.skip_unexpected_fields_in_json = true;
fbs_options.strict_json = true;
parser_.reset(new flatbuffers::Parser(fbs_options));

bool parse_status = parser_->Parse(schema);
Expand Down
4 changes: 2 additions & 2 deletions app/rest/tests/request_json_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ TEST(RequestJsonTest, UpdatePostFields) {
request.set_token("abc");
EXPECT_EQ(
"{\n"
" token: \"abc\",\n"
" number: 123\n"
" \"token\": \"abc\",\n"
" \"number\": 123\n"
"}\n",
request.options().post_fields);
}
Expand Down
4 changes: 3 additions & 1 deletion auth/src/android/auth_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,12 @@ void CheckEmulator(AuthData* auth_data) {

// Use emulator as long as this env variable is set, regardless its value.
if (std::getenv("USE_AUTH_EMULATOR") == nullptr) {
LogDebug("Using Auth Prod for testing.");
LogInfo("Using Auth Prod for testing.");
return;
}

LogInfo("Using Auth Emulator for testing.");

// Use AUTH_EMULATOR_PORT if it is set to non empty string,
// otherwise use the default port.
uint32_t port = std::stoi(kEmulatorPort);
Expand Down
7 changes: 4 additions & 3 deletions auth/src/desktop/rpcs/auth_request.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,23 @@ std::string AuthRequest::GetUrl() {
} else {
std::string url(kHttp);
url += emulator_url;
url += "/";
url += kServerURL;
return url;
}
}

void AuthRequest::CheckEmulator() {
if (!emulator_url.empty()) {
LogDebug("Emulator Url already set: %s", emulator_url.c_str());
LogInfo("Emulator Url already set: %s", emulator_url.c_str());
return;
}
// Use emulator as long as this env variable is set, regardless its value.
if (std::getenv("USE_AUTH_EMULATOR") == nullptr) {
LogDebug("Using Auth Prod for testing.");
LogInfo("Using Auth Prod for testing.");
return;
}

LogInfo("Using Auth Emulator.");
emulator_url.append(kEmulatorLocalHost);
emulator_url.append(":");
// Use AUTH_EMULATOR_PORT if it is set to non empty string,
Expand Down
3 changes: 2 additions & 1 deletion auth/src/ios/auth_ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ void UpdateCurrentUser(AuthData *auth_data) {
void CheckEmulator(AuthData *auth_data) {
// Use emulator as long as this env variable is set, regardless its value.
if (std::getenv("USE_AUTH_EMULATOR") == nullptr) {
LogDebug("Using Auth Prod for testing.");
LogInfo("Using Auth Prod for testing.");
return;
}
LogInfo("Using Auth Emulator.");

// Use AUTH_EMULATOR_PORT if it is set to non empty string,
// otherwise use the default port.
Expand Down
4 changes: 2 additions & 2 deletions auth/tests/desktop/rpcs/create_auth_uri_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ TEST(CreateAuthUriTest, TestCreateAuthUriRequest) {
request.options().url);
EXPECT_EQ(
"{\n"
" identifier: \"email\",\n"
" continueUri: \"http://localhost\"\n"
" \"identifier\": \"email\",\n"
" \"continueUri\": \"http://localhost\"\n"
"}\n",
request.options().post_fields);
}
Expand Down
2 changes: 1 addition & 1 deletion auth/tests/desktop/rpcs/delete_account_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ TEST(DeleteAccountTest, TestDeleteAccountRequest) {
request.options().url);
EXPECT_EQ(
"{\n"
" idToken: \"token\"\n"
" \"idToken\": \"token\"\n"
"}\n",
request.options().post_fields);
}
Expand Down
2 changes: 1 addition & 1 deletion auth/tests/desktop/rpcs/get_account_info_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ TEST(GetAccountInfoTest, TestGetAccountInfoRequest) {
request.options().url);
EXPECT_EQ(
"{\n"
" idToken: \"token\"\n"
" \"idToken\": \"token\"\n"
"}\n",
request.options().post_fields);
}
Expand Down
8 changes: 4 additions & 4 deletions auth/tests/desktop/rpcs/get_oob_confirmation_code_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ TEST(GetOobConfirmationCodeTest, SendVerifyEmailRequest) {
request->options().url);
EXPECT_EQ(
"{\n"
" idToken: \"token\",\n"
" requestType: \"VERIFY_EMAIL\"\n"
" \"idToken\": \"token\",\n"
" \"requestType\": \"VERIFY_EMAIL\"\n"
"}\n",
request->options().post_fields);
}
Expand All @@ -56,8 +56,8 @@ TEST(GetOobConfirmationCodeTest, SendPasswordResetEmailRequest) {
request->options().url);
EXPECT_EQ(
"{\n"
" email: \"email\",\n"
" requestType: \"PASSWORD_RESET\"\n"
" \"email\": \"email\",\n"
" \"requestType\": \"PASSWORD_RESET\"\n"
"}\n",
request->options().post_fields);
}
Expand Down
4 changes: 2 additions & 2 deletions auth/tests/desktop/rpcs/reset_password_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ TEST(ResetPasswordTest, TestResetPasswordRequest) {
request.options().url);
EXPECT_EQ(
"{\n"
" oobCode: \"oob\",\n"
" newPassword: \"password\"\n"
" \"oobCode\": \"oob\",\n"
" \"newPassword\": \"password\"\n"
"}\n",
request.options().post_fields);
}
Expand Down
4 changes: 2 additions & 2 deletions auth/tests/desktop/rpcs/secure_token_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ TEST(SecureTokenTest, TestSetRefreshRequest) {
request.options().url);
EXPECT_EQ(
"{\n"
" grantType: \"refresh_token\",\n"
" refreshToken: \"token123\"\n"
" \"grantType\": \"refresh_token\",\n"
" \"refreshToken\": \"token123\"\n"
"}\n",
request.options().post_fields);
}
Expand Down
46 changes: 23 additions & 23 deletions auth/tests/desktop/rpcs/set_account_info_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateEmail) {
request->options().url);
EXPECT_EQ(
"{\n"
" email: \"fakeemail\",\n"
" returnSecureToken: true,\n"
" idToken: \"token\"\n"
" \"email\": \"fakeemail\",\n"
" \"returnSecureToken\": true,\n"
" \"idToken\": \"token\"\n"
"}\n",
request->options().post_fields);
}
Expand All @@ -60,9 +60,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdatePassword) {
request->options().url);
EXPECT_EQ(
"{\n"
" password: \"fakepassword\",\n"
" returnSecureToken: true,\n"
" idToken: \"token\"\n"
" \"password\": \"fakepassword\",\n"
" \"returnSecureToken\": true,\n"
" \"idToken\": \"token\"\n"
"}\n",
request->options().post_fields);
}
Expand All @@ -79,10 +79,10 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateProfile_Full) {
request->options().url);
EXPECT_EQ(
"{\n"
" displayName: \"New Name\",\n"
" returnSecureToken: true,\n"
" idToken: \"token\",\n"
" photoUrl: \"new_url\"\n"
" \"displayName\": \"New Name\",\n"
" \"returnSecureToken\": true,\n"
" \"idToken\": \"token\",\n"
" \"photoUrl\": \"new_url\"\n"
"}\n",
request->options().post_fields);
}
Expand All @@ -99,9 +99,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateProfile_Partial) {
request->options().url);
EXPECT_EQ(
"{\n"
" returnSecureToken: true,\n"
" idToken: \"token\",\n"
" photoUrl: \"new_url\"\n"
" \"returnSecureToken\": true,\n"
" \"idToken\": \"token\",\n"
" \"photoUrl\": \"new_url\"\n"
"}\n",
request->options().post_fields);
}
Expand All @@ -117,9 +117,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_UpdateProfile_DeleteFields) {
request->options().url);
EXPECT_EQ(
"{\n"
" returnSecureToken: true,\n"
" idToken: \"token\",\n"
" deleteAttribute: [\n"
" \"returnSecureToken\": true,\n"
" \"idToken\": \"token\",\n"
" \"deleteAttribute\": [\n"
" \"DISPLAY_NAME\",\n"
" \"PHOTO_URL\"\n"
" ]\n"
Expand All @@ -140,10 +140,10 @@ TEST(SetAccountInfoTest,
request->options().url);
EXPECT_EQ(
"{\n"
" returnSecureToken: true,\n"
" idToken: \"token\",\n"
" photoUrl: \"new_url\",\n"
" deleteAttribute: [\n"
" \"returnSecureToken\": true,\n"
" \"idToken\": \"token\",\n"
" \"photoUrl\": \"new_url\",\n"
" \"deleteAttribute\": [\n"
" \"DISPLAY_NAME\"\n"
" ]\n"
"}\n",
Expand All @@ -162,9 +162,9 @@ TEST(SetAccountInfoTest, TestSetAccountInfoRequest_Unlink) {
request->options().url);
EXPECT_EQ(
"{\n"
" returnSecureToken: true,\n"
" idToken: \"token\",\n"
" deleteProvider: [\n"
" \"returnSecureToken\": true,\n"
" \"idToken\": \"token\",\n"
" \"deleteProvider\": [\n"
" \"fakeprovider\"\n"
" ]\n"
"}\n",
Expand Down
10 changes: 5 additions & 5 deletions auth/tests/desktop/rpcs/sign_up_new_user_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ TEST(SignUpNewUserTest, TestAnonymousSignInRequest) {
request.options().url);
EXPECT_EQ(
"{\n"
" returnSecureToken: true\n"
" \"returnSecureToken\": true\n"
"}\n",
request.options().post_fields);
}
Expand All @@ -50,10 +50,10 @@ TEST(SignUpNewUserTest, TestEmailPasswordSignInRequest) {
request.options().url);
EXPECT_EQ(
"{\n"
" email: \"e@mail\",\n"
" password: \"pwd\",\n"
" displayName: \"rabbit\",\n"
" returnSecureToken: true\n"
" \"email\": \"e@mail\",\n"
" \"password\": \"pwd\",\n"
" \"displayName\": \"rabbit\",\n"
" \"returnSecureToken\": true\n"
"}\n",
request.options().post_fields);
}
Expand Down
4 changes: 2 additions & 2 deletions auth/tests/desktop/rpcs/verify_custom_token_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ TEST(VerifyCustomTokenTest, TestVerifyCustomTokenRequest) {
request.options().url);
EXPECT_EQ(
"{\n"
" returnSecureToken: true,\n"
" token: \"token123\"\n"
" \"returnSecureToken\": true,\n"
" \"token\": \"token123\"\n"
"}\n",
request.options().post_fields);
}
Expand Down
6 changes: 3 additions & 3 deletions auth/tests/desktop/rpcs/verify_password_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ TEST(VerifyPasswordTest, TestVerifyPasswordRequest) {
request.options().url);
EXPECT_EQ(
"{\n"
" email: \"abc@email\",\n"
" password: \"pwd\",\n"
" returnSecureToken: true\n"
" \"email\": \"abc@email\",\n"
" \"password\": \"pwd\",\n"
" \"returnSecureToken\": true\n"
"}\n",
request.options().post_fields);
}
Expand Down
6 changes: 3 additions & 3 deletions cpp_sdk_version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"released": "11.3.0",
"stable": "11.3.0",
"head": "11.3.0"
"released": "11.4.0",
"stable": "11.4.0",
"head": "11.4.0"
}
9 changes: 9 additions & 0 deletions gma/src/android/native_ad_image_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ NativeAdImage::NativeAdImage(
FIREBASE_ASSERT(j_uri);
internal_->uri = util::JniUriToString(env, j_uri);

// Images requested with an android user agent may return webp images. Trim
// webp parameter from image url to get the original JPG/PNG image.
std::size_t eq_pos = internal_->uri.rfind("=");
std::size_t webp_pos = internal_->uri.rfind("-rw");
if (webp_pos != std::string::npos && eq_pos != std::string::npos &&
webp_pos > eq_pos) {
internal_->uri.replace(webp_pos, 3, "");
}

// NativeAdImage scale.
jdouble j_scale =
env->CallDoubleMethod(internal_->native_ad_image,
Expand Down
6 changes: 6 additions & 0 deletions release_build_files/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,12 @@ workflow use only during the development of your app, not for publicly shipping
code.

## Release Notes
### Next Release
- Changes
- Auth: Add Firebase Auth Emulator support. Set the environment variable
USE_AUTH_EMULATOR=yes (and optionally AUTH_EMULATOR_PORT, default 9099)
to connect to the local Firebase Auth Emulator.

### 11.4.0
- Changes
- General (Android): Update to Firebase Android BoM version 32.2.2.
Expand Down

0 comments on commit 2c253aa

Please sign in to comment.