diff --git a/tests/ci/git_helper.py b/tests/ci/git_helper.py index 2d28c693087..5c02ea53cf8 100644 --- a/tests/ci/git_helper.py +++ b/tests/ci/git_helper.py @@ -3,7 +3,7 @@ import argparse import os.path as p import re import subprocess -from typing import Optional +from typing import List, Optional # ^ and $ match subline in `multiple\nlines` # \A and \Z match only start and end of the whole string @@ -89,7 +89,7 @@ class Git: self.run(f"git rev-list {self.latest_tag}..HEAD --count") ) - def _check_tag(self, value: str): + def check_tag(self, value: str): if value == "": return if not self._tag_pattern.match(value): @@ -101,7 +101,7 @@ class Git: @latest_tag.setter def latest_tag(self, value: str): - self._check_tag(value) + self.check_tag(value) self._latest_tag = value @property @@ -110,7 +110,7 @@ class Git: @new_tag.setter def new_tag(self, value: str): - self._check_tag(value) + self.check_tag(value) self._new_tag = value @property @@ -122,3 +122,6 @@ class Git: version = self.latest_tag.split("-", maxsplit=1)[0] return int(version.split(".")[-1]) + self.commits_since_tag + + def get_tags(self) -> List[str]: + return self.run("git tag").split()