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

Issue #3455: powershell_script: do not allow suppression of syntax errors #3455

Merged
merged 1 commit into from
Jun 26, 2015

Conversation

adamedx
Copy link
Contributor

@adamedx adamedx commented May 31, 2015

@ksubrama, @btm, @jdmundrawala thanks for merging #3080. Here's an addendum based on a few pieces of feedback I didn't follow up on:

  1. Took @jdmundrawala 's feedback that preserving behavior of other script resources that let you suppress syntax errors just added complexity at the expense of obscuring a much more likely scenario: user expects a (failure) return code of 1, but the script itself has a syntax error. In that case, the script needs to be fixed by the user, but the user isn't aware because Chef reports no error. The powershell_script resource hasn't been around long enough to need such strict backwards compatibility to justify the complexity in code (evidenced by numerous questions in the Issue 2247: powershell_script exit status should be nonzero for syntax errors #3080 conversation) and the difficulty of the aforementioned scenario.
  2. Feedback from @ksubrama and @jdmundrawala around it not being obvious how we were actually doing the syntax check by embedding user code in a PowerShell script block. That's actually the core idea of the syntax validation, so to make that more obvious, I've restructured the code generation string so that instead of a terse one-liner, it's in multiple lines and looks closer to how you'd write idiomatic PowerShell code where the block was more obvious.

@adamedx adamedx changed the title Issue #3080: powershell_script: do not allow suppression of syntax errors Issue #3455: powershell_script: do not allow suppression of syntax errors May 31, 2015
@jaym
Copy link
Contributor

jaym commented Jun 1, 2015

👍

1 similar comment
@ksubrama
Copy link

👍

@ksubrama ksubrama force-pushed the adamedx/ps-syntax-always-raise branch from bc83f8f to 0c13df2 Compare June 26, 2015 20:35
@ksubrama ksubrama merged commit 0c13df2 into master Jun 26, 2015
@ksubrama ksubrama deleted the adamedx/ps-syntax-always-raise branch August 26, 2015 20:00
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants