|
33 | 33 | # Match 'no bug' anywhere in the commit message summary
|
34 | 34 | NOBUG_RE = re.compile(r'\bno bug\b', re.IGNORECASE)
|
35 | 35 |
|
| 36 | +# Match '[wpt PR 1234] - summary a=testonly' |
| 37 | +WPT_SYNC_BOT_RE = re.compile(r'\[wpt PR \d+\](.*) a=testonly') |
| 38 | + |
36 | 39 |
|
37 | 40 | class ReviewSystem(Enum):
|
38 | 41 | """The review system used for a commit.
|
@@ -160,6 +163,15 @@ def has_no_bug_marker(summary: str) -> bool:
|
160 | 163 | return bool(re.search(NOBUG_RE, summary))
|
161 | 164 |
|
162 | 165 |
|
| 166 | +def has_wpt_uplift_markers(summary: str) -> bool: |
| 167 | + """Was this commit by the Web Platform Test Sync Bot? |
| 168 | +
|
| 169 | + See https://hg.mozilla.org/mozilla-central/rev/e2dced9fda47999677b840a58f5e39b2217881e8 |
| 170 | + for an example commit. |
| 171 | + """ |
| 172 | + return bool(re.search(WPT_SYNC_BOT_RE, summary)) |
| 173 | + |
| 174 | + |
163 | 175 | def split_summary(s: str) -> str:
|
164 | 176 | """Split a commit message summary from the long-form description.
|
165 | 177 |
|
@@ -195,6 +207,13 @@ def determine_review_system(revision_json):
|
195 | 207 | elif has_no_bug_marker(summary):
|
196 | 208 | log.info(f'changeset {changeset}: summary is marked "no bug"')
|
197 | 209 | return ReviewSystem.no_bug
|
| 210 | + elif has_wpt_uplift_markers(summary): |
| 211 | + # This commit was requested by a bot account that vendors an external |
| 212 | + # project into the tree. We can ignore it. |
| 213 | + log.info( |
| 214 | + f'changeset {changeset}: changeset was requested by moz-wptsync-bot' |
| 215 | + ) |
| 216 | + return ReviewSystem.not_applicable |
198 | 217 |
|
199 | 218 | # 1. Check for Phabricator because it's easiest.
|
200 | 219 | # TODO can we rely on BMO attachments for this?
|
|
0 commit comments