-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Inconsistent parsing of version.yaml #5271
Comments
@tobias-kuendig if you release a new version then your plugin will be rebuilt, the cached copy of the changelog on the marketplace shouldn't cause any issues with the actual installation of the plugin itself if you trigger a rebuild by releasing a new version. Seems like this is a new warning bubbling up from newer PHP versions. |
That works, thanks. I must have messed up something on the first try as the error was still there.
That's what I thought at first but it looks like this warning has been there since the early days: https://3v4l.org/MeoBt It looks like it is related to the Parsed
Output with 3.4.43:
What do you think, do we have to do something about that? It's an edge case and the YAML was invalid to begin with. |
@tobias-kuendig I think at very least it's worth reporting to Symfony, perhaps they have some insight into why a patch version suddenly started parsing differently. |
It looks like the real problem is the According to the yaml spec, a line starting with I'm not sure if it has to explicitly be a single Maybe we should make sure that these messages are properly quoted in the docs? https://octobercms.com/docs/plugin/updates#version-file |
@tobias-kuendig I've added some unit tests for this here: e7b1862 It seems to be the combination of both I think you're right - we'll have to update the docs to stipulate quotes around the message in cases like these. We could potentially lock |
Check out the updated symfony issue as well: I guess using quotes for the update messages is the proper way forward. |
@bennothommo @tobias-kuendig is there anything we can do (perhaps pre-process the file) to fix this for October users? Are we able to preprocess the file to automatically add quotes around the !!! line? |
@LukeTowers we certainly can try and implement some pre-processing to catch most of the issues - for example, if we pre-process the version numbers to contain quotes, we could even upgrade The only potential concern is some fringe cases where people may have formatted their YAML files in weird ways - |
I figure we can probably just stay on 3.x for a while, there's not much benefit from upgrading AFAIK. |
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. |
I encountered this a couple of days ago when I was testing something else - I'll have to put some further thought into mitigating this. |
It also doesn't parse correctly if tabs are used instead of spaces. |
@josephcrowell that won't be changed. YAML does not support tabs and never will. See https://yaml.org/faq.html |
since we are now on laravel 6 some laravel packages require never version of |
@slowpokefarm you can try if you'd like, but it's going to be tricky to make it work because they made some breaking changes that impact October quite heavily as I recall. You could also try the |
@slowpokefarm We cannot upgrade We would have to pre-process the YAML files in some way before running them through the Yaml library if we wanted to upgrade it, as @LukeTowers suggested here. |
@bennothommo Hello, I understand the issue but like @LukeTowers already mentioned |
@slowpokefarm We both agree with you, no need for a separate issue, this is the issue for it. From where we are right now the way forward is preprocessing, or perhaps processing-on-exception, with either solution implementing some form of caching potentially (I think there may already be some caching of processed YAML, we could probably tweak that). It's not a pressing issue for either myself or @bennothommo at the moment, so if it is for you feel free to work on a PR to implement support for newer versions of the YAML package. |
As discussed integer keys will no longer be supported soon. I've updated the docs to reflect this octobercms/docs@db8fd73 This is a proactive measure for what's coming but all plugin and theme authors should look at updating their edit: On second pass, the proposed YAML is quite messy and hard to read (defeating the purpose). The Builder plugin also seems to output "invalid YAML" even though it is produced by the |
So, what is the final decision on this? |
@daftspunk Hi there again. Shall we expect the changes for the 1.1 or will it be just left out there without proper support for laravel 6 packages? Maybe it's a good idea to rollback to laravel 5.5 then since old version of packages are fine with |
A problem did arise with our mall plugin's version.yaml. Suddenly, this line is causing an issue during the installation:
https://github.com/OFFLINE-GmbH/oc-mall-plugin/blame/640ae7f236c9290678e2cceb99b4cf764b15fd98/updates/version.yaml#L195
Issue OFFLINE-GmbH/oc-mall-plugin#573
Because of the
:
in the message, this is interpreted as an array. I guess according to the YAML spec this is the correct thing to do and the message should have been wrapped in quotes to begin with.The strange thing is, this has been working for the past year without any problems. It currently still works in the plugin's backend detail page (
/backend/system/updates/details/offline-mall/changelog
) and the plugin's marketplace page.But it fails when installing the plugin on the latest version of October.
For one, it would be great if someone from the October team could manually patch the plugin's changelog since the fixed changelog I publish via the Marketplace does not override old entries:
https://github.com/OFFLINE-GmbH/oc-mall-plugin/pull/572/files
Apart from that, is there anything that should be patched? This behaviour clearly changed in one of the last few releases. The relevant lines in the VersionManager class have not been changed recently:
https://github.com/octobercms/october/blame/1.0/modules/system/classes/VersionManager.php#L563
What happens if someone releases a version.yaml with the same "problem"? This would also break their plugin.
The text was updated successfully, but these errors were encountered: