From: Ville Ojamo <14869000+bluikko@users.noreply.github.com> Date: Fri, 12 Jun 2026 05:21:27 +0000 (+0700) Subject: ceph-pr-commits: support target branch in docs commit msgs X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0f2c325dbbb5a3991e04dab383e7c3ce12233bf4;p=ceph-build.git ceph-pr-commits: support target branch in docs commit msgs 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 --- diff --git a/ceph-pr-commits/build/test_commits.py b/ceph-pr-commits/build/test_commits.py index 3d2c62e7c..1fb639367 100644 --- a/ceph-pr-commits/build/test_commits.py +++ b/ceph-pr-commits/build/test_commits.py @@ -39,7 +39,12 @@ class TestCommits(object): @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,