Skip to content

Commit 9e55e01

Browse files
committed
Add a documentation about App authentication
1 parent 8c26252 commit 9e55e01

3 files changed

Lines changed: 32 additions & 3 deletions

File tree

docs/github.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Github
2+
3+
Starting from 2026, the project was expannded to support revisions from sources other than Phabricator, particularly Github [pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests).
4+
5+
The code review bot automatically publishes a review containing the different comments, interacting with the Github API through the [App feature](https://docs.github.com/en/apps/using-github-apps/about-using-github-apps).
6+
7+
## App setup
8+
9+
First, a Github App must be created and installed to your user or organisation. You can follow Github's [documentation](https://docs.github.com/en/apps/creating-github-apps/about-creating-github-apps/about-creating-github-apps#building-a-github-app) for this process.
10+
11+
Once the app is installed, you can manage it from the [installation settings in github](https://github.com/settings/installations). The App must have access to the repositories to which it should be allowed to publish comments.
12+
It should be granted a **read** and **write** scope access to pull requests to be able to publish reviews. This can be configured through the **App settings** section of your installation.
13+
On this page, you should be able to find the App **installation ID** required to configure the bot.
14+
15+
## Authentication
16+
17+
Once an App is installed and has the valid access scopes, you can generate a new secret key from the [App settings](https://github.com/settings/apps). In the private key section, click the **Generate a private key** button and save the generated `.pem` file.
18+
On this page, you should be able to find the App **Client ID** required to configure the bot.
19+
20+
The code review bot YAML configuration should then be updated with the corresponding information:
21+
22+
```yaml
23+
bot:
24+
REPORTERS:
25+
- reporter: github
26+
app_client_id: xxxxxxxxxxxxxxxxxxxx
27+
app_pem_file: /path/to/key.pem
28+
app_installation_id: 123456789
29+
```

docs/phabricator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Phabricator
22

3-
The main goal of the project is to publish issues on Phabricator, so we need a good integration with their API and interface.
3+
The main goal of the project was to publish issues on Phabricator, so we need a good integration with their API and interface.
44

55
## Structure
66

docs/publication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ worker:
2323
2424
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/<TASK_ID>/<RUN_ID>/public/code-review/clang-tidy.json`
2525

26-
## Publish results on Phabricator
26+
## Publish results
2727

2828
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:
2929

3030
- if the issue is not in a modifided line of a file in the patch, it will be discarded.
3131
- if the issue is in a third party path, it will be discarded.
3232

33-
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.
33+
The bot supports publishing a review to either a Phabricator revision or a Github pull request.
3434

3535
## Troubleshooting
3636

0 commit comments

Comments
 (0)