Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.
Dart blogconfluence-alternativecontent-managementcontent-servicesdocumentationflutternote-takingnotion-alternativeproject-managementtask-managementteam-collaborationwiki
chore: only run appflowy cloud if it's not exist (#5799)
Nathan.fooo1e54c2dc7c9f
diff --git a/.github/workflows/flutter_ci.yaml b/.github/workflows/flutter_ci.yamlindex c1cdd7bc17..34f971205f 100644--- a/.github/workflows/flutter_ci.yaml+++ b/.github/workflows/flutter_ci.yaml@@ -248,10 +248,13 @@ jobs:env:BACKEND_VERSION: 0.3.24-amd64run: |- docker compose down -v --remove-orphans- docker compose pull- docker compose up -d- sleep 10+ if [ "$(docker ps --filter name=appflowy-cloud -q)" == "" ]; then+ docker compose pull+ docker compose up -d+ sleep 10+ else+ echo "Docker container 'appflowy-cloud' is already running."+ fi- name: Checkout source codeuses: actions/checkout@v4diff --git a/.github/workflows/rust_ci.yaml b/.github/workflows/rust_ci.yamlindex d1ccdb7cb1..a100eb1e89 100644--- a/.github/workflows/rust_ci.yaml+++ b/.github/workflows/rust_ci.yaml@@ -106,11 +106,14 @@ jobs:- name: Run Docker-Composeworking-directory: AppFlowy-Cloud- env:- BACKEND_VERSION: 0.3.24-amd64run: |- docker pull appflowyinc/appflowy_cloud:latest- docker compose up -d+ if [ "$(docker ps --filter name=appflowy-cloud -q)" == "" ]; then+ docker compose pull+ docker compose up -d+ sleep 10+ else+ echo "Docker container 'appflowy-cloud' is already running."+ fi- name: Run rust-lib testsworking-directory: frontend/rust-libdiff --git a/frontend/appflowy_flutter/integration_test/cloud/appflowy_cloud_auth_test.dart b/frontend/appflowy_flutter/integration_test/cloud/appflowy_cloud_auth_test.dartindex 5aa3a02d83..395e4ed24a 100644--- a/frontend/appflowy_flutter/integration_test/cloud/appflowy_cloud_auth_test.dart+++ b/frontend/appflowy_flutter/integration_test/cloud/appflowy_cloud_auth_test.dart@@ -47,11 +47,11 @@ void main() {);await tester.tapButton(find.byType(SignInOutButton));- tester.expectToSeeText(LocaleKeys.button_confirm.tr());- await tester.tapButtonWithName(LocaleKeys.button_confirm.tr());+ tester.expectToSeeText(LocaleKeys.button_ok.tr());+ await tester.tapButtonWithName(LocaleKeys.button_ok.tr());// Go to the sign in page again- await tester.pumpAndSettle(const Duration(seconds: 1));+ await tester.pumpAndSettle(const Duration(seconds: 5));tester.expectToSeeGoogleLoginButton();});diff --git a/frontend/appflowy_flutter/integration_test/cloud/user_setting_sync_test.dart b/frontend/appflowy_flutter/integration_test/cloud/user_setting_sync_test.dartindex 5791803a0e..8bd9cffc03 100644--- a/frontend/appflowy_flutter/integration_test/cloud/user_setting_sync_test.dart+++ b/frontend/appflowy_flutter/integration_test/cloud/user_setting_sync_test.dart@@ -50,26 +50,28 @@ void main() {await tester.tapEscButton();// wait 2 seconds for the sync to finish- await tester.pumpAndSettle(const Duration(seconds: 2));+ await tester.pumpAndSettle(const Duration(seconds: 6));});- });- testWidgets('get user icon and name from server', (tester) async {- await tester.initializeAppFlowy(- cloudType: AuthenticatorType.appflowyCloudSelfHost,- email: email,- );- await tester.tapGoogleLoginInButton();- await tester.expectToSeeHomePageWithGetStartedPage();- await tester.pumpAndSettle();- await tester.openSettings();- await tester.openSettingsPage(SettingsPage.account);+ testWidgets('get user icon and name from server', (tester) async {+ await tester.initializeAppFlowy(+ cloudType: AuthenticatorType.appflowyCloudSelfHost,+ email: email,+ );+ await tester.tapGoogleLoginInButton();+ await tester.expectToSeeHomePageWithGetStartedPage();+ await tester.pumpAndSettle();++ await tester.openSettings();+ await tester.openSettingsPage(SettingsPage.account);- // Verify name- final profileSetting =- tester.widget(find.byType(UserProfileSetting)) as UserProfileSetting;+ // Verify name+ final profileSetting =+ tester.widget(find.byType(UserProfileSetting)) as UserProfileSetting;- expect(profileSetting.name, name);+ expect(profileSetting.name, name);+ });});+}diff --git a/frontend/appflowy_flutter/lib/user/application/auth/af_cloud_mock_auth_service.dart b/frontend/appflowy_flutter/lib/user/application/auth/af_cloud_mock_auth_service.dartindex deba0f3700..7c33143ff0 100644--- a/frontend/appflowy_flutter/lib/user/application/auth/af_cloud_mock_auth_service.dart+++ b/frontend/appflowy_flutter/lib/user/application/auth/af_cloud_mock_auth_service.dart@@ -10,6 +10,7 @@ import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';import 'package:appflowy_result/appflowy_result.dart';import 'package:flowy_infra/uuid.dart';+import 'package:flutter/material.dart';/// Only used for testing.class AppFlowyCloudMockAuthService implements AuthService {@@ -64,12 +65,18 @@ class AppFlowyCloudMockAuthService implements AuthService {);Log.info("UserEventOauthSignIn with payload: $payload");return UserEventOauthSignIn(payload).send().then((value) {- value.fold((l) => null, (err) => Log.error(err));+ value.fold(+ (l) => null,+ (err) {+ debugPrint("Error: $err");+ Log.error(err);+ },+ );return value;});},(r) {- Log.error(r);+ debugPrint("Error: $r");return FlowyResult.failure(r);},);diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_account_view.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_account_view.dartindex a82199d98d..c914dec286 100644--- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_account_view.dart+++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/pages/settings_account_view.dart@@ -411,30 +411,32 @@ class _UserProfileSettingState extends State<UserProfileSetting> {),const HSpace(16),if (!isEditing) ...[- Padding(- padding: const EdgeInsets.only(top: 12),- child: Row(- mainAxisSize: MainAxisSize.min,- children: [- Flexible(- child: FlowyText.medium(- widget.name,- overflow: TextOverflow.ellipsis,+ Flexible(+ child: Padding(+ padding: const EdgeInsets.only(top: 12),+ child: Row(+ mainAxisSize: MainAxisSize.min,+ children: [+ Flexible(+ child: FlowyText.medium(+ widget.name,+ overflow: TextOverflow.ellipsis,+ ),),- ),- const HSpace(4),- GestureDetector(- behavior: HitTestBehavior.opaque,- onTap: () => setState(() => isEditing = true),- child: const FlowyHover(- resetHoverOnRebuild: false,- child: Padding(- padding: EdgeInsets.all(4),- child: FlowySvg(FlowySvgs.edit_s),+ const HSpace(4),+ GestureDetector(+ behavior: HitTestBehavior.opaque,+ onTap: () => setState(() => isEditing = true),+ child: const FlowyHover(+ resetHoverOnRebuild: false,+ child: Padding(+ padding: EdgeInsets.all(4),+ child: FlowySvg(FlowySvgs.edit_s),+ ),),),- ),- ],+ ],+ ),),),] else ...[