YunoHost-Apps / kimai2_ynh

Kimai v2 package for YunoHost
https://www.kimai.org/
MIT License
13 stars 8 forks source link

Fix upgrading #80

Closed CodeShakingSheep closed 5 months ago

CodeShakingSheep commented 5 months ago

Problem

Upgrade tests are failing, see here: https://ci-apps-dev.yunohost.org/ci/job/9479

93898 INFO DEBUG - !!  In PrototypedArrayNode.php line 271:
93898 INFO DEBUG - !!
93898 INFO DEBUG - !!    You are not allowed to define new elements for path "security.firewalls". P
93898 INFO DEBUG - !!    lease define all elements for this path in one config file.

Issue is in symfony framework, see https://github.com/symfony/symfony/issues/22308 and https://github.com/symfony/symfony/issues/25021. 2nd issue also referenced by Kevin Papst (lead developer of kimai) some time ago.

Solution

A security block (including firewall) is already included in security.yaml, see https://github.com/kimai/kimai/blob/main/config/packages/security.yaml . Thus, it must not be defined in local.yaml again. Solution: Remove duplicate security block from local.yaml.

PR Status

Automatic tests

Automatic tests can be triggered on https://ci-apps-dev.yunohost.org/ after creating the PR, by commenting "!testme", "!gogogadgetoci" or "By the power of systemd, I invoke The Great App CI to test this Pull Request!". (N.B. : for this to work you need to be a member of the Yunohost-Apps organization)

CodeShakingSheep commented 5 months ago

!testme

yunohost-bot commented 5 months ago

:rocket: Test Badge

CodeShakingSheep commented 5 months ago

Normal upgrade works but upgrade from 1.30.0 doesn't work. This is a different issue.

105174 INFO DEBUG - Executing script cache:clear [KO]
105175 INFO DEBUG -  [KO]
105175 INFO DEBUG - Script cache:clear returned with error code 1
105175 INFO DEBUG - !!
105175 INFO DEBUG - !!  In YamlFileLoader.php line 778:
105175 INFO DEBUG - !!
105176 INFO DEBUG - !!    There is no extension able to load the configuration for "admin_lte" (in "/
105176 INFO DEBUG - !!    var/www/kimai2/config/packages/admin_lte.yaml"). Looked for namespace "admi
105176 INFO DEBUG - !!    n_lte", found ""framework", "doctrine", "doctrine_migrations", "monolog", "
105176 INFO DEBUG - !!    twig", "security", "jms_serializer", "fos_rest", "nelmio_api_doc", "nelmio_
105177 INFO DEBUG - !!    cors", "webpack_encore", "twig_extra", "tabler", "scheb_two_factor", "kimai
105177 INFO DEBUG - !!    "".
105177 INFO DEBUG - !!
105177 INFO DEBUG - !!
105177 INFO DEBUG - !!
105177 INFO DEBUG - Script @auto-scripts was called via post-install-cmd

admin_lte.yaml was removed in kimai2, see https://github.com/kimai/kimai/commit/90a0fd8a221dce23dbd27451682d7134ab1ce9df#diff-c4e993aff182ae4943e6f0c817e528e4b5eb4c36eedc7575f1fdfdd53aad1b04 . So, not sure why this file is still loaded. Perhaps git state should be cleared. See similar issues: https://github.com/kimai/kimai/issues/1708 and https://github.com/kimai/kimai/issues/2774

Edit: Just found the info that when upgrading from 1.30 (or lower) to 2.0 a hard cache flush is required, see https://www.kimai.org/documentation/updates.html .

CodeShakingSheep commented 5 months ago

!testme

yunohost-bot commented 5 months ago

:stuck_out_tongue_winking_eye: Test Badge

CodeShakingSheep commented 5 months ago

!testme

yunohost-bot commented 5 months ago

:sunflower: Test Badge

CodeShakingSheep commented 5 months ago

!testme

yunohost-bot commented 5 months ago

Meow :cat2: Test Badge

CodeShakingSheep commented 5 months ago

!testme

yunohost-bot commented 5 months ago

:rocket: Test Badge

CodeShakingSheep commented 5 months ago

!testme

yunohost-bot commented 5 months ago

:rocket: Test Badge

CodeShakingSheep commented 5 months ago

!testme

yunohost-bot commented 5 months ago

:v: Test Badge

CodeShakingSheep commented 5 months ago

!testme

yunohost-bot commented 5 months ago

:rocket: Test Badge

CodeShakingSheep commented 5 months ago

!testme

yunohost-bot commented 5 months ago

:v: Test Badge

CodeShakingSheep commented 5 months ago

!testme

yunohost-bot commented 5 months ago

:sunflower: Test Badge

CodeShakingSheep commented 5 months ago

@ericgaspar I could fix upgrading. Ready for review and merging.

In summary, the solution was to remove the security block from local.yaml and to do a full_replace upgrade for major version update from 1.x to 2.x . Would make sense to squash my commits as I tried a bunch of other things in between.