Skip to content

Migrate away from OC_App and toward IAppManager. - #44025

Merged
come-nc merged 8 commits into
masterfrom
fix/remove-oc-app-calls
Apr 22, 2024
Merged

Migrate away from OC_App and toward IAppManager.#44025
come-nc merged 8 commits into
masterfrom
fix/remove-oc-app-calls

Conversation

@come-nc

@come-nccome-nc commented Mar 6, 2024

Copy link
Copy Markdown
Contributor

Summary

Migrate away from OC_App and toward IAppManager.

Checklist

@come-nccome-nc added the 2. developing Work in progress label Mar 6, 2024
@come-nccome-nc self-assigned this Mar 6, 2024
@come-nc
come-ncforce-pushed the fix/remove-oc-app-calls branch from 173f7f9 to f281499CompareMarch 6, 2024 11:13
Comment threadcore/Command/App/Remove.php Fixed
private function getInstalledAppsValues(): array {
if (!$this->installedAppsCache) {
$values = $this->appConfig->getValues(false, 'enabled');
$values = $this->getAppConfig()->getValues(false, 'enabled');

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\AppConfig::getValues has been marked as deprecated
@come-nc
come-ncforce-pushed the fix/remove-oc-app-calls branch from 01b858c to babdd5aCompareMarch 6, 2024 15:00
//load the cache
if (count($this->appTypes) === 0) {
$this->appTypes = $this->appConfig->getValues(false, 'types') ?: [];
$this->appTypes = $this->getAppConfig()->getValues(false, 'types') ?: [];

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\AppConfig::getValues has been marked as deprecated
@come-nccome-nc changed the title Fix/remove oc app callsMigrate away from OC_App and toward IAppManager.Mar 6, 2024
@come-nccome-nc added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Mar 6, 2024
@come-nc
come-nc marked this pull request as ready for review March 6, 2024 21:45
@come-nc
come-nc requested review from a team, ArtificialOwl, ChristophWurst, icewind1991, nfebe and nickvergessen and removed request for a teamMarch 7, 2024 11:45
@come-nc
come-ncforce-pushed the fix/remove-oc-app-calls branch from 81bc004 to 3083a2eCompareMarch 7, 2024 13:33

@ChristophWurstChristophWurst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid some kaboom we might want to merge this after the 29 branch-off

@come-nccome-nc added this to the Nextcloud 30 milestone Mar 7, 2024
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
…lled
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Also fixed AppTest
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc
come-ncforce-pushed the fix/remove-oc-app-calls branch from 3083a2e to 1b5a0c3CompareApril 22, 2024 10:22
@come-nc

Copy link
Copy Markdown
ContributorAuthor

Rebased and fixed conflicts

Comment threadcore/Command/App/GetPath.php Outdated

$this->installedAppsCache[$appId] = 'yes';
$this->appConfig->setValue($appId, 'enabled', 'yes');
$this->getAppConfig()->setValue($appId, 'enabled', 'yes');

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\AppConfig::setValue has been marked as deprecated

$this->installedAppsCache[$appId] = json_encode($groupIds);
$this->appConfig->setValue($appId, 'enabled', json_encode($groupIds));
$this->getAppConfig()->setValue($appId, 'enabled', json_encode($groupIds));

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\AppConfig::setValue has been marked as deprecated

if ($automaticDisabled) {
$previousSetting = $this->appConfig->getValue($appId, 'enabled', 'yes');
$previousSetting = $this->getAppConfig()->getValue($appId, 'enabled', 'yes');

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\AppConfig::getValue has been marked as deprecated

unset($this->installedAppsCache[$appId]);
$this->appConfig->setValue($appId, 'enabled', 'no');
$this->getAppConfig()->setValue($appId, 'enabled', 'no');

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\AppConfig::setValue has been marked as deprecated
foreach ($apps as $appId) {
$appInfo = $this->getAppInfo($appId);
$appDbVersion = $this->appConfig->getValue($appId, 'installed_version');
$appDbVersion = $this->getAppConfig()->getValue($appId, 'installed_version');

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OC\AppConfig::getValue has been marked as deprecated
Comment threadcore/Command/App/Update.php Outdated
…ones
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc

Copy link
Copy Markdown
ContributorAuthor

@nickvergessen Reverted both calls. We’ll need later to add a replacement for getAllApps.

But the maintenance:install command segfaults since today rebase. I can reproduce locally but have no idea what happens.
I tried reverting the IURLGenerator injection in the appmanager but it does not change anything.

@nickvergessen

nickvergessen commented Apr 22, 2024

Copy link
Copy Markdown
Member

but have no idea what happens.

Circular dependencies in 99% of the cases

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
@come-nc

Copy link
Copy Markdown
ContributorAuthor

but have no idea what happens.

Circular dependencies in 99% of the cases

Yes, it was urlgenerator injection causing trouble as suspected. At first I thought it was not because I had missed one place it was pulled from.
Fixed now, should be good.

@come-nc
come-nc merged commit 37c89f4 into masterApr 22, 2024
@come-nc
come-nc deleted the fix/remove-oc-app-calls branch April 22, 2024 14:41
@blizzzblizzz mentioned this pull request Jul 24, 2024
@come-nccome-nc mentioned this pull request Sep 12, 2024
4 tasks
@joshtrichards

Copy link
Copy Markdown
Member

Related to open issue: #8505 :)

@blizzzblizzz mentioned this pull request Sep 11, 2025
6 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@come-nc@nickvergessen@joshtrichards@icewind1991@ChristophWurst@skjnldsv@github-advanced-security