]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
run.util.find_git_parents: Drop refresh() 1903/head
authorZack Cerza <zack@redhat.com>
Wed, 29 Nov 2023 23:34:51 +0000 (16:34 -0700)
committerZack Cerza <zack@redhat.com>
Mon, 18 Dec 2023 19:45:32 +0000 (12:45 -0700)
This takes a long time, and can time out. The mirror is updated every ten
minutes automatically.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/suite/test/test_util.py
teuthology/suite/util.py

index 042cdd1235e38c6fdd084ddd8a103901fd253ff6..fa31abcd442fdd4fcb83a871ee7f46fa8afb57b7 100644 (file)
@@ -149,12 +149,11 @@ Branch 'no-branch' not found in repo: https://github.com/ceph/ceph-ci.git!"
 
     @patch('teuthology.suite.util.requests.get')
     def test_find_git_parents(self, m_requests_get):
-        refresh_resp = Mock(ok=True)
         history_resp = Mock(ok=True)
         history_resp.json.return_value = {'sha1s': ['sha1', 'sha1_p']}
-        m_requests_get.side_effect = [refresh_resp, history_resp]
+        m_requests_get.return_value = history_resp
         parent_sha1s = util.find_git_parents('ceph', 'sha1')
-        assert len(m_requests_get.mock_calls) == 2
+        assert m_requests_get.call_count == 1
         assert parent_sha1s == ['sha1_p']
 
 
index a4f0efa60624e907f656224b9aab25af276ca418..7e1ae35ccc2699503f357884e4461e2335ac31f4 100644 (file)
@@ -347,13 +347,6 @@ def find_git_parents(project: str, sha1: str, count=1):
         log.warning('githelper_base_url not set, --newest disabled')
         return []
 
-    def refresh(project):
-        url = '%s/%s.git/refresh/' % (base_url, project)
-        resp = requests.get(url)
-        if not resp.ok:
-            log.error('git refresh failed for %s: %s',
-                      project, resp.content.decode())
-
     def get_sha1s(project, committish, count):
         url = '/'.join((base_url, '%s.git' % project,
                        'history/?committish=%s&count=%d' % (committish, count)))
@@ -366,7 +359,6 @@ def find_git_parents(project: str, sha1: str, count=1):
                        int(count), sha1, project, resp.json()['error'])
         return sha1s
 
-    refresh(project)
     # index 0 will be the commit whose parents we want to find.
     # So we will query for count+1, and strip index 0 from the result.
     sha1s = get_sha1s(project, sha1, count + 1)