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

feat: add HOST/--host option #1335

Merged
merged 6 commits into from
Sep 18, 2020
Merged

feat: add HOST/--host option #1335

merged 6 commits into from
Sep 18, 2020

Conversation

shaftoe
Copy link
Contributor

@shaftoe shaftoe commented Sep 4, 2020

Tentative implementation of --bind-address option to bind Probot to a specific IP address and to http://localhost:3000/ by default.

Suggested by @gr2m in this other issue: #1329 (comment)

Comments inline the patch about doubts and/or implementation details.

Test still missing, will work on that asap


View rendered docs/configuration.md

@shaftoe shaftoe requested a review from a team as a code owner September 4, 2020 16:38
docs/configuration.md Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@shaftoe shaftoe force-pushed the add-bind-address branch 4 times, most recently from a4866cd to 6e6a410 Compare September 6, 2020 05:54
@shaftoe
Copy link
Contributor Author

shaftoe commented Sep 6, 2020

Speaking of (broken) tests, I'm trying to fix them.

I've also been thinking about how to test this new feature and I don't believe adding an integration test to actually check network interface setup is what we want: ensuring that the expected values are passed down to Node net module should ensure the behavior is correct and prevent regressions. What do you think?

@gr2m
Copy link
Contributor

gr2m commented Sep 6, 2020

down to Node net module

testing that the server.listen function is called correctly is good enough, we don't need to test internal behavior from Express

@shaftoe
Copy link
Contributor Author

shaftoe commented Sep 8, 2020

It turns out fixing the tests is probably 10x the effort of implementing the feature... it might take some time

@FoseFx
Copy link
Contributor

FoseFx commented Sep 14, 2020

Other than the IPv6 issue I referenced in my PR I'd like to propose to rename the config variables from BIND_ADDRESS and --bind-address to HOST and --host. This way it would be in line with node's documentation's lingo and potentialy easier to find in the docs by a user using CTRL + F.

@shaftoe
Copy link
Contributor Author

shaftoe commented Sep 15, 2020

Other than the IPv6 issue I referenced in my PR I'd like to propose to rename the config variables from BIND_ADDRESS and --bind-address to HOST and --host. This way it would be in line with node's documentation's lingo and potentialy easier to find in the docs by a user using CTRL + F.

I also prefer --host, it's the most common name for that option for CLIs afaik.

@gr2m what do you say?

shaftoe and others added 2 commits September 15, 2020 08:56
I have not added any new tests, I just fixed the old ones.
During this process I noticed, that for some reason the listen()
behavior changes when 0.0.0.0 (the previous default value) was used.
I still dont know why this happens, but found another issue with
the default value: Missing Ipv6 support.
I removed the state properties and listen() is now not called with a second
argument when bindAddress is undefined.
@gr2m
Copy link
Contributor

gr2m commented Sep 16, 2020

Great points, thank you! Let's use HOST and --host

Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

looks mostly good, just a few nits

src/application.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
@gr2m gr2m changed the title feat: add BIND_ADDRESS to options feat: add HOST/--host option Sep 17, 2020
Copy link
Contributor

@gr2m gr2m left a comment

Choose a reason for hiding this comment

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

This looks great to me, thank you @shaftoe 💐 Are you on your side?

@shaftoe
Copy link
Contributor Author

shaftoe commented Sep 17, 2020

This looks great to me, thank you @shaftoe 💐

Don't forget to thank @FoseFx , I was almost giving up trying to fix the tests and he/she did the trick.

Are you on your side?

Sorry, not a native English speaker, not sure what you mean by that 😅

@gr2m
Copy link
Contributor

gr2m commented Sep 17, 2020

I meant to say "Are you ready on your side?", sorry for the typo.

Englisch ist auch nicht meine erste Sprache, kann die Missverständnisse gut nachvollziehen ;)

@shaftoe
Copy link
Contributor Author

shaftoe commented Sep 18, 2020

I meant to say "Are you ready on your side?", sorry for the typo.

Yes, definitely, please go ahead

Englisch ist auch nicht meine erste Sprache, kann die Missverständnisse gut nachvollziehen ;)

Alles klar! Aber Italienisch ist meine Muttersprache ;)

@gr2m gr2m merged commit ed7a513 into probot:master Sep 18, 2020
@github-actions
Copy link

🎉 This PR is included in version 10.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

None yet

3 participants