From cd703dffaffe71766dee68c9bccdcd86892f971e Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Tue, 23 Jan 2024 22:31:11 +0300 Subject: [PATCH] CI: fixing special tests (3) Signed-off-by: Alexander Piskun --- .github/workflows/tests-special.yml | 7 +++--- lib/Service/AppAPIService.php | 33 ++++++++++++++--------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/.github/workflows/tests-special.yml b/.github/workflows/tests-special.yml index 5a496cdf..5f38ae64 100644 --- a/.github/workflows/tests-special.yml +++ b/.github/workflows/tests-special.yml @@ -119,13 +119,12 @@ jobs: php occ app_api:app:register $APP_ID manual_install --json-info \ "{\"appid\":\"$APP_ID\",\"name\":\"$APP_ID\",\"daemon_config_name\":\"manual_install\",\"version\":\"$APP_VERSION\",\"secret\":\"$APP_SECRET\",\"port\":$APP_PORT,\"scopes\":{\"required\":[\"SYSTEM\", \"NOTIFICATIONS\"],\"optional\":[\"USER_INFO\"]},\"system_app\":1}" \ --force-scopes --wait-finish + kill -15 $(cat /tmp/_install.pid) + timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null - name: Run Manual App Update test working-directory: apps/${{ env.APP_NAME }} - run: | - python3 tests/app_version_higher.py - kill -15 $(cat /tmp/_install.pid) - timeout 3m tail --pid=$(cat /tmp/_install.pid) -f /dev/null + run: python3 tests/app_version_higher.py - name: Upload NC logs if: always() diff --git a/lib/Service/AppAPIService.php b/lib/Service/AppAPIService.php index e24fd75c..b3527013 100644 --- a/lib/Service/AppAPIService.php +++ b/lib/Service/AppAPIService.php @@ -371,23 +371,22 @@ public function handleExAppVersionChange(IRequest $request, ExApp $exApp): bool if (!$this->exAppService->updateExApp($exApp, ['version'])) { return false; } - if ($this->disableExApp($exApp)) { - $this->exNotificationsManager->sendAdminsNotification($exApp->getAppid(), [ - 'object' => 'ex_app_update', - 'object_id' => $exApp->getAppid(), - 'subject_type' => 'ex_app_version_update', - 'subject_params' => [ - 'rich_subject' => 'ExApp updated, action required!', - 'rich_subject_params' => [], - 'rich_message' => sprintf( - 'ExApp %s disabled due to update from %s to %s. Manual re-enable required.', - $exApp->getAppid(), - $oldVersion, - $exApp->getVersion()), - 'rich_message_params' => [], - ], - ]); - } + $this->disableExApp($exApp); + $this->exNotificationsManager->sendAdminsNotification($exApp->getAppid(), [ + 'object' => 'ex_app_update', + 'object_id' => $exApp->getAppid(), + 'subject_type' => 'ex_app_version_update', + 'subject_params' => [ + 'rich_subject' => 'ExApp updated, action required!', + 'rich_subject_params' => [], + 'rich_message' => sprintf( + 'ExApp %s disabled due to update from %s to %s. Manual re-enable required.', + $exApp->getAppid(), + $oldVersion, + $exApp->getVersion()), + 'rich_message_params' => [], + ], + ]); return false; } return true;