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

👻 Default to production for NODE_ENV #1502

Merged
merged 1 commit into from
Nov 1, 2023

Conversation

ibolton336
Copy link
Member

Copy link

codecov bot commented Nov 1, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (d3eb379) 40.16% compared to head (2ce4d7d) 40.60%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1502      +/-   ##
==========================================
+ Coverage   40.16%   40.60%   +0.43%     
==========================================
  Files         144      145       +1     
  Lines        4551     4586      +35     
  Branches     1096     1106      +10     
==========================================
+ Hits         1828     1862      +34     
- Misses       2626     2627       +1     
  Partials       97       97              
Flag Coverage Δ
client 40.60% <97.14%> (+0.43%) ⬆️
server ∅ <ø> (∅)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
client/src/app/env.ts 100.00% <100.00%> (ø)
client/src/mocks/config.ts 97.05% <97.05%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: ibolton336 <ibolton@redhat.com>
Copy link
Member

@sjd78 sjd78 left a comment

Choose a reason for hiding this comment

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

Yeah, the destructuring in buildKonveyorEnv to convert process.env to the internal ENV was filtering out optional values that I hadn't included.

@ibolton336 ibolton336 merged commit 2f8d58f into konveyor:main Nov 1, 2023
6 checks passed
@ibolton336
Copy link
Member Author

Yeah, the destructuring in buildKonveyorEnv to convert process.env to the internal ENV was filtering out optional values that I hadn't included.

Didn't appear to impact the issue at hand, but is nice to have the defaults explicitly included to enhance the dev experience. Seems that the result of buildKonveyorEnv includes all of the env vars available from process.env at runtime even if the type definition constrains the expected properties. TypeScript type checking occurs at compile-time, and it doesn't prevent you from accessing properties not explicitly defined in the type.

If we wanted to ensure that only the expected properties are included and to have stricter type checking, we could explicitly specify the properties we want from process.env

const konveyorEnv = buildKonveyorEnv({
  NODE_ENV: process.env.NODE_ENV,
  VERSION: process.env.VERSION,
  MOCK: process.env.MOCK,
  AUTH_REQUIRED: process.env.AUTH_REQUIRED,
  KEYCLOAK_REALM: process.env.KEYCLOAK_REALM,
  KEYCLOAK_CLIENT_ID: process.env.KEYCLOAK_CLIENT_ID,
  PROFILE: process.env.PROFILE,
  UI_INGRESS_PROXY_BODY_SIZE: process.env.UI_INGRESS_PROXY_BODY_SIZE,
  RWX_SUPPORTED: process.env.RWX_SUPPORTED,
});

sjd78 added a commit to sjd78/tackle2-ui that referenced this pull request Nov 1, 2023
Being explicit about what the `NODE_ENV` value should be for each
npm script where the value could impact the results can help remove
any errors in future.  Motivated by working on konveyor#1502.

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
sjd78 added a commit that referenced this pull request Nov 1, 2023
Being explicit about what the `NODE_ENV` value should be for each npm
script where the value could impact the results can help remove any
errors in future. Motivated by working on #1502.

Signed-off-by: Scott J Dickerson <sdickers@redhat.com>
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.

2 participants