Skip to content
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

Suite env variables #393

Closed
VictorGrycuk opened this issue Jan 13, 2021 · 7 comments
Closed

Suite env variables #393

VictorGrycuk opened this issue Jan 13, 2021 · 7 comments
Labels
Milestone

Comments

@VictorGrycuk
Copy link

VictorGrycuk commented Jan 13, 2021

Description

Hi, Gaucho seems to be something I wanted for a while, it's great!
However, I would like to request two features.

First, would it be possible for projects to have their own variables? That way I can add a variable at a project level and reuse it across the tasks of that same project.
I know there is an option to use environment variables, so a quick alternative could be being able to use the same env variable at a project level without having to set it on each task, if that makes sense.

Second, 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. (Discussion on #394 )

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:

  1. Install dependencies
  2. Build the library
  3. Run the library tests
  4. Package the library
  5. Use the created package to build a bot sample
  6. Run the bot sample tests
  7. 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.

The need for variables at a project level is to be able to set the project folder location and reuse them on the tasks, or generate a bot with a specific name that I need to use on a later step.

BTW, I love that the icon looks like a mate.
Thanks.

@angrykoala
Copy link
Owner

Hi @VictorGrycuk I understand that when you say "Projects" you are referring to suites (the tabs on top)

If you don't mind, I will split this issue in two, as we are discussing 2 separate features, I'll leave the first item (project variables) in this issue and move all the discussion regarding concatenation to #394

Glad you like the logo 😄

@angrykoala
Copy link
Owner

angrykoala commented Jan 13, 2021

Regarding common variables:

As you mentioned the env variables seem to be the best approach to solve this (I assume this would solve your problem).

At some point I though on adding suite-wide env variables, that would apply to a suite. The main block for implementing this is the UI. Currently, there are no suite-specific settings menu and we would need some place to add these new env variables.

I can only thing on adding a new option the the context menu that opens a new view (similar to the global settings) which allows you to configure suite env variables.

Once this is solved, it should be pretty easy to add those env variable to each task on execution.

As this feature seems like a reasonable addition, I will try to come to implement this when I can, feel free to poke around if you have an idea on how to implement this

@angrykoala angrykoala changed the title [Feature Request] Projects variables & Tasks concatenation Projects variables Jan 13, 2021
@angrykoala angrykoala changed the title Projects variables Suite env variables Jan 13, 2021
@VictorGrycuk
Copy link
Author

Thanks @angrykoala. From a practical point of view, env variables works just fine.

One possible workaround at the moment would be to create a task that simply setup env variables with its values, and call those variables from the other tasks, something like setx FOO "foo value".

So, I guess there is no rush to implement this at the moment. But I will be playing around with it for sure.

@angrykoala
Copy link
Owner

Hi @VictorGrycuk
Glad to know you have a workaround for that. I'll keep an eye for this to try and get this in the next release

@angrykoala angrykoala added this to the 1.0 milestone Jan 15, 2021
@angrykoala
Copy link
Owner

Hi @VictorGrycuk I've been tinkering a bit with this.

Would global env variables (configured through the settings menu) work for you?. These variables would apply to every task in Gaucho

As I said the main issue with adding per-suite env variables is finding out where in the UI can this option be added without generating confusion, this is a no-brainer if these are, at a global level, in the existing settings menu.

I wouldn't discard the idea of adding per-suite variables in the future, but if global variables are enough for you, that would be implemented fairly quickly and ready for the next release

angrykoala pushed a commit that referenced this issue Jan 16, 2021
@angrykoala
Copy link
Owner

This is the updated behavior for env variables for next gaucho release:

  • A new global variables section exists in settings
    Screenshot from 2021-01-16 12-54-33

    • These variables are applied to all tasks
    • These variables are exported and imported along with the suites with the options to "Export Tasks"
  • The Task-env variables section remains as it is:
    Screenshot from 2021-01-16 12-54-45

    • In case of key collision (i.e. same env variable set in tasks and global) the task variable will override the global one
  • For consistency, duplicate keys are not allowed anymore both in tasks and globally

@VictorGrycuk
Copy link
Author

@angrykoala Sorry for the late response.

This is the updated behavior for env variables for next gaucho release:

  • A new global variables section exists in settings

    • These variables are applied to all tasks
    • These variables are exported and imported along with the suites with the options to "Export Tasks"
  • The Task-env variables section remains as it is:

    • In case of key collision (i.e. same env variable set in tasks and global) the task variable will override the global one
  • For consistency, duplicate keys are not allowed anymore both in tasks and globally

I just gave it a try, and it works as expected.
That looks great! I really appreciate you working on this 🙂.

I will close the issue as this resolves my initial request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants