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: Avoid false-negative checks for port #5565

Merged

Conversation

loklaan
Copy link
Member

@loklaan loklaan commented Feb 13, 2019

Issue:

When a port is provided via env vars, we're usually told by the CLI that it's unavailable, only to be suggested the same port next.

The usage of these SBCONFIG_CONFIG_<NAME> env vars is only intended for internals, as far as I'm aware. Nevertheless, when using the SBCONFIG_CONFIG_PORT we're left with an unexpected behaviour.

What I did

Make sure the SBCONFIG_CONFIG_PORT is cast to a number, so as not to trip on any explicit (===) equality tests further down the code.

How to test

  • Is this testable with Jest or Chromatic screenshots?
    Not sure, I haven't looked at the test suit in the repo sorry :(
  • Does this need a new example in the kitchen sink apps?
    No, as it resembles expected behaviour and was rarely encountered.
  • Does this need an update to the documentation?
    No, as it resembles expected behaviour and was rarely encountered.

When a port is provided via env vars, we're usually told
by the CLI that it's unavailable, only to be suggested the
same port next.
@codecov
Copy link

codecov bot commented Feb 14, 2019

Codecov Report

Merging #5565 into next will increase coverage by 0.09%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##             next    #5565      +/-   ##
==========================================
+ Coverage   33.21%   33.31%   +0.09%     
==========================================
  Files         647      647              
  Lines        9314     9320       +6     
  Branches     1325     1329       +4     
==========================================
+ Hits         3094     3105      +11     
+ Misses       5605     5599       -6     
- Partials      615      616       +1
Impacted Files Coverage Δ
lib/core/src/server/cli/dev.js 0% <0%> (ø) ⬆️
addons/knobs/src/components/types/Radio.js 86.36% <0%> (-3.12%) ⬇️
addons/knobs/src/components/types/Checkboxes.js 90.32% <0%> (-2.54%) ⬇️
lib/ui/src/components/sidebar/SidebarItem.js 95.83% <0%> (-0.17%) ⬇️
.../components/src/placeholder/placeholder.stories.js 100% <0%> (ø) ⬆️
lib/components/src/tooltip/Tooltip.js 100% <0%> (ø) ⬆️
lib/theming/src/themes/dark.ts 0% <0%> (ø) ⬆️
lib/ui/src/components/sidebar/NotificationItem.js 100% <0%> (ø) ⬆️
lib/components/src/form/input/input.js 100% <0%> (ø) ⬆️
lib/components/src/Badge/Badge.js 100% <0%> (ø) ⬆️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db6ed03...ec1f75e. Read the comment docs.

Copy link
Member

@ndelangen ndelangen left a comment

Choose a reason for hiding this comment

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

You find the weirdest bugs 🎖

@ndelangen ndelangen self-assigned this Feb 14, 2019
@ndelangen ndelangen merged commit fedcff8 into storybookjs:next Feb 14, 2019
@loklaan
Copy link
Member Author

loklaan commented Feb 15, 2019

Aw thanks @ndelangen! That's legitimately such a nice thing to say. 🎉 Adding it to my bio everywhere haha

@shilman shilman added release patch:done Patch/release PRs already cherry-picked to main/release branch labels Feb 15, 2019
shilman pushed a commit that referenced this pull request Feb 15, 2019
…gative

Fix: Avoid false-negative checks for port
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core patch:done Patch/release PRs already cherry-picked to main/release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants