Do not create duplicate routes when running the action generator repeatedly#417
Conversation
|
ℹ️ Optional job failed: Ruby jruby |
|
Thanks for working on this, @sandbergja! ❤️ Just a thought on the approach: instead of raising My feeling is that if there really is a legitimate conflict, it would be on the action file itself, which we already handle noisily via the existing Overall, I would like our generators just "do the right thing" as much as possible without erroring and forcing user reaction, and no-op-ing when a route already exists feels like it fits with this approach. What do you think? (I also realised while reviewing this that we need to make our action generator aware of our new There's also a bunch of rubocop failures showing in the tests here, and that's because I changed one of our default rules last night. I'll go and fix that separately in the main branch now. |
|
RuboCop issues fixed in abc244a, a rebase should sort you out here :) |
e5859b1 to
eff36ba
Compare
|
Sounds good to me, @timriley, and thanks for the review! I've rebased and changed the behavior to a no-op (with a short message informing the user that the route is being skipped). |
|
Just wanted to say: good job! I was trying to solve this issue once, but got stuck somewhere between Hanami CLI and Dry Files. You went into much better direction with the fix. I also second that conflict should be o no-op, not a blocker - but you already fixed that. |
|
Thank you again, @sandbergja, this is great! I just pushed up a changelog entry, and I'll merge this now :) |
Closes #146