usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
27.62k stars 1.28k forks source link

Enabling multiple environments at the same time #3382

Closed g54799 closed 3 weeks ago

g54799 commented 3 weeks ago

I have checked the following:

Describe the feature you want to add

Please provide a way to combine multiple environment variables. I would like composition over inheritance but even inheritance like Postman and others do would be better than nothing. Here is why we need it. Suppose we have 3 environments and 2 services deployed in each environment. Today, being able select only one environment at a time we have to create 6 total variables just to define the url for that 2 service: service1-url=dev.service1, test.service1, preprod.service1 service2-url=dev.service2, test.service2, preprod.service2

If we could compose or inherit variables we could define these 2 variables in the shared environment: service1-url={{env-prefix}}.service1 service2-url={{env-prefix}}.service2

And then in each specific environment define only 1. e.g. in "dev" environment: env-prefix=dev

When the number of services increases the number of variables that needs to be replicated increases a lot.

Mockups or Images of the feature

I do not think a mockup is needed for this

g54799 commented 3 weeks ago

I noticed newly added global environment is actually activated together with the collection environment. So although I would like a dynamic collection composition options, this is sufficient.