{"id":31547384,"url":"https://github.com/oca/oca-github-bot","last_synced_at":"2025-10-04T15:59:56.558Z","repository":{"id":34554582,"uuid":"149272713","full_name":"OCA/oca-github-bot","owner":"OCA","description":"The GitHub Bot of the Odoo Community Association (OCA)","archived":false,"fork":false,"pushed_at":"2025-09-22T17:49:21.000Z","size":888,"stargazers_count":54,"open_issues_count":52,"forks_count":66,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-09-22T19:36:47.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OCA.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"OCA"}},"created_at":"2018-09-18T10:49:51.000Z","updated_at":"2025-09-22T13:44:59.000Z","dependencies_parsed_at":"2024-01-08T19:04:02.343Z","dependency_job_id":"a29b1cd0-060f-4b9c-ad26-eccfaae83d71","html_url":"https://github.com/OCA/oca-github-bot","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"purl":"pkg:github/OCA/oca-github-bot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCA%2Foca-github-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCA%2Foca-github-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCA%2Foca-github-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCA%2Foca-github-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OCA","download_url":"https://codeload.github.com/OCA/oca-github-bot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OCA%2Foca-github-bot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278335453,"owners_count":25970129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-04T15:59:50.619Z","updated_at":"2025-10-04T15:59:56.553Z","avatar_url":"https://github.com/OCA.png","language":"Python","funding_links":["https://github.com/sponsors/OCA"],"categories":[],"sub_categories":[],"readme":"##############\nOCA GitHub bot\n##############\n\n.. image:: https://results.pre-commit.ci/badge/github/OCA/oca-github-bot/master.svg\n   :target: https://results.pre-commit.ci/latest/github/OCA/oca-github-bot/master\n   :alt: pre-commit.ci status\n.. image:: https://github.com/OCA/oca-github-bot/actions/workflows/ci.yml/badge.svg\n   :target: https://github.com/OCA/oca-github-bot/actions/workflows/ci.yml\n   :alt: GitHub CI status\n\nThe goal of this project is to collect in one place:\n\n* all operations that react to GitHub events,\n* all operations that act on GitHub repos on a scheduled basis.\n\nThis will make it easier to review changes, as well as monitor and manage\nthese operations, compared to the current situations where these functions\nare spread across cron jobs and ad-hoc scripts.\n\n**Table of contents**\n\n.. contents::\n   :local:\n\nFeatures\n========\n\nOn pull request open\n--------------------\n\nMention declared maintainers that addons they maintain are being modified.\n\nComment with a call for maintainers if there are no declared maintainer.\n\nOn pull request close\n---------------------\n\nAuto-delete pull request branch\n  When a pull request is merged from a branch in the same repo,\n  the bot deletes the source branch.\n\nOn push to main branches\n------------------------\n\nRepo addons table generator in README.md\n  For addons repositories, update the addons table in README.md.\n\nAddon README.rst generator\n  For addons repositories, generate README.rst from readme fragments\n  in each addon directory, and push changes back to github.\n\nAddon icon generator\n  For addons repositories, put default OCA icon in each addon that don't have\n  yet any icon, and push changes back to github.\n\nsetup.py generator\n  For addons repositories, run setuptools-odoo-make-defaults, and push\n  changes back to github.\n\nThese actions are also run nightly on all repos.\n\nAlso nightly, wheels are generated for all addons repositories and rsynced\nto a PEP 503 simple index or twine uploaded to compatible indexes.\n\nOn Pull Request review\n----------------------\n\nWhen there are two approvals, set the ``approved`` label.\nWhen the PR is at least 5 days old, set the ``ready to merge`` label.\n\nOn Pull Request CI status\n-------------------------\n\nWhen the CI in a Pull Request goes green, set the ``needs review`` label,\nunless it has ``wip:``  or ``[wip]`` in it's title.\n\nCommands\n--------\n\nOne can ask the bot to perform some tasks by entering special commands\nas merge request comments.\n\n``/ocabot merge`` followed by one of ``major``, ``minor``, ``patch`` or ``nobump``\ncan be used to ask the bot to do the following:\n\n* merge the PR onto a temporary branch created off the target branch\n* merge when tests on the rebased branch are green\n* optionally bump the version number of the addons modified by the PR\n* when the version was bumped, udate the changelog with ``oca-towncrier``\n* run the main branch operations (see above) on it\n* when the version was bumped, generate a wheel, rsync it to a PEP 503\n  simple index root, or upload it to one or more indexes with twine\n\n``/ocabot rebase`` can be used to ask the bot to do the following:\n\n* rebase the PR on the target branch\n\n``/ocabot migration``, followed by the module name, performing the following:\n\n* Look for an issue in that repository with the name \"Migration to version\n  ``{version}``\", where ``{version}`` is the name of the target branch.\n* Add or edit a line in that issue, linking the module to the pull request\n  (PR) and the author of it.\n* TODO: When the PR is merged, the line gets ticked.\n* Put the milestone corresponding to the target branch in the PR.\n\nTODO (help wanted)\n------------------\n\nSee our open `issues \u003chttps://github.com/OCA/oca-github-bot/issues\u003e`_,\npick one and contribute!\n\n\nDeveloping new features\n=======================\n\nThe easiest is to look at examples.\n\nNew webhooks are added in the `webhooks \u003c./src/oca_github_bot/webhooks\u003e`_ directory.\nWebhooks execution time must be very short and they should\ndelegate the bulk of their work as delayed tasks, which have\nthe benefit of not overloading the machine and having proper\nerror handling and monitoring.\n\nTasks are in the `tasks \u003c./src/oca_github_bot/tasks\u003e`_ directory. They are `Celery tasks\n\u003chttp://docs.celeryproject.org/en/latest/userguide/tasks.html\u003e`_.\n\nTasks can be scheduled, in `cron.py \u003c./src/oca_github_bot/cron.py\u003e`_, using the `Celery periodic tasks\n\u003chttp://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html\u003e`_ mechanism.\n\nRunning it\n==========\n\nEnvironment variables\n---------------------\n\nFirst create and customize a file named ``.env``,\nbased on `environment.sample \u003c./environment.sample\u003e`_.\n\nTasks performed by the bot can be specified by setting the ``BOT_TASKS``\nvariable. This is useful if you want to use this bot for your own GitHub\norganisation.\n\nYou can also disable a selection of tasks, using ``BOT_TASKS_DISABLED``.\n\nUsing docker-compose\n--------------------\n\n``docker-compose up --build`` will start\n\n* the bot, listening for webhooks calls on port 8080\n* a celery ``worker`` to process long running tasks\n* a celery ``beat`` to launch scheduled tasks\n* a ``flower`` celery monitoring tool on port 5555\n\nThe bot URL must be exposed on the internet through a reverse\nproxy and configured as a GitHub webhook, using the secret configured\nin ``GITHUB_SECRET``.\n\nDevelopment\n===========\n\nThis project uses `black \u003chttps://github.com/ambv/black\u003e`_\nas code formatting convention, as well as isort and flake8.\nTo make sure local coding convention are respected before\nyou commit, install\n`pre-commit \u003chttps://github.com/pre-commit/pre-commit\u003e`_ and\nrun ``pre-commit install`` after cloning the repository.\n\nTo run tests, type ``tox``. Test are written with pytest.\n\nHere is a recommended procedure to test locally:\n\n* Prepare an ``environment`` file by cloning and adapting ``environment.sample``.\n* Load ``environment`` in your shell, for instance with bash:\n\n.. code::\n\n  set -o allexport\n  source environment\n  set +o allexport\n\n* Launch the ``redis`` message queue:\n\n.. code::\n\n  docker run -p 6379:6379 redis\n\n* Install the `maintainer tools \u003chttps://github.com/OCA/maintainer-tools\u003e`_ and add the generated binaries to your path:\n\n.. code::\n\n  PATH=/path/to/maintainer-tools/env/bin/:$PATH\n\n* Create a virtual environment and install the project in it:\n\n.. code::\n\n  python3 -m venv venv\n  source venv/bin/activate\n  pip install -r requirements.txt -e .\n\n* Then you can debug the two processes in your favorite IDE:\n\n  - the webhook server: ``python -m oca_github_bot``\n  - the task worker: ``python -m celery --app=oca_github_bot.queue.app  worker --pool=solo --loglevel=INFO``\n\n* To expose the webhook server on your local machine to internet,\n  you can use `ngrok \u003chttps://ngrok.com/\u003e`_\n* Then configure a GitHub webhook in a sandbox project in your organization\n  so you can start receiving webhook calls to your local machine.\n\nReleasing\n=========\n\nTo release a new version, follow these steps:\n- ``towncrier --version YYYYMMDD``\n- git commit the updated `HISTORY.rst` and removed newfragments\n- ``git tag vYYYYMMDD``\n- ``git push --tags``\n\nContributors\n============\n\n* Stéphane Bidoul \u003cstephane.bidoul@acsone.eu\u003e\n* Holger Brunn \u003chbrunn@therp.nl\u003e\n* Miquel Raïch \u003cmiquel.raich@forgeflow.com\u003e\n* Florian Kantelberg \u003cflorian.kantelberg@initos.com\u003e\n* Laurent Mignon \u003claurent.mignon@acsone.eu\u003e\n* Jose Angel Fentanez \u003cjoseangel@vauxoo.com\u003e\n* Simone Rubino \u003csimone.rubino@agilebg.com\u003e\n* Sylvain Le Gal (https://twitter.com/legalsylvain)\n* Tecnativa - Pedro M. Baeza\n* Tecnativa - Víctor Martínez\n\nMaintainers\n===========\n\nThis module is maintained by the OCA.\n\n.. image:: https://odoo-community.org/logo.png\n   :alt: Odoo Community Association\n   :target: https://odoo-community.org\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foca%2Foca-github-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foca%2Foca-github-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foca%2Foca-github-bot/lists"}