gaucho icon indicating copy to clipboard operation
gaucho copied to clipboard

Task concatenation

Open angrykoala opened this issue 3 years ago • 5 comments

Original by @VictorGrycuk

would it be possible to add an option to chain the tasks? If the first tasks finishes OK, the second one will be executed, and if that one finishes OK, the second one will be executed.

Both of these requests would make it similar to Microsoft Pipelines, in that you have a series of steps where the next depends on the previous, and all share variables.

Use Case

There are times that I need to test bot libraries and bot samples, so I need to do the following:

Install dependencies Build the library Run the library tests Package the library Use the created package to build a bot sample Run the bot sample tests Deploy or Start the bot sample I have created several scripts that do some combination of the above steps, but it would be awesome if I can move the above steps to gaucho, check a checkbox to select which steps I want to run sequentially, and run them.

angrykoala avatar Jan 13 '21 13:01 angrykoala

Hi @VictorGrycuk

First of, I need to clear up that, unlike azure pipelines or other software, Gaucho is intended to be used manually, not automatically, so maybe consider using scripting or other tools for automatic processes and trigger those with gaucho.

With that said, even if Gaucho is not intended for automation, I see the point on adding some light helpers for task automation (like the already implemented scheduler). Having a full-blown pipeline configuration is a bit out of scope, but we may be able to add some simple scheduling to execute a task after another.

I see a few of ways of doing this while keeping a somewhat small scope:

Using command-line

Currently, gaucho is a UI only app, but it may be quite versatile to allow using it through commands, (e.g. gaucho run mySuite/myTask) Implementing this would allow anyone to automate their own pipeline by running a second gaucho task in the first gaucho task (or any crazy thing anyone might need)

The main difficulty here is that nothing is in place for running gaucho from commandline, plus some refactor in how the app is running (a full app instance every time is opened) may be required

Run task after option

Another option is to have a new setting in tasks so we can define another task to be run after. As before, some refactor may be required to be able to select a task and some complexity may arise from this (e.g. what happens if a task is deleted, how to export a suite etc...)

Run suite secuantially

FInally, I can think of a button (like the current "Run suite") that runs all the tasks in the suite one after the other. This is by far the easiest alternative, but it is quite limited, as all the tasks need to be defined in a suite and you could define more complex pipelines.

What do you think of these approaches? Will solve your problem?

angrykoala avatar Jan 13 '21 13:01 angrykoala

Thanks @angrykoala. I am sorry, I didn't mean to say that I wanted gaucho to replace MS Pipelines. I understand they are meant for completely different uses. I only used MS Pipelines because if its sequential tasks and how it stops (or not) when one of them fails.

My thoughts on your suggestions:

  • Using command-line. Due to your mentioning a refactor, I would like to discard this on the short term. Maybe go back to this whenever you plan on making a refactor, and then include this.
  • Run task after option. This seems in line with the above option in terms of complexity in that it will require some refactor.
  • Run suite secuantially. I like this because it is simple, it can be integrated and then improved upon on future releases (if needed).

Now, my idea is something of a mix of the second and third option, but it might be more complex: When you edit a suite, it will show a checkbox next to the task that will show or hide that task when you are out of the edit mode. Clicking Run suite sequentially will run all the shown tasks in sequence. Maybe it doesn't have to hide them, just having a checkbox on the tasks you want to run sequentially is enough.

I have no idea how viable this is, so take my suggestion as someone that just found Gaucho and is excited about its uses :slightly_smiling_face:

VictorGrycuk avatar Jan 13 '21 17:01 VictorGrycuk

Hi @VictorGrycuk No worries, I knew what you meant, I was just clarifying the intended scope of gaucho :smile:, as I said, I think your suggestion is a reasonable one for this project.

Well, I've been planning some refactor on Gaucho for some time now, I cannot say exactly how much work would be, but in any case none of the alternatives mentioned go through a full rewrite or anything, it is simply that some of the core behavior needs to be changed (not the first time anyway)

Regarding your proposal: It is a reasonable tradeof (it is easier than options 1 or 2) but it is still way harder to implement than the third option (particularly, the design/css aspect which always haunts me). The main issue though is that I don't see this neither as a quick fix (such as the 3rd option) nor a flexible future-proof(ish) solution as the other 2, so if some development is required I would rather go directly to the other 2.

I would need to tinker a bit with the code to know how costly would be to implement these options, If you can think on other alternatives feel free to tell me

angrykoala avatar Jan 13 '21 17:01 angrykoala

Thanks! Even the simplest option beats having to type npm i && npm run build && npm run tests manually (I am that lazy!).

I would love to you give you a hand with this, but I am not very friendly with JS. However, I will take a look at the code to see if I can learn something.

VictorGrycuk avatar Jan 13 '21 18:01 VictorGrycuk

@VictorGrycuk I know this is not the point of your comment, but remember that you can create a single task in gaucho along with && (may depend if you are using windows) so all your concatenated tasks are in a single task, not ideal, but lazy enough :laughing:

Sure, not the most elegant code in the block, but happy to get any help if you can

angrykoala avatar Jan 13 '21 19:01 angrykoala