Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

feat: one sdk log env #361

Merged
merged 4 commits into from
Aug 21, 2023
Merged

feat: one sdk log env #361

merged 4 commits into from
Aug 21, 2023

Conversation

Jakub-Vacek
Copy link
Member

Description

Adds ONESDK_LOG= env variable to generated .env file with default value "off"
#355

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have updated the documentation accordingly. For updating Oclif commands documentation use oclif-dev.
  • I have read the CONTRIBUTING document.
  • I haven't repeated the code. (DRY)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Contributor

@julpat julpat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review done.

So it's the "OR" variant, just to extended the .env template.
The option to promote this debugging flag should goes to OneSDK, right? The CLI execute command does not care.

}): NewDotenv {
const previousContent = previousDotenv ?? '';

const parameterEnvs = getParameterEnvs(providerName, parameters);
const securityEnvs = getSecurityEnvs(providerName, security);
const tokenEnv = makeTokenEnv(token);
const logEnv = makeLogEnv(logEnabled === true ? '"on"' : '"off"');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The motivation to change the default value is that user could have it already set up (e.g. using export in the terminal)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't see the point for this condition right now if the goal was to promote the env :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just in case we might change the value. If you think that it is not needed I will remove it :)

}: {
previousDotenv?: string;
providerName: string;
parameters?: IntegrationParameter[];
security?: SecurityScheme[];
token?: string | null;
logEnabled?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not passing this new argument. So it's only for potential use in the future?

Copy link
Member

@kysely kysely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, left minor nitpick suggestions :)

src/logic/application-code/dotenv/dotenv.ts Outdated Show resolved Hide resolved
src/logic/application-code/dotenv/onesdk-log.ts Outdated Show resolved Hide resolved
}): NewDotenv {
const previousContent = previousDotenv ?? '';

const parameterEnvs = getParameterEnvs(providerName, parameters);
const securityEnvs = getSecurityEnvs(providerName, security);
const tokenEnv = makeTokenEnv(token);
const logEnv = makeLogEnv(logEnabled === true ? '"on"' : '"off"');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't see the point for this condition right now if the goal was to promote the env :)

Copy link
Member

@kysely kysely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Jakub-Vacek Jakub-Vacek merged commit 3ff6452 into main Aug 21, 2023
3 checks passed
@Jakub-Vacek Jakub-Vacek deleted the feat/sdk-log-env branch August 21, 2023 13:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants