diff --git a/bot/README.md b/bot/README.md index 1fffb7035..d9bc76dc2 100644 --- a/bot/README.md +++ b/bot/README.md @@ -39,11 +39,6 @@ The following configuration variables are currently supported: - `PAPERTRAIL_PORT` is the optional Papertrail port configuration, used for logging. - `SENTRY_DSN` is the optional Sentry full url to report runtime errors. -The `REPORTERS` configuration is a list of dictionaries describing which reporting tool to use at the end of the patches code review. -Supported reporting tools are emails (for admins) and Phabricator. - -Each reporter configuration must contain a `reporter` key with a unique name per tool. Each tool has its own configuration requirement. - You can view a [full configuration sample here](/docs/configuration.md). ## Phabricator credentials @@ -56,7 +51,19 @@ They are required, and must be set like this: api_key: api-XXXX ``` -## Reporter: Mail +## Reporters + +The `REPORTERS` configuration is a list of dictionaries describing which reporting tool to use at the end of the code review analysis. +Supported reporting tools are: + +- Emails (only for admins) +- Phabricator (only for revisions coming from Phabricator) +- Lando (updates lando with a warning message, only for revisions coming from Phabricator) +- Build errors (warns about build errors, by email for Phabricator and as a comment in Github) + +Each reporter configuration must contain a `reporter` key with a unique name per tool. If a reporter cannot handle the revision source, it will be skipped. Each tool has its own configuration requirement. + +### Reporter: Mail Key `reporter` is `mail` @@ -66,7 +73,7 @@ Only one configuration is required: `emails` is a list of emails addresses recei This reporter will send detailed information about every issue. -## Reporter: Phabricator +### Reporter: Phabricator Key `reporter` is `phabricator` @@ -76,6 +83,21 @@ Configuration: This reporter will send detailed information about every **publishable** issue. +### Reporter: Github + +Key `reporter` is `github` + +Configuration: + +- `client_id` : Github App client ID. +- `private_key_pem` : Content of the github App private key. +- `installation_id` : ID of the Github App [installation](https://docs.github.com/en/apps/using-github-apps/installing-your-own-github-app) (integer). +- `analyzers_skipped` : The analyzers that will **not** be published on Phabricator. + +This reporter will send detailed information about every **publishable** issue in a review. + +In case no issue is found, the reported will approve the Pull Request. + ## Example configuration ```yaml @@ -89,4 +111,12 @@ common: bot: REPORTERS: - reporter: phabricator + - reporter: github + client_id: xxxxxxxxxxxxxxxxxxxx + private_key_pem: |- + -----BEGIN RSA PRIVATE KEY----- + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + -----END RSA PRIVATE KEY----- + installation_id: 123456789 ``` diff --git a/docs/new_repository.md b/docs/new_repository.md index 877f2a606..419e5d114 100644 --- a/docs/new_repository.md +++ b/docs/new_repository.md @@ -38,7 +38,7 @@ The configuration [is explained in this documentation](./configuration.md) in de ### Backend database -Mercurial repositories hosted on `hg.mozilla.org` are automatically created on the backend, by the bot (since [#2530](https://github.com/mozilla/code-review/pull/2530)). In most cases, no management action is needed. +Mercurial repositories (hosted on `hg.mozilla.org`) and Github repositories (hosted on `github.com`), are automatically created on the backend, by the bot (since [#2530](https://github.com/mozilla/code-review/pull/2530)). In most cases, no management action is needed. If you need to edit or create an extra repository, you'll need to use the targeted environment's backend: @@ -47,7 +47,7 @@ If you need to edit or create an extra repository, you'll need to use the target It's pretty easy to create a repository on the backend, there are only 2 fields to fill in: -- the **slug** must match your YAML configuration `name` key, and be unique across all repositories on the database, - the **url** must match your YAML configuration `url` key, and also be unique across all repositories on the database. +- the **slug** must match your YAML configuration `name` key, and be unique across all repositories on the database, -![](./new_repository_backend.png) +⚠️ The slug field must match the repository path, replacing `/` by `_` in order for the bot to detect it correctly. For example, the slug for the repository `https://github.com/mozilla/test` would be `mozilla_test`. diff --git a/docs/phabricator.md b/docs/phabricator.md index 76f5e9885..d1524eff1 100644 --- a/docs/phabricator.md +++ b/docs/phabricator.md @@ -1,6 +1,6 @@ # Phabricator -The main goal of the project is to publish issues on Phabricator, so we need a good integration with their API and interface. +The main goal of the project was to publish issues on Phabricator, so we need a good integration with their API and interface. ## Structure diff --git a/docs/publication.md b/docs/publication.md index 999ab8aad..ce21101ea 100644 --- a/docs/publication.md +++ b/docs/publication.md @@ -23,14 +23,14 @@ worker: Here, the analyzer produces its JSON output as `/builds/worker/clang-tidy.json`, but Taskcluster will expose it on its own public hostname as `https://taskcluster-artifacts.net///public/code-review/clang-tidy.json` -## Publish results on Phabricator +## Publish results Once your task is triggered with the `code-review` attribute, its analysis artifact will be retrieved automatically by the bot. All issues found will be filtered using those basic rules: - if the issue is not in a modifided line of a file in the patch, it will be discarded. - if the issue is in a third party path, it will be discarded. -We have [plans](https://bugzilla.mozilla.org/show_bug.cgi?id=1555721) to remove the first filter, by using a two pass approach and comparing the issues found before vs. after applying the patch. +The bot supports publishing a review to either a Phabricator revision or a Github pull request. ## Troubleshooting