2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,16 @@ def has_wpt_uplift_markers(commit_author: str, summary: str) -> bool:
205
205
)
206
206
207
207
208
+ def has_ignore_this_changeset_marker (summary : str ) -> bool :
209
+ """Does this changeset summary say the changeset should be entirely ignored?
210
+
211
+ Case in point for this marker is a BIG automated change to the entire source tree.
212
+ See https://hg.mozilla.org/mozilla-central/json-rev/6f3709b3878117466168c40affa7bca0b60cf75b
213
+ for an example.
214
+ """
215
+ return "# ignore-this-changeset" in summary
216
+
217
+
208
218
def split_summary (s : str ) -> str :
209
219
"""Split a commit message summary from the long-form description.
210
220
@@ -236,6 +246,11 @@ def determine_review_system(revision_json):
236
246
if has_backout_markers (summary ):
237
247
log .info (f'changeset { changeset } : changeset is a back-out commit' )
238
248
return ReviewSystem .review_unneeded
249
+ elif has_ignore_this_changeset_marker (summary ):
250
+ log .info (
251
+ f'changeset { changeset } : changeset summary has "ignore-this-changeset" flag'
252
+ )
253
+ return ReviewSystem .not_applicable
239
254
elif has_merge_markers (revision_json ):
240
255
log .info (f'changeset { changeset } : is a merge commit' )
241
256
return ReviewSystem .not_applicable
Original file line number Diff line number Diff line change @@ -193,6 +193,16 @@ def test_has_uplift_markers(test_input, expected):
193
193
assert has_uplift_markers (test_input ) == expected
194
194
195
195
196
+ def test_has_ignore_this_change_marker ():
197
+ from committelemetry .classifier import has_ignore_this_changeset_marker
198
+
199
+ summary = """\
200
+ Reformat the entire source tree
201
+ # ignore-this-changeset
202
+ """
203
+ assert has_ignore_this_changeset_marker (summary )
204
+
205
+
196
206
def test_obsolete_attachments_are_filtered_out ():
197
207
from committelemetry .classifier import collect_review_attachments
198
208
0 commit comments