refactor(appstore): split appstore from settings app#59997
refactor(appstore): split appstore from settings app#59997
Conversation
40c4086 to
9749a51
Compare
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
9749a51 to
4be9862
Compare
| /** | ||
| * Get all available apps | ||
| * | ||
| * @return DataResponse<Http::STATUS_OK, list<array{id: string, name: string, description: string, ...}>, array{}> |
There was a problem hiding this comment.
Would be nice if this could contain all fields (and would use a type alias).
| #[ApiRoute(verb: 'POST', url: '/api/v1/apps/force')] | ||
| public function force(string $appId): DataResponse { |
There was a problem hiding this comment.
| #[ApiRoute(verb: 'POST', url: '/api/v1/apps/force')] | |
| public function force(string $appId): DataResponse { | |
| #[ApiRoute(verb: 'POST', url: '/api/v1/apps/enable/force')] | |
| public function forceEnable(string $appId): DataResponse { |
Or just merge it with the normal enable endpoint and add a boolean parameter.
| #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)] | ||
| class DiscoverController extends Controller { |
There was a problem hiding this comment.
I think this should be an OCSController and not be ignored. Maybe clients want to use this API in the future too?
| */ | ||
| #[NoCSRFRequired] | ||
| #[FrontpageRoute(verb: 'GET', url: '/api/v1/discover/media')] | ||
| public function getAppDiscoverMedia(string $fileName, ILimiter $limiter, IUserSession $session): FileDisplayResponse|NotFoundResponse { |
There was a problem hiding this comment.
| public function getAppDiscoverMedia(string $fileName, ILimiter $limiter, IUserSession $session): FileDisplayResponse|NotFoundResponse { | |
| public function getAppDiscoverMedia(string $fileName, ILimiter $limiter): FileDisplayResponse|NotFoundResponse { |
Does this even work? It should be injected through the constructor.
There was a problem hiding this comment.
Yes it does you can inject things in controller methods (its a thing we advertise to do)¹.
The use case is that controllers are always constructed, so e.g. userId must be string | null but if you inject in the methods then you can also inject $userId as string if the method was not flagged as PublicPage.
And also you do not need to inject things you only need in one method.
| $apps = $appClass->listAllApps(); | ||
| /** @var array{id: string, ...} $app */ |
There was a problem hiding this comment.
The return type of listAllApps should be fixed instead.
|
|
||
| private function getBundles() { | ||
| /** | ||
| * @return array{name: mixed, id: mixed, appIdentifiers: mixed}[] |
There was a problem hiding this comment.
This type should be more concrete than mixed.
| @@ -32,17 +32,26 @@ | |||
| <file name="lib/public/DB/QueryBuilder/ITypedQueryBuilder.php"/> | |||
| <file name="lib/private/Share20/ShareHelper.php"/> | |||
| <file name="lib/public/Share/IShareHelper.php"/> | |||
| <directory name="apps/appstore/lib" /> | |||
There was a problem hiding this comment.
| <directory name="apps/appstore/lib" /> | |
| <directory name="apps/appstore" /> |
| <!-- Missing types of the AppFetcher and the OC_Apps class for return types --> | ||
| <file name="apps/appstore/lib/Controller/ApiController.php" /> | ||
| <!-- ... --> | ||
| <directory name="apps/**/composer"/> | ||
| <directory name="apps/**/tests"/> | ||
| <directory name="lib/private"/> | ||
| <directory name="lib/public"/> | ||
| <directory name="lib/composer"/> | ||
| <directory name="lib/l10n"/> | ||
| <directory name="3rdparty"/> | ||
| <directory name="build"/> |
There was a problem hiding this comment.
All of this should not be necessary 🤔
For Unified Sharing I have a whole new app and parts of lib/public and lib/private in this config and there is no issue with that.
artonge
left a comment
There was a problem hiding this comment.
Much more manageable, thanks for splitting :)
Summary
See #57290 for details.
This only contains the app split and the needed changes to make it work in a separate app.
Moreover this also applies strict rector rules, for this I needed to fix a bug where rector (and also for psalm strict) did not have access to OCP (lib/public) and thus did not knew about those classes / interfaces and produced wrong output.
Checklist
3. to review, feature component)stable32)AI (if applicable)