Skip to content

Refactor docbot service #20

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

Merged
merged 1 commit into from
Jun 17, 2022
Merged

Refactor docbot service #20

merged 1 commit into from
Jun 17, 2022

Conversation

artembo
Copy link
Contributor

@artembo artembo commented Jun 17, 2022

To make the project more flexible and extendable, tarantoolbot.py file
was split on the several files. Bottle framework was replaced with
Flask as it is easier to connect to Elastic APM server.

  • app.py contains Flask config, WSGI application and endpoints.
  • github.py has GitHub class to interact with its API.
  • handles.py contains handlers which parse request data and
    transfers data to processors
  • processors.py keeps GitHum commit and issue messages processors
  • settigns.py - project config
  • utils.py - project helpers

Added possibility to add any repository to the bot through
doc_repo_urls mapping in settings.py.

Added deploy workflow to push the project to Dokku server. The
workflow pushes code with --force flag, so it will override project
in Dokku even if Dokku repo has different branch or commits order.

Dockerfile was refactored for using lightweight python-3.10.4 image
based on Alpine.

To add new repository to the bot, do the following steps:

  • add @TarantoolBot user to the source project and to the corresponding
    doc project as well.
  • add source to docs repos mapping to settings.py in doc_repo_urls
    dictionary.
  • push the changes to master, the project will be deployed.
  • set up webhook to the source repository and point it to docbot
    service.

Closes #13
Closes #16
Part of tarantool/infra#77

@artembo artembo requested a review from NickVolynkin June 17, 2022 14:02
To make the project more flexible and extendable, tarantoolbot.py file
was split on the several files. Bottle framework was replaced with
Flask as it is easier to connect to Elastic APM server.

- `app.py` contains Flask config, WSGI application and endpoints.
- `github.py` has GitHub class to interact with its API.
- `handles.py` contains handlers which parse request data and
  transfers data to processors
- `processors.py` keeps GitHum commit and issue messages processors
- `settigns.py` - project config
- `utils.py` - project helpers

Added possibility to add any repository to the bot through
doc_repo_urls mapping in `settings.py`.

Added `deploy` workflow to push the project to Dokku server. The
workflow pushes code with `--force` flag, so it will override project
in Dokku even if Dokku repo has different branch or commits order.

`Dockerfile` was refactored for using lightweight python-3.10.4 image
based on Alpine.

To add new repository to the bot, do the following steps:
- add @TarantoolBot user to the source project and to the corresponding
  doc project as well.
- add source to docs repos mapping to `settings.py` in doc_repo_urls
  dictionary.
- push the changes to master, the project will be deployed.
- set up webhook to the source repository and point it to docbot
  service.

Closes #13
Closes #16
Part of tarantool/infra#77
@artembo artembo merged commit f1df824 into master Jun 17, 2022
@artembo artembo deleted the docbot2 branch June 17, 2022 15:19
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.

Build and deploy docbot with GitHub CI Enable docbot for custom documentation repos
2 participants