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

Stop Boxstarter continuing on first package install failure #382

Closed
htnhan opened this issue Dec 19, 2018 · 6 comments
Closed

Stop Boxstarter continuing on first package install failure #382

htnhan opened this issue Dec 19, 2018 · 6 comments
Assignees
Labels
5 - Released The issue has been resolved, and released to the public for consumption Improvement Issues that enhances existing functionality, or adds new features
Milestone

Comments

@htnhan
Copy link
Contributor

htnhan commented Dec 19, 2018

Per @pauby recommendation, I create this question to discuss PR #296. CC @gep13, @mwallner, @flcdrg and @mwrock

@mwallner suggests that my PR will break current BoxStarter behavior with the following case:

cinst something -y
cinst foo -y
cinst bar -y

with the assumption that foo always fails to install. Currently, BoxStarter happily install something, skip foo, and continue to install bar. With my PR, BoxStarter will stops after the fail attempt to install foo.

Unless I miss something, I thought even with my PR, BoxStarter still continues to bar. cinst simply returns a 1 (indicating an error occurs) instead of a 0 (no error) (Boxstarter.Chocolatey/Chocolatey.ps1 line 59, and line 181-184). The installer script has the liberty to decide what happens when BoxStarter fails to install foo: report an error and stop, or log the failed package and continue.

Is my assumption correct?

@mwallner mwallner added Discussion 0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue labels Dec 19, 2018
@pauby pauby changed the title Discussion regarding PR# 296 Chocolatey wrapper to quickly exit and report errors to callers Dec 26, 2018
@pauby
Copy link
Member

pauby commented Mar 19, 2019

with the assumption that foo always fails to install. Currently, BoxStarter happily install something, skip foo, and continue to install bar. With my PR, BoxStarter will stops after the fail attempt to install foo.

This is a breaking change. Boxstarter is intended to automate the installation / configuration of a machine. So you:

  1. Create a Boxstarter script
  2. Have Boxstarter run that script
  3. Go away and grab a coffee / get on with some work
  4. Come back and the machine is built and in this case the error that package foo could not be installed is flagged up. You can then decide what you want to do (install it again, forget about it etc.).

Your changes mean:

  1. Create a Boxstarter script
  2. Have Boxstarter run that script
  3. Go away and grab a coffee / get on with some work
  4. Come back and the machine is not built as the script stopped at package foo with an error

If this breaking change is implemented then the user should be given the choice to stop on errors - the default remaining as it is now and continuing through the errors.
The switch -StopOnError has been suggested.

@pauby pauby added the Breaking Change The issue will introduce backwards incompatible changes label Mar 19, 2019
@simmdan
Copy link

simmdan commented Mar 29, 2019

For what it's worth, I absolutely need some version of this change. I'm using boxstarter to automate configuration of build machines, and my recent discovery that it wasn't already working this way (when one of my chocolatey packages stopped installing correctly but I didn't realize because the errors were buried in the middle of a giant script log and everything had proceeded in spite of the errors) was a rude surprise.

For the time being I'm going to take a fork of boxstarter with the changes in the PR, but it would be great if we could get some kind of option for continue or stop on failure in the official boxstarter releases.

Thanks!

@pauby pauby added the 0 - Waiting on User Insufficient information for issue or PR, issue may be closed if no response from user label Apr 23, 2019
@mwallner
Copy link
Member

mwallner commented Jun 5, 2019

@simmdan - would an optional switch, such as the suggested -StopOnError be possible in your environment?
i.e. adding the switch to your Boxstarter calls that absolutely need to stop after the first error occured.
(otherwise I currently see no way that we can move forward with #296)

@simmdan
Copy link

simmdan commented Jun 5, 2019

Yes an optional switch would work fine in my environment.

@mwallner mwallner self-assigned this Jul 15, 2019
@mwallner mwallner added this to the v2.13.0 milestone Jul 15, 2019
@mwallner mwallner added 2 - Working A user or team member has started working on the issue and removed 0 - Waiting on User Insufficient information for issue or PR, issue may be closed if no response from user Breaking Change The issue will introduce backwards incompatible changes labels Jul 22, 2019
@mwallner
Copy link
Member

@simmdan I've finally had time to spend a little time on this, see GH-402 , anyway: I think that GH-401 may actually be a better fit for your use case once we've got some implementation for that issue.
(I've got similar use case where I want to install as many packages as possible, but get a meaningful result/state- if any package install failed - at the end of the Boxstarter invocation)

@pauby
Copy link
Member

pauby commented Oct 9, 2019

I like the idea of this ultimately reporting back to the user, after Boxstarter is finished, on how many packages were installed and how many were not (including errors if we have any). This is being discussed in #401

pauby added a commit that referenced this issue Feb 26, 2020
(GH-382) Add command line switch 'StopOnPackageFailure'
@pauby pauby closed this as completed Feb 26, 2020
@pauby pauby added 5 - Released The issue has been resolved, and released to the public for consumption Improvement Issues that enhances existing functionality, or adds new features and removed 0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue 2 - Working A user or team member has started working on the issue labels Feb 26, 2020
@pauby pauby changed the title Chocolatey wrapper to quickly exit and report errors to callers Stop Boxstarter continuing on first package install failure Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Released The issue has been resolved, and released to the public for consumption Improvement Issues that enhances existing functionality, or adds new features
Projects
None yet
Development

No branches or pull requests

4 participants