From 6ab3a897c7794ead6925091e0e03b85e2020cda5 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Fri, 29 Sep 2017 17:05:40 -0700 Subject: [PATCH 01/12] Typographic corrections and clarifications --- README.md | 56 +++++++++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index d123205a..39628048 100644 --- a/README.md +++ b/README.md @@ -16,37 +16,30 @@ Before you can run echo you need: ### SETTING UP THE ECHO SERVICE -##### 1. **Globally** install [nvm][nvm], [avn][avn], and [avn-nvm][avn-nvm]. +##### 1. When you installed IDM (or earlier), you globally installed [nvm][nvm], [avn][avn], [avn-nvm][avn-nvm], [mehserve][mehserve], and [RethinkDB][rethinkdb], and created a free AWS account. -```bash -curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash -npm install -g avn avn-nvm -avn setup -``` +The echo service, too, depends on them. -##### 2. Fork and clone the repository. +##### 2. Fork and clone this (echo) repository. -##### 3. Setup and run [mehserve][mehserve]. +##### 3. Run [mehserve][mehserve]. Figure out which port you intend to use and create the mehserve config file: + ```bash echo 9005 > ~/.mehserve/echo.learnersguild +mehserve run ``` -##### 4. Set your `NODE_ENV` environment variable: +##### 4. Set your `NODE_ENV` environment variable. Warning: This setting is not persistent. If you open another terminal window for any subsequent commands, repeat this command there before entering other commands. ```bash export NODE_ENV=development ``` -##### 5. [Install RethinkDB][install-rethinkdb]. - -##### 6. Create a free AWS account: -[https://aws.amazon.com](https://aws.amazon.com/) +##### 5. Find your AWS access key ID and secret access key in the `.env.development` file in your IDM development project directory. You'll need to include these in your environment variables in the next step. -Make a copy of your access key ID and secret access key. You'll need to include these in your environment variables in the next step. - -##### 7. Create your `.env.development` file for your environment. +##### 6. Create the `.env.development` file for your environment. Take out all comments in your final version. Example: ``` @@ -56,15 +49,15 @@ REDIS_URL=redis://localhost:6379 RETHINKDB_URL=rethinkdb://localhost:28015/echo_development # IDM / JWT settings, including session extension IDM_BASE_URL=http://idm.learnersguild.dev -JWT_PRIVATE_KEY="" -JWT_PUBLIC_KEY="" +JWT_PRIVATE_KEY="" +JWT_PUBLIC_KEY="" # External API settings GITHUB_ORG_ADMIN_TOKEN="" GITHUB_CRAFTS_REPO="https://github.com/GuildCraftsTesting/web-development-js-testing" S3_BUCKET=guild-development S3_KEY_PREFIX=db -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= ``` ##### 8. Install dependencies: @@ -73,7 +66,7 @@ AWS_SECRET_ACCESS_KEY= npm install ``` -##### 9. Create a development & test databases: +##### 9. Create development & test databases: ```bash npm run db:create @@ -85,20 +78,20 @@ npm run db:migrate:up NODE_ENV=test npm run db:migrate:up ``` -Optionally, seed your development database with test member and project data: -```bash -npm run db:copy -- -``` +Optionally, seed your development database with test member and project data. In the command below, replace `` with any of these: -Available `STATE` options: - `GOAL_SELECTION` (default) - `GOAL_SELECTION_VOTES` - `PRACTICE` - `REFLECTION` +```bash +npm run db:copy -- +``` + ### RUNNING THE SERVER -**NOTE:** you'll need [mehserve][mehserve], [idm][idm] and this server all running at the same time for things to work. +**NOTE:** You'll need [mehserve][mehserve], [idm][idm] and this server all running at the same time for things to work. ```bash npm start @@ -126,14 +119,14 @@ Add the following to your `.env.development`: ``` # Slack / command CLI settings CHAT_BASE_URL=https://slack.com -CHAT_API_TOKEN= +CHAT_API_TOKEN= ``` ##### 3. Configure your dev environment for INBOUND calls _from_ Slack (for /slash commands). Add the following to your `.env.development`: ``` -CLI_COMMAND_TOKEN= +CLI_COMMAND_TOKEN= ``` ##### 4. Set up localtunnel and run the `slackslash` script: @@ -143,10 +136,11 @@ npm install -g localtunnel npm run slackslash ``` -**NOTE:** You can ignore this message after starting localtunnel: +**NOTE:** You should see the following message after starting localtunnel: ``` your url is: https://slackslash.localtunnel.me ``` + It's not a URL you're meant to visit in the browser directly; it is the URL already configured in the dev Slack team's echo app and where incoming requests for /slash commands are sent. With localtunnel running and configured properly (along with `echo`, `idm` and `mehserve`), when you issue a slash command in a channel in the dev Slack team, the request will be sent to https://slackslash.localtunnel.me and served by the echo service running on your local machine. ## CONTINUOUS INTEGRATION @@ -166,7 +160,7 @@ See the [LICENSE](./LICENSE) file. [idm]: https://github.com/LearnersGuild/idm [github-register-application]: https://github.com/settings/applications/new -[install-rethinkdb]: https://www.rethinkdb.com/docs/install/ +[rethinkdb]: https://www.rethinkdb.com/docs [mehserve]: https://github.com/timecounts/mehserve [nvm]: https://github.com/creationix/nvm [avn]: https://github.com/wbyoung/avn From 269d28e18616d174497432608efed23ea5fdc053 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Fri, 29 Sep 2017 17:11:00 -0700 Subject: [PATCH 02/12] Delete incompletely specified instruction 2 more advanced members of P4 say that this line is not needed. If it is needed, it needs a clear specification for the token that is to be used in place of the placeholder. For now, I am proposing its deletion. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 39628048..df6920ab 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,6 @@ IDM_BASE_URL=http://idm.learnersguild.dev JWT_PRIVATE_KEY="" JWT_PUBLIC_KEY="" # External API settings -GITHUB_ORG_ADMIN_TOKEN="" GITHUB_CRAFTS_REPO="https://github.com/GuildCraftsTesting/web-development-js-testing" S3_BUCKET=guild-development S3_KEY_PREFIX=db From 14d41e6c41f880d57659cdd58566e8a71c9ee3b8 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Fri, 29 Sep 2017 17:14:16 -0700 Subject: [PATCH 03/12] Reformulate for clarity --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index df6920ab..3ab53709 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,7 @@ The echo service, too, depends on them. ##### 2. Fork and clone this (echo) repository. -##### 3. Run [mehserve][mehserve]. - -Figure out which port you intend to use and create the mehserve config file: +##### 3. Figure out which port you intend to use for mehserve, then create the mehserve config file, and finally run [mehserve][mehserve]. ```bash echo 9005 > ~/.mehserve/echo.learnersguild From 09936d345d5cf1d6936422c4b5653445e0a62b83 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Mon, 2 Oct 2017 09:09:02 -0700 Subject: [PATCH 04/12] Deleted unnecessary qualifications --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ab53709..96587760 100644 --- a/README.md +++ b/README.md @@ -53,8 +53,8 @@ JWT_PUBLIC_KEY="" GITHUB_CRAFTS_REPO="https://github.com/GuildCraftsTesting/web-development-js-testing" S3_BUCKET=guild-development S3_KEY_PREFIX=db -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= ``` ##### 8. Install dependencies: From cca563d070683ec1ad1fe4ffba94bed1e84e0743 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Mon, 2 Oct 2017 14:28:25 -0700 Subject: [PATCH 05/12] Made instructions clearer. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 96587760..2ef3d180 100644 --- a/README.md +++ b/README.md @@ -94,13 +94,14 @@ npm run db:copy -- npm start ``` -Visit the server in your browser: +Visit the server in your browser and sign in with Github: ```bash open http://echo.learnersguild.dev ``` -Start the workers +You should then see a display of phases, with options to choose projects or users. In a new terminal tab (with NODE_ENV set to development as always), start the workers: + ```bash npm run workers npm run workers:cycleLaunched From 7c5cfc8a5adb9760fc6cbadca9411b774559d358 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Mon, 2 Oct 2017 15:34:05 -0700 Subject: [PATCH 06/12] Replaced buggy line 139 with workaround, per SJ Pratt instructions. --- src/common/containers/ProjectList/index.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/containers/ProjectList/index.jsx b/src/common/containers/ProjectList/index.jsx index 40c1d98f..c620c1e3 100644 --- a/src/common/containers/ProjectList/index.jsx +++ b/src/common/containers/ProjectList/index.jsx @@ -136,7 +136,8 @@ function mapStateToProps(state) { }) const oldestCycleNumber = projectList.length > 0 ? - projectList[projectList.length - 1].cycle.cycleNumber : null + (projectList[projectList.length - 1].cycle || {}).cycleNumber : null + // projectList[projectList.length - 1].cycle.cycleNumber : null return { isBusy: projects.isBusy || users.isBusy, From 0fa9c6bc5176927ef37d4b6929a8c37616797998 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Mon, 2 Oct 2017 16:07:27 -0700 Subject: [PATCH 07/12] Made NODE_ENV instruction consistent with and reliant on IDM. --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 2ef3d180..da6649af 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,7 @@ echo 9005 > ~/.mehserve/echo.learnersguild mehserve run ``` -##### 4. Set your `NODE_ENV` environment variable. Warning: This setting is not persistent. If you open another terminal window for any subsequent commands, repeat this command there before entering other commands. - -```bash -export NODE_ENV=development -``` +##### 4. As explained in the installation instructions for IDM, ensure that your `NODE_ENV` environment variable has the value `development`. ##### 5. Find your AWS access key ID and secret access key in the `.env.development` file in your IDM development project directory. You'll need to include these in your environment variables in the next step. From 1e17b0b366668004b486ad9f261c8b0e24aadca3 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Mon, 2 Oct 2017 16:27:33 -0700 Subject: [PATCH 08/12] Clarifications The need to still have RethinkDB running since the IDM installation, or to start it again, was not obvious. State instruction was ambiguous. --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index da6649af..23a5dbe8 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,20 @@ AWS_SECRET_ACCESS_KEY= npm install ``` -##### 9. Create development & test databases: +##### 9. Make sure that RethinkDB is still running: + +```bash +brew services list +``` + +If it is no longer running, run it: + +```bash +brew services run rethinkdb +``` + + +##### 10. Create development & test databases: ```bash npm run db:create @@ -71,7 +84,7 @@ npm run db:migrate:up NODE_ENV=test npm run db:migrate:up ``` -Optionally, seed your development database with test member and project data. In the command below, replace `` with any of these: +Optionally, seed your development database with test member and project data representing one of the possible states of the system. In the command below, replace `` with any one of these: - `GOAL_SELECTION` (default) - `GOAL_SELECTION_VOTES` From 2043319653457b1fc55a1fc2c9535e92b9604347 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Mon, 2 Oct 2017 16:40:05 -0700 Subject: [PATCH 09/12] Clarify service prerequisites. --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 23a5dbe8..b6b28e5b 100644 --- a/README.md +++ b/README.md @@ -97,7 +97,13 @@ npm run db:copy -- ### RUNNING THE SERVER -**NOTE:** You'll need [mehserve][mehserve], [idm][idm] and this server all running at the same time for things to work. +Make sure that the following services are **all** running: + +- mehserve(see above) +- RethinkDB (see above) +- [idm][idm] (in your `idm` directory, enter `npm start`) + +Then start the `echo` service: ```bash npm start From d06d4e24273d45e58cc42dd4ea4e88c3320ca7a4 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Mon, 2 Oct 2017 18:04:55 -0700 Subject: [PATCH 10/12] Amendments reflecting current chat-integration conditions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To avoid API errors in the execution of “npm run workers”, one would already need the 2 Slack-related entries in the .env.development file that were shown later on the page. This would require getting invited by a teammate to the Slack dev team. But current P4 members are not aware of such a team, are not members of it, and cannot give invitations. Therefore it is appropriate to warn about the error message and delete the entirety of the section on Slack integration. --- README.md | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/README.md b/README.md index b6b28e5b..3106bf55 100644 --- a/README.md +++ b/README.md @@ -122,39 +122,7 @@ npm run workers npm run workers:cycleLaunched ``` -### USING THE DEV SLACK INSTANCE WITH YOUR LOCAL ECHO SERVICE - -##### 1. Join the dev Slack team by requesting (and accepting) an invitation from a teammate. - -##### 2. Configure your dev environment for OUTBOUND calls _to_ the Slack API. - -Add the following to your `.env.development`: -``` -# Slack / command CLI settings -CHAT_BASE_URL=https://slack.com -CHAT_API_TOKEN= -``` - -##### 3. Configure your dev environment for INBOUND calls _from_ Slack (for /slash commands). - -Add the following to your `.env.development`: -``` -CLI_COMMAND_TOKEN= -``` - -##### 4. Set up localtunnel and run the `slackslash` script: - -```bash -npm install -g localtunnel -npm run slackslash -``` - -**NOTE:** You should see the following message after starting localtunnel: -``` -your url is: https://slackslash.localtunnel.me -``` - -It's not a URL you're meant to visit in the browser directly; it is the URL already configured in the dev Slack team's echo app and where incoming requests for /slash commands are sent. With localtunnel running and configured properly (along with `echo`, `idm` and `mehserve`), when you issue a slash command in a channel in the dev Slack team, the request will be sent to https://slackslash.localtunnel.me and served by the echo service running on your local machine. +You should expect to see an error message caused by your `.env.development` file not containing two required entries for CHAT_BASE_URL and CHAT_API_TOKEN. Your work will not be affected by this error, so you may disregard it. ## CONTINUOUS INTEGRATION From 2cefeec723c245e11b1d57aaf960baaf56941ef3 Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Mon, 2 Oct 2017 18:07:01 -0700 Subject: [PATCH 11/12] Clarified instructions for running workers. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3106bf55..a9aacd56 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Visit the server in your browser and sign in with Github: open http://echo.learnersguild.dev ``` -You should then see a display of phases, with options to choose projects or users. In a new terminal tab (with NODE_ENV set to development as always), start the workers: +You should then see a display of phases, with options to choose projects or users. In a new terminal tab (with NODE_ENV set to development as always), start the workers and leave them running. This requires two different terminal tabs, one for each. ```bash npm run workers From b0aae104b9297145e4c037dfd01b59dbd78a5d1a Mon Sep 17 00:00:00 2001 From: Jonathan Pool Date: Tue, 3 Oct 2017 15:30:59 -0700 Subject: [PATCH 12/12] =?UTF-8?q?Delete=20=E2=80=9Copen=E2=80=9D=20from=20?= =?UTF-8?q?command=20(i.e.=20URL)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a9aacd56..7def2892 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ npm start Visit the server in your browser and sign in with Github: ```bash -open http://echo.learnersguild.dev +http://echo.learnersguild.dev ``` You should then see a display of phases, with options to choose projects or users. In a new terminal tab (with NODE_ENV set to development as always), start the workers and leave them running. This requires two different terminal tabs, one for each.