ceph/ceph@
0a54fcdfc491ce2b2bb3ded77e319a7cff785e73 added a new policy
that backport PRs with not-cherry-picked commits need the commit log
summary to begin with the target branch name.
This policy conflicted with docs-only commits that must have the same
line start with "doc", as enforced by this job.
Modify the regex used to allow an additional optional "branch: " string in
front of the "doc" string in the beginning of the commit message
summary, only if "target_branch" is something else than "main".
Signed-off-by: Ville Ojamo <git2233+ceph@ojamo.eu>
@pytest.mark.doc_test
def test_doc_title(self):
- doc_regex = '^doc'
+ if self.target_branch == 'main':
+ doc_regex = '^doc'
+ else:
+ # the title of a non-cherry-pick commit starts with the target branch name, like
+ # "squid: doc: ...." instead of "doc: ..."
+ doc_regex = f'^({self.target_branch}: )?doc'
all_commits = f'git log -z --no-merges --pretty=format:%s origin/{self.target_branch}..{self.source_branch}'
wrong_commits = list(filterfalse(
re.compile(doc_regex).search,