YunoHost / package_check

Shell script which check package actions: install, remove, upgrade, backup, restore…
GNU General Public License v3.0
21 stars 26 forks source link

Epic refactoring because whathefuk #92

Closed alexAubin closed 3 years ago

alexAubin commented 3 years ago

So yeah I'm like at "only" 20hours of work on this and this is starting to look somewhat readable / evolvable ... I'm aiming to have a few separate pieces that can somewhat work independently from each other and that we can make evolve ... instead of a big pile of obscure global variables that magically change states in a completely incomprehensible, unnecessarily complex way. I'm just amazed that somehow the current code works so well...

alexAubin commented 3 years ago

Sooooooo it's somewhat starting to work and ready for feedback ... Still need to test all use cases on the battlefield

There's so many things I changed and I'm a bit tired to write an exhaustive list but here's a try ... :

About tests

To give you an idea, the test summary for wordpress looks like (forget about the actual OK/fail results, this is just to discuss the list of test being ran) :

Package linter:           OK 
Install (root):           OK 
Install (subdir):         OK 
Install (private):        OK 
Install (multi):         fail
Backup/restore:           OK 
Upgrade:                  OK 
Upgrade (00a1a6e7):      fail
Change url:              fail
Config/panel (actions):  fail
Config/panel (config_p): fail
Install (subdir):         OK 

In particular:

About the configuration, LXD, CI perspectives

By default there's no config file anymore. Default values are defined are the top of lib/common.sh. Though you may still create a config file to override the default. In particular, one could imagine setting ARCH=arm and who knows ... if you rebuild the base image, it should pick up the ARM LXC and run everything with that arch (supposedly cross-architecture, meaning from an x64 machine). Absolutely not tested though...

Similarly, one could tweak the branch that's used for yunohost install and create a base image that's based on testing or unstable or next-debian... Theoretically, one could run multiple instances of package_check as long as LXC_BASE and LXC_NAME are named appropriately to not conflict with other stuff...

Possible other improvements

kay0u commented 3 years ago

I'd be nice to add an argument to be able to give a specific config file --config_path ./config for example.

kay0u commented 3 years ago

Backup/restore tests should be for both root and subpath (if the corresponding test was performed before)