-
Notifications
You must be signed in to change notification settings - Fork 48
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
Introduce before and after steps for a task. #56
Conversation
A task is now able to have several steps which are executed before and after its own execution. The config syntax for this is the same as for the task itself: 'command', 'script' and 'exec' are supported. A task and all of the preceeding steps will still be executed even when the before steps are failing. Running a task now returns a list of errors which are logged according to their occurrence for easier troubleshooting.
97962fd
to
d3446af
Compare
Preceeding to _every_ task, all before steps will be eecuted and accordingly succeeding to all tasks all after steps.
@yields ping 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, seems like it just needs some docs to match the rest of the codebase.
No problem, will do so. Just wanted to make sure that you guys are ok with the feature(s). |
@yields updated the code documentation and the readme accordingly. If you are happy with it, I will squash the commits into a single reasonable commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! -- thanks for the extra docs :)
Hi guys, I just submitted #58 and was looking over this code. I just wanted to provide this commentary because the feature isn't technically released yet and there's no better time to fix it than before it's broken!
Now, what does this feature give users of robo? Remember that per-task before/after functionality is trivial to move into the main task. The global before-after tasks could be moved into an external wrapper script, but then you lose the ability to interpolate variables in them, which was presumably a motivating factor for this feature. Fortunately, it's very simple to accomplish this using robo's pre-existing composition feature. I've included a rewritten version of this below. Note that the UX is different, we have to run I don't mean to come in and poo-poo @jenpet's hard work, so I'm sorry that all I have to offer right now is negative feedback. But I think that this feature adds substantial complexity to robo that wasn't fully considered with the feature was added. foo:
command: |
echo "local before {{ .foo }}"
git status
echo "local after"
wrap:
command: |
echo "global before {{ .foo }}"
robo "$@"
/global/after-script.sh
variables:
foo: bar |
Hey guys, I fiddled around with some
before
andafter
functionality I could use within robo. Hopefully this finds a way into master. Let me know what you think, will update the docs after we're all happy with it :-)A task is now able to have several steps which are executed before and after its own execution. The config syntax for this is the same as for the task itself: 'command', 'script' and 'exec' are supported. A task and all of the preceeding steps will still be executed even when the before steps are failing.
Running a task now returns a list of errors which are logged according to their occurrence for easier troubleshooting.