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

Changing environments modifies thunderEnvironment.db #448

Closed
bdharrington7 opened this issue Jan 22, 2022 · 11 comments
Closed

Changing environments modifies thunderEnvironment.db #448

bdharrington7 opened this issue Jan 22, 2022 · 11 comments
Labels
feature request New feature or request Priority Implement this asap

Comments

@bdharrington7
Copy link

First, thank you for making this extension. As a long time Postman user like yourself, I found the team sharing feature in Postman to be a non-starter and too far removed from the application code.

As a user that is using the teams feature and saving the thunderEnvironment.db file to source control, switching environments causes a confusing change where the default key in the environment object is set to true and the timestamp is updated. In the UI, the context menu has an option for 'Set active' on the unstarred environment, which seems like it shouldn't update which environment is default. Switching back still leaves a pending change in version control since the timestamp is updated.

Describe the solution you'd like
Having a default option setting for an environment is a good thing (I think a new developer opening the project should default to using the dev environment, not what the last developer was using). Switching shouldn't update the database though. During a testing session, I may want to switch to a QA or prod environment, but I'd never want to set QA or prod as the "default".

Describe alternatives you've considered
I thought about removing the thunderEnvironment.db file from source control, but that removes my ability to transfer common environment variables to the team, which are used in the collections.

Implementation:
N/A: Library isn't open source.

@bdharrington7 bdharrington7 added the feature request New feature or request label Jan 22, 2022
@rangav
Copy link
Collaborator

rangav commented Jan 22, 2022

Hi @bdharrington7

Thanks for feedback, I will remove modifying the date when Set Active is selected, so switching env will not change git.

In terms of default Environment, I think its better to leave it to developer or user to decide which Env is default, rather than extension to decide.

also names of environments can be named differently by different users.

We also have Local Environment feature, which will exclude secrets from source control.

@rangav rangav added the Priority Implement this asap label Jan 22, 2022
@bdharrington7
Copy link
Author

its better to leave it developer or user to decide which Env is default, rather than extension to decide.

I completely agree! But my only issue with that is that the menu option to change the default is named “Set Active”. Could it be renamed to “Set as default” or something, and then have another option that switches the environment, but saves that state in memory instead of changing the database?

@rangav
Copy link
Collaborator

rangav commented Jan 22, 2022

In the first version we had Set Default as the name, lot of people said it’s confusing and requested to change name to Set Active, so we changed it.

Once you use it couple of times, you will get used to the name.

In-Memory change:
Will think of this request and research if there is better way

If possible can you let me know many your team members using this extension?

@bdharrington7
Copy link
Author

6+, and many team members have multiple machines so that could work out to at least double

@rangav
Copy link
Collaborator

rangav commented Jan 26, 2022

This feature is now implemented in v1.11.0, it will not modify the date when you change Env
https://github.com/rangav/thunder-client-support/releases/tag/v1.11.0

please let me know if any feedback

@rangav rangav closed this as completed Jan 26, 2022
@bdharrington7
Copy link
Author

Working beautifully, thanks!

@rangav
Copy link
Collaborator

rangav commented Jan 26, 2022

Thanks @bdharrington7 for confirmation 👍

@mattiasd
Copy link

First, love the extension, thank you!

Seems related so continuing here. Set Active is still changing thunderEnvironment.db by setting default. Is that by design? I switch environment often and I don't want to remember to reset active environment before committing.

@rangav
Copy link
Collaborator

rangav commented Mar 30, 2022

Hi @mattiasd, Glad you like it.

Yes its by design, when you change the active env it will update the file.

But if you change the active env back to original, then no changes will be seen in thunderEnvironment.db file.

@rangav
Copy link
Collaborator

rangav commented Feb 17, 2023

Hi All, Update on changing env.

Now you can use CLI to run collection or request with different env, this wont change the current active env.

Install:

  • npm i -g @thunderclient/cli

Examples

  • tc 'requestNameOrId' --env 'Staging' to run request using staging environment
  • tc --col 'colNameOrId' --env 'Staging' to run collection using staging environment

Documentation:

Please let me know your feedback

@rangav
Copy link
Collaborator

rangav commented Feb 26, 2024

This feature is implemented and published to the marketplace, please update to v2.18.0

See all features in this update
https://github.com/rangav/thunder-client-support/releases/tag/v2.18.0

Please test and let me know your feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request Priority Implement this asap
Projects
None yet
Development

No branches or pull requests

3 participants