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
InvalidConfigException can not parse error when CommandNotFoundException triggered #900
Comments
Could you show an example of what you mean by keys being indented? There's a test for a whole file being indented, and the test is passing: |
sure!
|
Reproduced, it looks like the parser [now] wants the comments to be indented by the same amount as the keys. While philosophically that seems wrong to me (because comments should not affect surrounding code), and a fix seems fairly doable, I also don't want to diverge too far from Symfony's parser as it's by far the main way to parse YAML in PHP. Is there a strong reason to keep the indents like this? |
Strong reason? no. It'll take us a little bit to get the change propagated out to our 100+ projects, but as long as you think the issue is isolated to just this scenario, I can educate developers to avoid this situation (or just know the issue can occur) until they merge from our upstream. |
I think the parser change responsible may be from Symfony v3.4.31: If so, this was the case since the platformsh-cli v3.48.0, released on 21 September 2019. |
Actually testing with the platformsh-cli v3.47.0 (and symfony v3.4.27), I still get the same parse error. Maybe this CommandNotFoundException is triggering the parse error in a different way with more recent CLI versions, but I don't see that this could have been parsed in recent CLI versions. |
OK the exception is probably being thrown because the command list is getting loaded, which triggers isHidden() on every command, which means that the app config is getting parsed via: It would make sense not to throw an exception in that case. |
I'll still begin work on removing indentation from included yaml files. It's been awhile since we broke up the platform.app.yaml file into multiple includes, and I'm betting the indentation was just left from what it used to be in platform.app.yaml. |
we have our platform.app.yaml file broken up into numerous sub yaml files that are included (this allows us to organize sections that downstream projects should alter, vs sections they should not). With the release of the CLI tool v3.52, we now get an
InvalidConfigException, unable to parse
error whenever aCommandNotFoundException
is raised.For example,
platform help environment
will cause a[InvalidConfigException] Unable to parse at line
error, whereasplatform help environment:list
does not produce any errors. Additionally, the platform environment itself is able to parse the yaml files without issue.It appears that the yaml parser being used post v3.51 does not like the keys to be indented in included yaml files, at least when raising another exception. v3.51.x and earlier, did not exhibit this behavior.
The text was updated successfully, but these errors were encountered: