-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Add occ app:remove CLI command #11627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Patrik Kernstock <[email protected]>
Signed-off-by: Patrik Kernstock <[email protected]>
skjnldsv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks 👍
|
Should we have a mechanism to allow apps to delete their data when they are removed? I think this command gives the impression that it would leave the instance if as the app was never installed, while database and app data entries remains. |
The mechanism is in the appSettings management indeed, but not in the Installer class: server/settings/Controller/AppSettingsController.php Lines 510 to 513 in 9057621
|
|
@skjnldsv Based on the comment in following lines, the server/lib/public/App/IAppManager.php Lines 143 to 147 in 2e36069
On some further research, apparently uninstall steps are executed when disabling the app: server/lib/private/App/AppManager.php Lines 286 to 303 in 2e36069
You're right, @ChristophWurst. The default behavior seems to be to perform app uninstall steps when disabling the app, so same should happen when using the However: Would it make sense to provide a additional parameter to allow to keep the data of the app when removing? Something like: |
Oh that's a really great idea!! 🎉 👍 |
|
so why would you remove but keep data, instead of just disabling the app? |
Downgrade ? I just did it with contacts ;) |
|
Downgrade is not a supported usecase. But well, fine by me. |
|
When removing an app I would basically do following:
I'd use
Any suggestions? |
Signed-off-by: Patrik Kernstock <[email protected]>
Signed-off-by: Patrik Kernstock <[email protected]>
Signed-off-by: Patrik Kernstock <[email protected]>
ChristophWurst
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thing. Apart from that it's ready to be merged IMO 👍 Nice work!
Signed-off-by: Patrik Kernstock <[email protected]>
|
When |
I doubt we have any clear rules for it. Use it where it makes sense, I'd say 😉 FYI: there's also the option to make text bold, which I now use to emphasize some important sections of the output like at https://github.com/ChristophWurst/twofactor_admin/blob/d9cac99b10f3b2bf56427aa2dd64cabadd5713ad/lib/Command/Generate.php#L70 |
Signed-off-by: Patrik Kernstock <[email protected]>
|
Okay! Thanks for the information! I've added the |
|
Is this probably something which is worth being backported to |
It's a feature and we only backport fixes. This will be 15+ only. |
|
@patschi for the sake of having atomic commits and a clean git history, I'd appreciate if you could squash these commits into a single one 😉 @nickvergessen final review? I'd like to have your feedback on this because you know the app management code a lot better. |
|
What is the status here? |
If the button is green then click it ;) I'm not the only one that is allowed to do so. 😉 |
While PR #11053 recently added the possibility for updating apps and PR #5644 to install apps, basically just removing apps is missing... This PR adds the command to be able to remove apps using CLI.
I've decided to use the term
removebecause of two reasons:OC\Installerthe function is also calledremoveApp()uninstallwith commandinstallUsage is simple as that:
Now we have all important CLI commands to be able to manage apps using the command line, perfectly for automation tasks.