From f1d78116b1c9dfa63cf5c1611b4fc76000d9801c Mon Sep 17 00:00:00 2001 From: Zack Fu Zi Xiang Date: Mon, 9 Dec 2024 20:50:09 +0800 Subject: [PATCH 1/5] fix: ci add service dependency of appflowy cloud on admin frontend --- docker-compose-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker-compose-ci.yml b/docker-compose-ci.yml index c9f1c5cb..141f69dd 100644 --- a/docker-compose-ci.yml +++ b/docker-compose-ci.yml @@ -151,6 +151,9 @@ services: context: . dockerfile: ./admin_frontend/Dockerfile image: appflowyinc/admin_frontend:${APPFLOWY_ADMIN_FRONTEND_VERSION:-latest} + depends_on: + appflowy_cloud: + condition: service_healthy ports: - 3000:3000 environment: From 02f5d2dc645437cddc3f7047e33d4f6723e9e9dd Mon Sep 17 00:00:00 2001 From: Zack Fu Zi Xiang Date: Mon, 9 Dec 2024 20:59:29 +0800 Subject: [PATCH 2/5] chore: trigger ci --- admin_frontend/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/admin_frontend/README.md b/admin_frontend/README.md index a2b8c75c..59b256c8 100644 --- a/admin_frontend/README.md +++ b/admin_frontend/README.md @@ -15,3 +15,4 @@ - Go to [web server](localhost) - After editing source files, do `docker compose up -d --no-deps --build admin_frontend` - You might need to add `--force-recreate` flag for non build changes to take effect + From aa1285c59cd9ca1b56d6d4dfcbba6d1420c34ab8 Mon Sep 17 00:00:00 2001 From: Zack Fu Zi Xiang Date: Mon, 9 Dec 2024 21:13:57 +0800 Subject: [PATCH 3/5] feat: add logging for admin frontend client signin --- admin_frontend/tests/utils/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/admin_frontend/tests/utils/mod.rs b/admin_frontend/tests/utils/mod.rs index 1416fba2..dd2a8125 100644 --- a/admin_frontend/tests/utils/mod.rs +++ b/admin_frontend/tests/utils/mod.rs @@ -42,6 +42,7 @@ impl AdminFrontendClient { .send() .await .unwrap(); + let resp = check_resp(resp).await; let c = resp.cookies().find(|c| c.name() == "session_id").unwrap(); self.session_id = Some(c.value().to_string()); } @@ -84,3 +85,12 @@ impl AdminFrontendClient { self.session_id.as_ref().unwrap() } } + +async fn check_resp(resp: reqwest::Response) -> reqwest::Response { + if resp.status() != 200 { + println!("resp: {:#?}", resp); + let payload = resp.text().await.unwrap(); + panic!("payload: {:#?}", payload) + } + resp +} From a4d4e710480c4c270c4112351fd18da9e337dff1 Mon Sep 17 00:00:00 2001 From: Zack Fu Zi Xiang Date: Mon, 9 Dec 2024 21:54:47 +0800 Subject: [PATCH 4/5] fix: server logs if error --- .github/workflows/integration_test.yml | 6 ++++++ docker-compose-ci.yml | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index d67b4f05..3849b92f 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -132,6 +132,12 @@ jobs: echo "Running tests for ${{ matrix.test_service }} with flags: ${{ matrix.test_cmd }}" RUST_LOG="info" DISABLE_CI_TEST_LOG="true" cargo test ${{ matrix.test_cmd }} + - name: Server Logs + if: failure() + run: | + docker ps -a + docker compose -f docker-compose-ci.yml logs + - name: Docker Logs if: always() run: | diff --git a/docker-compose-ci.yml b/docker-compose-ci.yml index 91510438..d19ee722 100644 --- a/docker-compose-ci.yml +++ b/docker-compose-ci.yml @@ -151,9 +151,6 @@ services: context: . dockerfile: ./admin_frontend/Dockerfile image: appflowyinc/admin_frontend:${APPFLOWY_ADMIN_FRONTEND_VERSION:-latest} - depends_on: - appflowy_cloud: - condition: service_healthy ports: - 3000:3000 environment: From 1dd643f46569e53614988452257d4318a2138bf5 Mon Sep 17 00:00:00 2001 From: Zack Fu Zi Xiang Date: Mon, 9 Dec 2024 22:41:56 +0800 Subject: [PATCH 5/5] fix: create admin confirmation without email --- docker/gotrue/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/gotrue/start.sh b/docker/gotrue/start.sh index 3a1aaec6..226c1ae0 100755 --- a/docker/gotrue/start.sh +++ b/docker/gotrue/start.sh @@ -5,7 +5,7 @@ set -e if [ -n "${GOTRUE_ADMIN_EMAIL}" ] && [ -n "${GOTRUE_ADMIN_PASSWORD}" ]; then set +e echo "Creating admin user for gotrue..." - command_output=$(./auth admin createuser --admin "${GOTRUE_ADMIN_EMAIL}" "${GOTRUE_ADMIN_PASSWORD}" 2>&1) + command_output=$(./auth admin createuser --admin --confirm "${GOTRUE_ADMIN_EMAIL}" "${GOTRUE_ADMIN_PASSWORD}" 2>&1) command_status=$? # Check if the command failed if [ $command_status -ne 0 ]; then