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

fix: small runtime tweaks #3519

Merged
merged 3 commits into from
Apr 5, 2021
Merged

fix: small runtime tweaks #3519

merged 3 commits into from
Apr 5, 2021

Conversation

joshgummersall
Copy link
Contributor

@joshgummersall joshgummersall commented Apr 2, 2021

Fixes #3520

Josh Gummersall added 2 commits April 2, 2021 14:35
Can't log after response is written for some reason.
@coveralls
Copy link

coveralls commented Apr 2, 2021

Pull Request Test Coverage Report for Build 712999684

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.6%) to 84.917%

Totals Coverage Status
Change from base Build 712241731: 0.6%
Covered Lines: 18962
Relevant Lines: 21267

💛 - Coveralls

Copy link
Member

@stevengum stevengum 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! Just one bit of feedback around filename handling.

Comment on lines +419 to +421
if (nodeEnv) {
files.unshift(`appsettings.${nodeEnv}.json`);
}
Copy link
Member

@stevengum stevengum Apr 3, 2021

Choose a reason for hiding this comment

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

Somehow my comment was lost... The norm in .NET is to use appsettings.Development.json which means the JS SDK should standardize on an expected casing pattern... Or maybe do extra steps when looking for the appsettings.${nodeEnv}.json.

If the SDK standardizes on one casing pattern, it could capitalize the value of NODE_ENV as its value is normally lowercased, e.g. production and development.

Do the generators create the same filenames (appsettings.json and appsettings.Development.json) for both .NET and JS/TS bots?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Generators don't create environment-specific settings files, at least not at the moment. To me, using process.env.NODE_ENV directly is a more predictable behavior from the JS perspective. Once someone generates a project, the selected language is fixed. In this case, I think it's better to be consistent with JS expectations rather than trying to force .NET patterns. Doing zero transformations to the NODE_ENV environment variable gives users the most flexibility, and they don't have to try to understand a potentially fluid set of rules.

Copy link
Member

Choose a reason for hiding this comment

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

That works for me! I asked because it's important to have these discussions to make sure we as a team move in the right direction for our customers.

Copy link
Member

@stevengum stevengum left a comment

Choose a reason for hiding this comment

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

:shipit:

@stevengum stevengum merged commit 33da3ec into main Apr 5, 2021
@stevengum stevengum deleted the jpg/runtime-fixes branch April 5, 2021 17:51
joshgummersall added a commit that referenced this pull request Apr 5, 2021
* fix: azure logs issues

Can't log after response is written for some reason.

* fix: watch files in dev only

* fix: load appsettings files based on NODE_ENV

Roughly maps to behavior added via microsoft/botbuilder-dotnet#5421
stevengum pushed a commit that referenced this pull request Apr 5, 2021
* fix: azure logs issues

Can't log after response is written for some reason.

* fix: watch files in dev only

* fix: load appsettings files based on NODE_ENV

Roughly maps to behavior added via microsoft/botbuilder-dotnet#5421
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.

More runtime tweaks
3 participants