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

Refactor stackstorm.js a bit #177

Merged
merged 19 commits into from
Jun 29, 2019
Merged

Refactor stackstorm.js a bit #177

merged 19 commits into from
Jun 29, 2019

Conversation

blag
Copy link
Contributor

@blag blag commented Jun 20, 2019

This PR is composed of cherry-picks from #168 and a tiny bit more refactoring as well. This PR will be considered a draft PR until StackStorm/st2chatops#124 is fixed, and will then and only then be promoted to being a full PR. I will continuously rebase this branch on top of master until StackStorm/st2chatops#124 is fixed, so clone this branch AT YOUR OWN RISK.

This PR should not change the behavior of scripts/stackstorm.js in any way, except for the SIGUSR2 handler now emits a log message to the debug log.

Tests for some environment variable settings, and for the SIGUSR2 handler are included. These tests should be orthogonal to the tests from #168 and/or #172.

A note about testing: when (and ONLY when) the test assertions fail, the tests simply hang until they are interrupted with a SIGINT (ctrl+c). Unfortunately, as far as I have learned Javascript, this is unavoidable until some of the behavioral refactoring from #168 is implemented (namely: that st2stream is properly closed, and hubot is properly shutdown, see the function stop in #168 for a working example). Due to the fact fixing that requires behavioral changes in scripts/stackstorm.js and this PR deliberately avoids changing the behavioral of stackstorm.js (except the one place as noted above), this is considered outside the scope of this PR. When the tests are successful, the tests exit as per normal operation.

@blag blag force-pushed the refactor-stackstorm.js branch 2 times, most recently from c5cc4bb to da4dedb Compare June 21, 2019 18:22
@blag blag force-pushed the refactor-stackstorm.js branch 2 times, most recently from 7d6166f to e192b94 Compare June 29, 2019 00:58
@blag blag marked this pull request as ready for review June 29, 2019 01:18
@blag blag requested review from arm4b and jinpingh June 29, 2019 01:18
@blag blag changed the title [DRAFT: DO NOT CLONE] Refactor stackstorm.js a bit Refactor stackstorm.js a bit Jun 29, 2019
Copy link
Member

@arm4b arm4b 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 👍

Please add a Changelog, refactoring + more tests is important maintenance work that worth mentioning there.

@blag blag force-pushed the refactor-stackstorm.js branch from a18a019 to cddd43a Compare June 29, 2019 18:04
@blag blag merged commit a124052 into master Jun 29, 2019
@blag blag deleted the refactor-stackstorm.js branch June 29, 2019 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants