Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use an --env-config flag instead of --config=ENV to tell the tap to parse environment variables #199

Open
MeltyBot opened this issue Aug 24, 2021 · 6 comments

Comments

@MeltyBot
Copy link
Contributor

Migrated from GitLab: https://gitlab.com/meltano/sdk/-/issues/200

Originally created by @edgarrmondragon on 2021-08-24 19:04:04


Summary

Currently, the way to tell a tap-based SDK to parse environment variables for settings is to pass a --config=ENV option to the tap invocation

my-tap --config=firstConfig.json --config=ENV -config=secondConfig.json

I suggest supporting a boolean --env-config instead.

Proposed benefits

Be more explicit about environment parsing option for settings and don't rely on the hardcoded ENV string.

Also, the position of --config=ENV in the multi-value sequence is not important, so in practice it acts only as a flag. It'd be good to make that understanding more explicit.

Proposal details

Add a new --env-config option to the tap CLI decorators:

click.option(
    "--env-config",
    is_flag=True,
    help="Use environment variables for configuration.",
)

The corresponding env_config boolean variable in the function would then be passed directly to the Tap constructor's parse_env_config argument.

Best reasons not to build

--env-config is not standard for Singer taps, so this would act as an extension to the common CLI options.

cc @aaronsteers

@MeltyBot
Copy link
Contributor Author

@labelsync-manager labelsync-manager bot added the kind/Feature New feature or request label Jun 23, 2022
@stale

This comment was marked as off-topic.

@stale stale bot added the stale label Jul 18, 2023
@edgarrmondragon

This comment was marked as off-topic.

@stale stale bot removed the stale label Jul 18, 2023

This comment was marked as off-topic.

@stale stale bot added the stale label Jul 18, 2024
@edgarrmondragon

This comment was marked as off-topic.

@edgarrmondragon
Copy link
Collaborator

Added this to the Office Hours board. I'm interested in polling folks:

  1. Do they ever use multiple --config inputs?
  2. Do they frequently use --config=ENV?
  3. Would a flag like --read-env be useful (this issue)?
  4. Would short flags be (e.g. -d for --discover) be appreciated?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
Status: Discussed
Development

No branches or pull requests

3 participants