From 1d9537380b6db9cb33a169c5a96ce5cb7155dc9c Mon Sep 17 00:00:00 2001 From: Andrey Borysenko Date: Mon, 23 Sep 2024 17:05:00 +0300 Subject: [PATCH 1/2] fix(ex_app_fetcher): use new OCP ServerVersion Signed-off-by: Andrey Borysenko --- lib/Fetcher/AppAPIFetcher.php | 6 ++++-- lib/Fetcher/ExAppFetcher.php | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/Fetcher/AppAPIFetcher.php b/lib/Fetcher/AppAPIFetcher.php index 7b6a71dc..44996098 100644 --- a/lib/Fetcher/AppAPIFetcher.php +++ b/lib/Fetcher/AppAPIFetcher.php @@ -15,6 +15,7 @@ use OCP\Files\NotPermittedException; use OCP\Http\Client\IClientService; use OCP\IConfig; +use OCP\ServerVersion; use OCP\Support\Subscription\IRegistry; use Psr\Log\LoggerInterface; @@ -35,7 +36,8 @@ public function __construct( protected ITimeFactory $timeFactory, protected IConfig $config, protected LoggerInterface $logger, - protected IRegistry $registry + protected IRegistry $registry, + protected ServerVersion $serverVersion, ) { $this->appData = $appDataFactory->get('appstore'); } @@ -184,7 +186,7 @@ public function setVersion(string $version): void { */ protected function getChannel(): string { if ($this->channel === null) { - $this->channel = \OC_Util::getChannel(); + $this->channel = $this->serverVersion->getChannel(); } return $this->channel; } diff --git a/lib/Fetcher/ExAppFetcher.php b/lib/Fetcher/ExAppFetcher.php index 6057bf0a..1a786db4 100644 --- a/lib/Fetcher/ExAppFetcher.php +++ b/lib/Fetcher/ExAppFetcher.php @@ -12,6 +12,7 @@ use OCP\AppFramework\Utility\ITimeFactory; use OCP\Http\Client\IClientService; use OCP\IConfig; +use OCP\ServerVersion; use OCP\Support\Subscription\IRegistry; use Psr\Log\LoggerInterface; @@ -26,7 +27,8 @@ public function __construct( IConfig $config, CompareVersion $compareVersion, LoggerInterface $logger, - protected IRegistry $registry + protected IRegistry $registry, + protected ServerVersion $serverVersion, ) { parent::__construct( $appDataFactory, @@ -34,7 +36,8 @@ public function __construct( $timeFactory, $config, $logger, - $registry + $registry, + $serverVersion ); $this->compareVersion = $compareVersion; From d20b92d1563a70c16c6227833a5cfd5a92b78bcb Mon Sep 17 00:00:00 2001 From: Andrey Borysenko Date: Thu, 26 Sep 2024 21:04:43 +0300 Subject: [PATCH 2/2] fix(ci): fix psalm Signed-off-by: Andrey Borysenko --- tests/psalm-baseline.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index 7420c1a8..e5470e0e 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -1,5 +1,5 @@ - + @@ -54,10 +54,11 @@ + serverVersion]]> - + @@ -72,6 +73,7 @@ +