temporalio/features

[Feature Request] Common external configuration of client connection options

cretz opened this issue · 3 comments

Describe the solution you'd like

Will add more as more is discussed. Notes:

  • Probably want to use same env vars as CLI
  • User has to opt-in to use, e.g. NewClientOptionsFromEnvironment() instead of just assuming when unset to pull from env
  • May want YAML config or similar
    • Discuss the tradeoffs of language-specific approaches vs dependency additions

EDIT: Initial proposal now available at temporalio/proposals#94

Ok, we're fairly sure we want to combine concepts here. Here are some requirements:

  • We want CLI to be able to use same environment variables and same config files as all SDKs
  • We want a single opt-in call to create connection options that use environment variables and config file (former overrides latter)
  • CLI can be used to mutate the config file

Today we already have temporal env, so we may be able to reuse that, but there are some problems:

  • This is YAML and adding YAML libraries to our SDKs has knock-on effects for users
    • AWS's SDKs use AWS configuration files which are INI based and therefore they have their own INI parsers
  • Environment variables don't have an "env" name, but "envs" do
  • The use of the term "env" for config file with "env name" and "setting name" instead of something like "config" and "profile" is confusing

These need to be solved.

Agree that it would be great to reuse the CLI env file and unify that experience.

This is YAML and adding YAML libraries to our SDKs has knock-on effects for users

Maybe we should just switch to JSON as we don't expect most users to be editing this file manually. That would remove the YAML lib dependency.

The use of the term "env" for config file with "env name" and "setting name" instead of something like "config" and "profile" is confusing

Agree, profile might be less confusing but I'm not sure we want to change the terminology for CLI users that already use the feature although now might be the perfect time to make this change since we're redesigning the env command API.

cretz commented

Initial proposal now available at temporalio/proposals#94