def should_skip_message(info): if info["MessageType"] in ("newchange", "newpatchset", "comment"): commit = gerrit.get_commit(info["Change-Id"], info["PatchSet"]) committer = commit["committer"]["email"] return not committer.endswith("@google.com") else: raise ValueError("should_skip_message() is only valid for new " "changes, patch sets, and commits.")
def should_skip_message(info): if info['MessageType'] in ('newchange', 'newpatchset', 'comment'): commit = gerrit.get_commit(info['Change-Id'], info['PatchSet']) committer = commit['committer']['email'] return not committer.endswith('@google.com') else: raise ValueError('should_skip_message() is only valid for new ' 'changes, patch sets, and commits.')
def is_untrusted_committer(change_id, patch_set): # TODO(danalbert): Needs to be based on the account that made the comment. commit = gerrit.get_commit(change_id, patch_set) committer = commit['committer']['email'] return not committer.endswith('@google.com')