]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
Revert "oeqa/utils/gitarchive: fix tag computation when creating archive"
authorSteve Sakoman <steve@sakoman.com>
Mon, 13 Nov 2023 02:35:35 +0000 (16:35 -1000)
committerSteve Sakoman <steve@sakoman.com>
Mon, 13 Nov 2023 02:35:35 +0000 (16:35 -1000)
This reverts commit b0d96ea432196800fedb45e6d1da44a3523fad63.

This caused failures on the build performance tests on the autobuilder.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/lib/oeqa/utils/gitarchive.py

index 2bb1bde774b587c4305774c6af5e8d719786633a..cd60a605d4580a33826570fe6fa50dbbf5ca383c 100644 (file)
@@ -100,36 +100,9 @@ def git_commit_data(repo, data_dir, branch, message, exclude, notes, log):
         if os.path.exists(tmp_index):
             os.unlink(tmp_index)
 
-def get_tags(repo, pattern=None, url=None):
-    """ Fetch remote tags from current repository
-
-    A pattern can be provided to filter returned tags list
-    An URL can be provided if local repository has no valid remote configured
-    """
-
-    base_cmd = ['ls-remote', '--refs', '--tags', '-q']
-    cmd = base_cmd.copy()
-
-    # First try to fetch tags from repository configured remote
-    cmd.append('origin')
-    if pattern:
-        cmd.append(pattern)
-    try:
-        tags_refs = repo.run_cmd(cmd)
-    except GitError as e:
-        # If it fails, retry with repository url if one is provided
-        if not url:
-            raise(e)
-        cmd = base_cmd.copy()
-        cmd.append(url)
-        if pattern:
-            cmd.append(pattern)
-        tags_refs = repo.run_cmd(cmd)
-
-    return ["".join(d.split()[1].split('/', 2)[2:]) for d in tags_refs.splitlines()]
 
 def expand_tag_strings(repo, name_pattern, msg_subj_pattern, msg_body_pattern,
-                       url, keywords):
+                       keywords):
     """Generate tag name and message, with support for running id number"""
     keyws = keywords.copy()
     # Tag number is handled specially: if not defined, we autoincrement it
@@ -143,7 +116,7 @@ def expand_tag_strings(repo, name_pattern, msg_subj_pattern, msg_body_pattern,
         tag_re = tag_re.format(tag_number='(?P<tag_number>[0-9]{1,5})')
 
         keyws['tag_number'] = 0
-        for existing_tag in get_tags(repo, url=url):
+        for existing_tag in repo.run_cmd('tag').splitlines():
             match = re.match(tag_re, existing_tag)
 
             if match and int(match.group('tag_number')) >= keyws['tag_number']:
@@ -170,8 +143,7 @@ def gitarchive(data_dir, git_dir, no_create, bare, commit_msg_subject, commit_ms
     if not no_tag and tagname:
         tag_name, tag_msg = expand_tag_strings(data_repo, tagname,
                                                tag_msg_subject,
-                                               tag_msg_body,
-                                               push, keywords)
+                                               tag_msg_body, keywords)
 
     # Commit data
     commit = git_commit_data(data_repo, data_dir, branch_name,
@@ -209,7 +181,7 @@ def get_test_runs(log, repo, tag_name, **kwargs):
 
     # Get a list of all matching tags
     tag_pattern = tag_name.format(**str_fields)
-    tags = get_tags(repo, pattern=tag_pattern)
+    tags = repo.run_cmd(['tag', '-l', tag_pattern]).splitlines()
     log.debug("Found %d tags matching pattern '%s'", len(tags), tag_pattern)
 
     # Parse undefined fields from tag names