Abort early if generator command fails#34420
Merged
y-yagi merged 7 commits intorails:masterfrom Dec 7, 2018
Merged
Conversation
|
r? @eileencodes (@rails-bot has picked a reviewer for you, use r? to override) |
b4ee86d to
cc7a5d1
Compare
y-yagi
reviewed
Dec 7, 2018
f3ea7ff to
f03f935
Compare
Member
|
@deivid-rodriguez Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR happens to overlap with #34418, but I think it tries to fix a slightly different problem. My issue is that sometimes rails generator commands that I run in CI fail, and I don't notice because the generator does not abort. So I added a feature in
thorto force aborting the process if this happens, which I'm using in this PR. I think this could maybe become the default, but for now I introduced it as an opt-in because there's situations where you don't want it (for example, if you dorails db:dropinside a generator, you probably want to ignore the case where the db does not exist).In my case, I run into this problem when using the
generateaction, so I refactored it to reuse therails_commandaction, so I only need to add the newabort_on_failureoption in a single place.This probably needs a change log entry and some docs but I wanted to gathers some opinions first!