]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-pr-commits: support target branch in docs commit msgs 2582/head
authorVille Ojamo <14869000+bluikko@users.noreply.github.com>
Fri, 12 Jun 2026 05:21:27 +0000 (12:21 +0700)
committerVille Ojamo <14869000+bluikko@users.noreply.github.com>
Fri, 12 Jun 2026 05:21:27 +0000 (12:21 +0700)
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>
ceph-pr-commits/build/test_commits.py

index 3d2c62e7cc72216e5a0a927f743ea3fc5ab50b5a..1fb639367f427022880ccc9ca0922034918df7be 100644 (file)
@@ -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,