|
26 | 26 | ) |
27 | 27 | from code_review_bot.config import settings |
28 | 28 | from code_review_bot.report import get_reporters |
29 | | -from code_review_bot.revisions import PhabricatorRevision, Revision |
| 29 | +from code_review_bot.revisions import GithubRevision, PhabricatorRevision, Revision |
30 | 30 | from code_review_bot.tools.libmozdata import setup as setup_libmozdata |
31 | 31 | from code_review_bot.tools.log import init_logger |
32 | 32 | from code_review_bot.workflow import Workflow |
@@ -64,6 +64,13 @@ def parse_cli(): |
64 | 64 | type=Path, |
65 | 65 | default=None, |
66 | 66 | ) |
| 67 | + parser.add_argument( |
| 68 | + "--github-repository", |
| 69 | + help="Optional path to a up-to-date github repository matching the analyzed revision.\n" |
| 70 | + "This argument is required for Github reviusions in order to compute issues' hashes based on file content.", |
| 71 | + type=Path, |
| 72 | + default=None, |
| 73 | + ) |
67 | 74 | parser.add_argument("--taskcluster-client-id", help="Taskcluster Client ID") |
68 | 75 | parser.add_argument("--taskcluster-access-token", help="Taskcluster Access token") |
69 | 76 | return parser.parse_args() |
@@ -116,6 +123,7 @@ def main(): |
116 | 123 | taskcluster.secrets["repositories"], |
117 | 124 | taskcluster.secrets["ssh_key"], |
118 | 125 | args.mercurial_repository, |
| 126 | + args.github_repository, |
119 | 127 | ) |
120 | 128 |
|
121 | 129 | # Setup statistics |
@@ -205,6 +213,11 @@ def main(): |
205 | 213 | ) |
206 | 214 | return 1 |
207 | 215 |
|
| 216 | + if isinstance(revision, GithubRevision): |
| 217 | + assert ( |
| 218 | + args.github_repository is not None |
| 219 | + ), "Girhub revision analysis requires the --github-repository argument to be set" |
| 220 | + |
208 | 221 | # Run workflow according to source |
209 | 222 | w = Workflow( |
210 | 223 | reporters, |
|
0 commit comments