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

refactor: enable active global environment and map it to the sdk #7533

Merged
merged 12 commits into from
Jun 26, 2024

Conversation

ihexxa
Copy link
Contributor

@ihexxa ihexxa commented Jun 12, 2024

Background

This changes hooks the active global environment to the script runtime, and enable them in scripting.
Ref: INS-3988
Tests are failing because it requires #7511

Changes

  • refactor: enable active global environment and map it to the sdk
  • send global env to the script runtime
  • persist global env
  • test it

@ihexxa ihexxa self-assigned this Jun 12, 2024
@ihexxa ihexxa marked this pull request as draft June 12, 2024 06:22
@subnetmarco subnetmarco requested a review from jackkav June 20, 2024 11:36
@ihexxa ihexxa marked this pull request as ready for review June 20, 2024 11:57
@jackkav
Copy link
Contributor

jackkav commented Jun 25, 2024

insomnia.globals.set('junk','00')
// insomnia.environment.set('junk','00')


console.log('g'+insomnia.globals.get('junk'))
console.log('e'+insomnia.environment.get('junk'))
console.log('cv'+insomnia.collectionVariables.get('junk'));
console.log('v'+insomnia.variables.get('junk'));

insomnia.globals.set('junk','000')
insomnia.collectionVariables.set('junk','44')
insomnia.environment.set('junk','what?')
// inconsistency
// currently updating selected (exclusive of globals) (inclusive of base env(collectionVariables))
// pm.env = selected env (exclusive of base env)

console.log('g'+insomnia.globals.get('junk'))
console.log('e'+insomnia.environment.get('junk'))
console.log('cv'+insomnia.collectionVariables.get('junk'));
console.log('v'+insomnia.variables.get('junk'));

@ihexxa ihexxa enabled auto-merge (squash) June 26, 2024 08:40
@ihexxa ihexxa merged commit e410998 into develop Jun 26, 2024
7 checks passed
@ihexxa ihexxa deleted the feat-script-global branch June 26, 2024 08:41
stefancruz pushed a commit to stefancruz/insomnia that referenced this pull request Jun 30, 2024
…g#7533)

* feat: refactor the environment mapping between inso and script sdk

* feat: enable global environment in the sdk

* fix: disable global cases

* refactor: pass select global env to script execution and persist it after execution

* fix: lint error

* fix: some minor fixes

* fix: undefined is persisted as globals

* chore: add some comments about the mapping rule

* refactor: enable menu items for global environment manipulation (Kong#7589)
ihexxa added a commit that referenced this pull request Jul 3, 2024
* feat: refactor the environment mapping between inso and script sdk

* feat: enable global environment in the sdk

* fix: disable global cases

* refactor: pass select global env to script execution and persist it after execution

* fix: lint error

* fix: some minor fixes

* fix: undefined is persisted as globals

* chore: add some comments about the mapping rule

* refactor: enable menu items for global environment manipulation (#7589)
CurryYangxx pushed a commit that referenced this pull request Jul 5, 2024
* feat: refactor the environment mapping between inso and script sdk

* feat: enable global environment in the sdk

* fix: disable global cases

* refactor: pass select global env to script execution and persist it after execution

* fix: lint error

* fix: some minor fixes

* fix: undefined is persisted as globals

* chore: add some comments about the mapping rule

* refactor: enable menu items for global environment manipulation (#7589)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants