-
Notifications
You must be signed in to change notification settings - Fork 103
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
setup.rst: Add docs to setup corobo #665
base: master
Are you sure you want to change the base?
Conversation
This illustrates the steps involved in setting up corobo in text mode and with gitter-backend. Closes coala#668
bf322a3
to
fae8cf5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not complete in any way as there are a lot more steps involved. Although, this is a small step in the right direction.
docs/setup.rst
Outdated
export BOT_PREFIX="any_name" | ||
export BACKEND="Text" | ||
export BOT_USERNAME="@any_other_name" | ||
(**Note:** The BOT_USERNAME always starts with a @ for a person and # for a room) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incomplete. And what is BOT_USERNAME
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was mentioned in the docs. Seems like it is not used now. Will get it removed.
Also, can u pls suggest the points that you mean to get added??
docs/setup.rst
Outdated
#. Clone the err-backend-gitter repository in your "corobo" folder. | ||
:: | ||
git clone https://github.com/errbotio/err-backend-gitter.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. We use a submodule pinned to a specific commit, so you should be using that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.. will get this done.
docs/setup.rst
Outdated
#. Configure the environment variables(for gitter-backend). | ||
:: | ||
export BACKEND="Gitter" | ||
export BOT_EXTRA_BACKEND_DIR="/path_to/err-backend-gitter" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not required since the path is fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will get this fixed.
docs/setup.rst
Outdated
./oauth.py | ||
This will guide you with the gitter token generation process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On running this file it guides us with the process generating the gitter bit token.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you link this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the file.. https://github.com/errbotio/err-backend-gitter/blob/14a428bdd0597b473605264c822855da979bd916/oauth.py
This point is also mentioned in the gitter backend documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very redundant, and you didn't tell them that this file belongs to the gitter backend directory. I don't think we need this as it is not even a part of corobo.
docs/setup.rst
Outdated
export ROOMS="rooms_to_join" | ||
export BOT_ADMINS="your_gitter_username" | ||
(**Note:** The admin user account should be different than the bot account.) | ||
#. Hurrah!!! the bot is now ready to be deployed. To run the corobo instance use: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deployed seems to be the wrong word here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will get this changed.
docs/setup.rst
Outdated
export GH_TOKEN="your_github_token" | ||
export GL_TOKEN="your_gitlab_token" | ||
export GH_ORG_NAME="your_github_organisation_name" | ||
export GL_ORG_NAME="your_gitlab_organisation_name" | ||
export ROOMS="rooms_to_join" | ||
export BOT_ADMINS="your_gitter_username" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These exports statements are coming too many times, instead have them bunched up in a single step.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, since I have divided the configuration in steps, the export statements have also been divided accordingly. I will get this done into two parts. One is for simple corobo configuration (with text backend) and other would be with the gitter backend. Dividing in minimum two parts seemed to be essential because it future if we add support for more backends then we can have separate files for each backend. Is this fine??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use text backend, it's merely there for testing reasons. errbot doesn't need special handling for backends, and hence the instructions should be more or less same. For example, we use the same instance for connecting over zulip as well, but we still don't have any special instructions for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.. will get this fixed..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please suggest using .env file, which don't need the export
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Can I insert link to some external blog regarding working with .env files??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not required.
docs/setup.rst
Outdated
(**Note:** The admin user account should be different than the bot account.) | ||
#. Hurrah!!! the bot is now ready to be deployed. To run the corobo instance use: | ||
:: | ||
errbot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before this is running, the bot account should join all rooms required manually to then listen to those iirc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, forgot this step.. will get it added..
docs/setup.rst
Outdated
bot_prefix help | ||
bot_prefix history | ||
|
||
**Note:** Every time you run a new instance of the bot, it is required to set the environment variables(steps 2 and 7). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really required, on a single session the env vars are preserved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant running a new shell instance. Will get this explicitly mentioned..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to advise them to use .env instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please run this text over a spell or grammar checker. Also take care of max line length, we have this checks over coala repository. Maybe grab a bear from there?
Docs usually take some time, but it's fine as they are supposed to be very easy to understand.
docs/setup.rst
Outdated
Installation | ||
------------ | ||
|
||
* To install corobo, first you need to setup a virtual environment(it is not mandatory but highly recommended). This can be done as follows: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* To install corobo, first you need to setup a virtual environment(it is not mandatory but highly recommended). This can be done as follows: | |
* To install corobo, first you need to setup a virtual environment. This can be done as follows: |
Let's not involve non-venv setups, which most probably won't even work.
docs/setup.rst
Outdated
|
||
* To install corobo, first you need to setup a virtual environment(it is not mandatory but highly recommended). This can be done as follows: | ||
:: | ||
pip3 install virtualenv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use venv since it ships with python. Let's also add a point of recommending them python 3.6.
docs/setup.rst
Outdated
|
||
|
||
Configuring the backend | ||
------------------------ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
------------------------ | |
----------------------- |
Can you check this, it should be exact the same length as the title above.
docs/setup.rst
Outdated
#. Clone the err-backend-gitter repository in your "corobo" folder. | ||
:: | ||
git clone https://github.com/errbotio/errbot@a0f35732484c8c0692e123c48653517cffa21a42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, this is incorrect. We should be using submodule.
docs/setup.rst
Outdated
./oauth.py | ||
This will guide you with the gitter token generation process. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very redundant, and you didn't tell them that this file belongs to the gitter backend directory. I don't think we need this as it is not even a part of corobo.
docs/setup.rst
Outdated
export GH_TOKEN="your_github_token" | ||
export GL_TOKEN="your_gitlab_token" | ||
export GH_ORG_NAME="your_github_organisation_name" | ||
export GL_ORG_NAME="your_gitlab_organisation_name" | ||
export ROOMS="rooms_to_join" | ||
export BOT_ADMINS="your_gitter_username" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please suggest using .env file, which don't need the export
.
docs/setup.rst
Outdated
export BOT_ADMINS="your_gitter_username" | ||
(**Note:** The admin user account should be different than the bot account.) | ||
|
||
#. Hurrah!!! the bot is now ready to rock. To run the corobo instance use: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#. Hurrah!!! the bot is now ready to rock. To run the corobo instance use: | |
#. Hurrah!!! The bot is now ready to rock. To run the corobo instance use: |
docs/setup.rst
Outdated
(**Note:** You can use the --DEBUG flag to run the bot in debug mode.) | ||
|
||
Your corobo instance should now be running. You can chat with the bot by logging in through the admin gitter account and | ||
searching its username in the contacts section. You can send it commands via chat. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
searching its username in the contacts section. You can send it commands via chat. | |
searching it's username in the contacts section. You can send it commands via chat. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also contact section? This could use a better word
docs/setup.rst
Outdated
bot_prefix history ----> Lists the command history | ||
|
||
|
||
**Note:** To avoid setting the env variables on every new run of shell instance, you can use a .env file to store the vars and run it before running the bot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**Note:** To avoid setting the env variables on every new run of shell instance, you can use a .env file to store the vars and run it before running the bot. | |
**Note:** To avoid setting the env variables on every new run of shell instance, you can use a .env file to store the vars and source it before running the bot. |
docs/setup.rst
Outdated
|
||
|
||
**Note:** To avoid setting the env variables on every new run of shell instance, you can use a .env file to store the vars and run it before running the bot. | ||
Refer this `link <https://pybit.es/persistent-environment-variables.html>`_ for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, unless it's an official resource it's better to just avoid it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Will get all the changes done and also have the grammar check..
Configuring the backend | ||
----------------------- | ||
|
||
- Clone the err-backend-gitter repository in your "corobo" folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think quotes are needed here.
- Clone the err-backend-gitter repository in your "corobo" folder. | |
- Clone the err-backend-gitter repository in your 'corobo' folder. |
pip3 install git+https://github.com/errbotio/\ | ||
err-backend-gitter@14a428bdd0597b473605264c822855da979bd916 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the way we install gitter backend. It is a part of the git submodules so the user just needs to update
the git submodule.
@@ -0,0 +1,95 @@ | |||
Setting Up Corobo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting Up Corobo | |
Setting Up corobo |
- To install corobo, first you need to install | ||
python (version 3.6 or more) and set up a virtual environment. | ||
This can be done as follows: | ||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect, you should keep this at the end of the paragraph above. Github somehow renders this but I wasn't able to get this rendered properly locally.
python3 -m venv env | ||
cd env | ||
source bin/activate ----> For Linux | ||
\Scripts\activate ----> For Windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a bit confusing, let's not specify instructions for windows or other OS.
- Hurrah!!! The bot is now ready to rock. To run the corobo instance, use: | ||
:: | ||
errbot | ||
(**Note:** You can use the --DEBUG flag to run the bot in debug mode.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a new line above this.
(**Note:** You can use the --DEBUG flag to run the bot in debug mode.) | ||
|
||
Your corobo instance should now be running. You can chat with the bot by | ||
logging in through the admin Gitter account and searching it's username in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logging in through the admin Gitter account and searching it's username in | |
logging in through the Gitter admin account and searching its username in |
Your corobo instance should now be running. You can chat with the bot by | ||
logging in through the admin Gitter account and searching it's username in | ||
the conversations tab. | ||
You can send it commands via chat. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can send it commands via chat. | |
You can then send commands via messages. |
logging in through the admin Gitter account and searching it's username in | ||
the conversations tab. | ||
You can send it commands via chat. | ||
:: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above.
bot_prefix help ----> Lists the set of commands available with the bot | ||
bot_prefix history ----> Lists the command history |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also not required.
bot_prefix help ----> Lists the set of commands available with the bot | |
bot_prefix history ----> Lists the command history | |
bot_prefix help | |
bot_prefix history |
This illustrates the steps involved in setting up corobo in text mode and with gitter-backend.
Reviewers Checklist
botcmd
andre_botcmd
decorators.