Skip to content

Add quotation to children's input options if required #42

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

Merged

Conversation

andreas-gruenwald
Copy link
Contributor

@andreas-gruenwald andreas-gruenwald commented Jun 4, 2020

resolves #41

@andreas-gruenwald
Copy link
Contributor Author

andreas-gruenwald commented Jun 4, 2020

@theofidry Would be great if you could take a look at it soon, as one of our releases depends on this
one.

Update: we are going to do some additional internal tests and will then report the test results here.
Note: as a workaround we could make serializeInputOptions protected, then it is easy to override the behavior.

@andreas-gruenwald
Copy link
Contributor Author

Successfully tested:

bin/console app:ecommerce:bootstrap --update-index --tenant=AT_de_elastic --processes 1 --list-condition='o_id in ("20") or o_id > 5000000'
bin/console app:ecommerce:bootstrap --update-index --tenant=AT_de_elastic --processes 1 --list-condition="o_id in ('20') or o_id > 5000000"
bin/console app:ecommerce:bootstrap --update-index --tenant=AT_de_elastic --processes 1 --list-condition="o_id in (\"20\") or o_id > 5000000"

PR should be ready.

@theofidry theofidry merged commit d77b2d4 into webmozarts:1.x Jun 8, 2020
@theofidry
Copy link
Collaborator

Thank you @andreas-gruenwald

theofidry added a commit that referenced this pull request Sep 30, 2022
In #28, the feature to forward the command options was introduced. It had to later be followed up by #41, #42 in order to fix the issue where the option value may require quoting. This piece of code is heavily under-tested (and it was really hard to test it as is) and is prone to bugs (I found 2 adding tests).

In this PR, I'm extracting this element into `InputOptionsSerializer` as a closed piece (static & final) as IMO there is no need to make it extensible: if broken it needs to be fixed. This extraction allows much easier testing.

This PR also fixes:

- the case of negatable options
- detection quoting with may fail to detect some special characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants