YunoHost / issues

General issue tracker for the YunoHost project
71 stars 8 forks source link

Packaging: Handle app rename / replacement / migration #2306

Open Salamandar opened 5 months ago

Salamandar commented 5 months ago

We start to have a number of apps renamed / replaced. It would be nice to have the core support this kind of migration.

etc ?

alexAubin commented 5 months ago

Yes there's an unofficial helper for that somewhere but it would definitely be nice to have some proper core integration

alexAubin commented 5 months ago

(cf the experimental helper i was thinking about : https://github.com/YunoHost-Apps/Experimental_helpers/tree/master/ynh_handle_app_migration )

Salamandar commented 2 months ago

OK so here's a plan :

  1. have the apps.toml contain the "migration path" (either migrate_to in the old app or migrate_from in the new app) and that would be copied in the catalog.json
  2. The yunohost core would read this migrate_to/from and expose this migration just as an upgrade
  3. The upgrade command/webpage should warn about the migration: app rename, db, install_path, and home page tile label changes.
  4. The helper should be integrated in the core to prevent divergence / handle packagingv2

Issues I see:

apps.toml content

I would prefer a migrate_to key in the old app's section (also more coherent with the core code) but what about when the old app is moved to graveyard ? Then it's not in the catalog anymore… And the migration is not provided anymore. Also migrate_from can lead to weird cases if multiple new apps declare this.

Helper

How to handle eventual old-app-as-packagingv1 to new-app-as-packagingv2 migrations ? For now we don't have any way to run custom code before the packagingv2 provisionning code. We might need to in case there are tweaks to be run. Maybe not though.