modmore / Gitify

Command line toolkit to make managing a MODX site in git a lot easier.
MIT License
122 stars 55 forks source link

v1.x and PHP 8 compatibility issue (Symfony Yaml) #381

Closed rtripault closed 3 years ago

rtripault commented 3 years ago

Summary

Hello there! :wave:

When running v1.x branch (namely 1.1.2-pl) with PHP 8.0.x (8.0.12) we are granted by the following error Fatal error: Array and string offset access syntax with curly braces is no longer supported in /home/gitify/vendor/symfony/yaml/Symfony/Component/Yaml/Unescaper.php on line 70 when trying to run Gitify build

Apparently, the Yaml component API used by Gitify (Yaml::parse & Yaml::dump) did not change across versions.

We updated the Yaml requirement to be "symfony/yaml": "2.6.*|3.*|4.*|5.*" which resulted in installing (as of today) 3.3.18 and solved the issue.

No extensive tests (yet) were done regarding other Gitify commands.

Cheers!

Mark-H commented 3 years ago

I'd definitely encourage using v2 if you can as that has all the dependencies brought freshly up to date. I'm a little worried about introducing issues into v1 by changing dependencies there, although it does look like the update in v2 was pretty smooth.

For the differences with v2 see: https://github.com/modmore/Gitify#upgrading-to-v2-warn-in-development

rtripault commented 3 years ago

Thanks Mark! That's definitely an option i did not consider (because of "alpha"), but sounds sensible. Completely getting your concern about breaking things on v1.x branch... that was mostly to share our experience.

Many thanks ;)

Mark-H commented 3 years ago

Before closing this... @muzzwood: Given you handled the dependency updates, do you have any thoughts?

muzzwood commented 3 years ago

The dependency upgrade was indeed smooth. Depending on the minimum requirements for the dependencies, perhaps we could upgrade them for v1 to the lowest version that works with PHP8 (YAML 3.3.18 as indicated by @rtripault) without any pitfalls. 🤔

Mark-H commented 3 years ago

Let's do that then to keep 1.x supported at least a little longer then - at least until V2 is launched as stable and gitify watch is updated.

muzzwood commented 3 years ago

Sounds good! I'll aim to get that done tomorrow.

muzzwood commented 3 years ago

Closing as symfony/yaml has now been upgraded to 3.3.* in Gitify v1 https://github.com/modmore/Gitify/commit/57ecdb63d42053d38d4e15a2b89853dd09dfa7e6

Thanks for reporting this @rtripault !