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

setup.rst: Add docs to setup corobo #665

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

codehobbyist06
Copy link
Contributor

This illustrates the steps involved in setting up corobo in text mode and with gitter-backend.

Reviewers Checklist

  • Appropriate logging is done.
  • Appropriate error responses.
  • Handle every possible exception.
  • Make sure there is a docstring in the command functions. Hint: Lookout for
    botcmd and re_botcmd decorators.
  • See that 100% coverage is there.
  • See to it that mocking is not done where it is not necessary.

This illustrates the steps involved in setting up
corobo in text mode and with gitter-backend.

Closes coala#668
Copy link
Member

@abhishalya abhishalya left a 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
Comment on lines 26 to 29
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)
Copy link
Member

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?

Copy link
Contributor Author

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
Comment on lines 46 to 48
#. Clone the err-backend-gitter repository in your "corobo" folder.
::
git clone https://github.com/errbotio/err-backend-gitter.git
Copy link
Member

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.

Copy link
Contributor Author

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"
Copy link
Member

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.

Copy link
Contributor Author

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
Comment on lines 58 to 59
./oauth.py
This will guide you with the gitter token generation process.
Copy link
Member

Choose a reason for hiding this comment

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

What?

Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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:
Copy link
Member

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.

Copy link
Contributor Author

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
Comment on lines 71 to 76
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"
Copy link
Member

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.

Copy link
Contributor Author

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??

Copy link
Member

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.

Copy link
Contributor Author

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..

Copy link
Member

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.

Copy link
Contributor Author

@codehobbyist06 codehobbyist06 Apr 20, 2021

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??

Copy link
Member

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
Copy link
Member

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.

Copy link
Contributor Author

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).
Copy link
Member

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.

Copy link
Contributor Author

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..

Copy link
Member

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.

Copy link
Member

@abhishalya abhishalya left a 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:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* 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
Copy link
Member

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
------------------------
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
------------------------
-----------------------

Can you check this, it should be exact the same length as the title above.

docs/setup.rst Outdated
Comment on lines 26 to 28
#. Clone the err-backend-gitter repository in your "corobo" folder.
::
git clone https://github.com/errbotio/errbot@a0f35732484c8c0692e123c48653517cffa21a42
Copy link
Member

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
Comment on lines 58 to 59
./oauth.py
This will guide you with the gitter token generation process.
Copy link
Member

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
Comment on lines 71 to 76
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"
Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#. 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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.

Copy link
Member

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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
**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.
Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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.

Suggested change
- Clone the err-backend-gitter repository in your "corobo" folder.
- Clone the err-backend-gitter repository in your 'corobo' folder.

Comment on lines +31 to +32
pip3 install git+https://github.com/errbotio/\
err-backend-gitter@14a428bdd0597b473605264c822855da979bd916
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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:
::
Copy link
Member

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
Copy link
Member

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.)
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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.
::
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as above.

Comment on lines +90 to +91
bot_prefix help ----> Lists the set of commands available with the bot
bot_prefix history ----> Lists the command history
Copy link
Member

Choose a reason for hiding this comment

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

Also not required.

Suggested change
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants