Skip to content

Commit

Permalink
CI: fixing special tests (3)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
  • Loading branch information
bigcat88 committed Jan 23, 2024
1 parent bb79181 commit cd703df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 21 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/tests-special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
33 changes: 16 additions & 17 deletions lib/Service/AppAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit cd703df

Please sign in to comment.