Skip to content
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

[Console] Fallback to default answers when unable to read input #36031

Merged
merged 1 commit into from Mar 16, 2020

Conversation

ostrolucky
Copy link
Contributor

@ostrolucky ostrolucky commented Mar 11, 2020

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #36027, Fix #35988
License MIT
Doc PR

Alternative to #36027.

This fixes linked issues without having to revert fix for #30726. Successfully tested with composer script, docker run and docker run -it.

@bendavies
Copy link
Contributor

bendavies commented Mar 12, 2020

what about the fact that there is lots of code out there making decisions on $input->isInteractive() without using the question helper at all?
The behavior of all that code is different now.

@ostrolucky
Copy link
Contributor Author

Valid point. Can you link some?

@teohhanhui
Copy link
Contributor

Same argument I made in #36027 (comment)

@bendavies
Copy link
Contributor

Valid point. Can you link some?

There are quite a few.
https://github.com/symfony/symfony/search?q=isInteractive&type=

I was just greping my vendor folder and there will obviously be third party instances of this too.

@ostrolucky
Copy link
Contributor Author

There are quite a few.
symfony/symfony/search?q=isInteractive&type=

Thanks for the list. I checked it and none of those commands should break:

  • password encoder: Interactive check is run only when not providing password via argument. Running command in non-interactive shell without providing password doesn't make sense in the first place, but even if you do, result is error, similarly as before.
  • debug:container: it uses question helper as fallback
  • messenger:failed:retry: Again fallback. It doesn't make sense to run this command in non-interactive shell without providing id
  • debug:form : it uses question helper as fallback

@fabpot
Copy link
Member

fabpot commented Mar 16, 2020

Thank you @ostrolucky.

@danepowell
Copy link
Contributor

danepowell commented Mar 19, 2020

Just attaching a patch for folks wanting to test this via a composer patch to v4.4.5.
symfony-console-36031.txt

(this patch removes conflicting test files that would otherwise be in the diff)

@ostrolucky
Copy link
Contributor Author

No need, you may just suffix PR url with .patch https://github.com/symfony/symfony/pull/36031.patch

@danepowell
Copy link
Contributor

danepowell commented Mar 19, 2020

I tried that but it doesn't apply cleanly due to conflicting changes in the 4.4.x branch. My patch removes the conflicting test files.

@danepowell
Copy link
Contributor

I've confirmed that this PR fixes the regression on my project, thanks.

This was referenced Mar 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants