Report failed action names on dispatch failure#397
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #397 +/- ##
==========================================
+ Coverage 89.70% 90.29% +0.58%
==========================================
Files 21 21
Lines 826 835 +9
==========================================
+ Hits 741 754 +13
+ Misses 85 81 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5a89d61 to
32d6756
Compare
Track which actions failed during dispatch and include their names in the error message. Failed actions are stored internally and exposed via get_failed_actions(), preserving the existing dispatch() -> bool return type for backwards compatibility.
32d6756 to
433f61e
Compare
|
@anishathalye Bump, does this change look reasonable to you? |
|
Sorry, been a bit backlogged, as I often am 😅 Will try to take a look in the next couple days. |
|
Overall seems like a fine idea. One detail is that Dotbot configuration is a list of "tasks", where each task can have multiple "actions". This is mostly historical, I think these days most people use one action per task. What should the right behavior be when there are potentially multiple actions per task, and the same action can appear multiple times across tasks (e.g., there may be multiple Also, to avoid mixing up tasks and actions in the error message, we could make the error message something like: Thoughts? |
|
This may also be messy enough that it's not worth it. Do users have configs that are so big that the output from Dotbot is hard to parse and a summary of failed actions would be helpful? Is your config large enough for this / what motivated this change? |
When dotbot fails, the error message currently only says:
This provides no indication of which actions failed, forcing the user to scroll back through the log to identify the problem. This is especially painful with long-running configs that have many actions (package installs, linking, shell commands, etc.), or when running with verbose flags.
This PR adds tracking of failed action names and includes them in the error message.
Before:
After:
Backwards Compatibility
The
dispatch() -> boolsignature is unchanged. The newget_failed_actions()method is additive. Existing third-party plugins that calldispatcher.dispatch(tasks)will continue to work without modification.