From a06ce6b3146c84031e4d89f6554dfd8cae63c56b Mon Sep 17 00:00:00 2001 From: Valentin Rigal Date: Wed, 11 Mar 2026 15:58:43 +0100 Subject: [PATCH 1/4] Doc about the github reporter --- bot/README.md | 24 +++++++++++++++++++++++- docs/phabricator.md | 2 +- docs/publication.md | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/bot/README.md b/bot/README.md index 1fffb7035..3945128e6 100644 --- a/bot/README.md +++ b/bot/README.md @@ -76,6 +76,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. + +You can find more details about the Github reporter setup in the [documentation](/docs/github.md). + ## Example configuration ```yaml @@ -88,5 +103,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/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 From 7bbd5915c63367e99f816305a0355c1ee9ff3e33 Mon Sep 17 00:00:00 2001 From: Valentin Rigal Date: Wed, 11 Mar 2026 16:09:05 +0100 Subject: [PATCH 2/4] Succint documentation about Repository slug --- docs/new_repository.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/new_repository.md b/docs/new_repository.md index 877f2a606..d88100a83 100644 --- a/docs/new_repository.md +++ b/docs/new_repository.md @@ -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`. From ad9ed6ff131988190e63faca1a2dc996eef5daed Mon Sep 17 00:00:00 2001 From: Valentin Rigal Date: Tue, 12 May 2026 10:57:02 +0200 Subject: [PATCH 3/4] Update documentation --- bot/README.md | 4 ++-- docs/new_repository.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/README.md b/bot/README.md index 3945128e6..cca983b78 100644 --- a/bot/README.md +++ b/bot/README.md @@ -87,9 +87,9 @@ Configuration: - `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. +This reporter will send detailed information about every **publishable** issue in a review. -You can find more details about the Github reporter setup in the [documentation](/docs/github.md). +In case no issue is found, the reported will approve the Pull Request. ## Example configuration diff --git a/docs/new_repository.md b/docs/new_repository.md index d88100a83..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: @@ -50,4 +50,4 @@ It's pretty easy to create a repository on the backend, there are only 2 fields - 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, -⚠️ 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`. +⚠️ 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`. From 9fd64b78b9934953a7e246cda8dab9b3958f5c7c Mon Sep 17 00:00:00 2001 From: Valentin Rigal Date: Tue, 26 May 2026 12:31:42 +0200 Subject: [PATCH 4/4] Update documentation about reporters --- bot/README.md | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/bot/README.md b/bot/README.md index cca983b78..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,7 +83,7 @@ Configuration: This reporter will send detailed information about every **publishable** issue. -## Reporter: Github +### Reporter: Github Key `reporter` is `github` @@ -103,6 +110,7 @@ common: bot: REPORTERS: + - reporter: phabricator - reporter: github client_id: xxxxxxxxxxxxxxxxxxxx private_key_pem: |-