SERVER-82043 Enhancement of Commit Message Validation for 10gen/mongo Commits (#16160)

GitOrigin-RevId: 63f6aa962e320b8f8d33cf50e05f1dd53c688a0e
This commit is contained in:
Juan Gu
2023-10-10 10:58:21 -07:00
committed by MongoDB Bot
parent 9e97139e2e
commit 4dc9f17146

View File

@@ -41,6 +41,9 @@ COMMON_PUBLIC_PATTERN = r'''
'''
"""Common Public pattern format."""
COMMON_10GENREPO_COMMIT_QUEUE_PATTERN = r' ^\'(?P<repo>10gen/mongo)\'\s.*commit\squeue\smerge.*SERVER-[0-9]+'
"""Common commit queue format."""
COMMON_LINT_PATTERN = r'(?P<lint>Fix\slint)'
"""Common Lint pattern format."""
@@ -99,6 +102,12 @@ def old_patch_description(pattern: str) -> str:
VALID_PATTERNS = [
re.compile(new_patch_description(COMMON_PUBLIC_PATTERN), re.MULTILINE | re.DOTALL | re.VERBOSE),
re.compile(old_patch_description(COMMON_PUBLIC_PATTERN), re.MULTILINE | re.DOTALL | re.VERBOSE),
re.compile(
new_patch_description(COMMON_10GENREPO_COMMIT_QUEUE_PATTERN),
re.MULTILINE | re.DOTALL | re.VERBOSE),
re.compile(
old_patch_description(COMMON_10GENREPO_COMMIT_QUEUE_PATTERN),
re.MULTILINE | re.DOTALL | re.VERBOSE),
re.compile(new_patch_description(COMMON_LINT_PATTERN), re.MULTILINE | re.DOTALL | re.VERBOSE),
re.compile(old_patch_description(COMMON_LINT_PATTERN), re.MULTILINE | re.DOTALL | re.VERBOSE),
re.compile(new_patch_description(COMMON_IMPORT_PATTERN), re.MULTILINE | re.DOTALL | re.VERBOSE),