From d5d028eee38d4107821c0d2cfdb0dd04b9ba5ca3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Tue, 25 Feb 2025 11:05:25 +0000 Subject: [PATCH] gitlab: use --refetch in check-patch/check-dco jobs MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When gitlab initializes the repo checkout for a CI job, it will have done a shallow clone with only partial history. Periodically the objects that are omitted cause trouble with the check-patch/check-dco jobs. This is exhibited as reporting strange errors being unable to fetch certain objects that are known to exist. Passing the --refetch flag to 'git fetch' causes it to not assume the local checkout has all common objects and thus re-fetch everything that is needed. This appears to solve the check-patch/check-dco job failures. Signed-off-by: Daniel P. Berrangé Acked-by: Michael S. Tsirkin Message-ID: <20250225110525.2209854-1-berrange@redhat.com> Signed-off-by: Thomas Huth --- .gitlab-ci.d/check-dco.py | 2 +- .gitlab-ci.d/check-patch.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.d/check-dco.py b/.gitlab-ci.d/check-dco.py index 70dec7d6ee..2fd56683dc 100755 --- a/.gitlab-ci.d/check-dco.py +++ b/.gitlab-ci.d/check-dco.py @@ -21,7 +21,7 @@ repourl = "https://gitlab.com/%s/%s.git" % (namespace, reponame) print(f"adding upstream git repo @ {repourl}") subprocess.check_call(["git", "remote", "add", "check-dco", repourl]) -subprocess.check_call(["git", "fetch", "check-dco", "master"]) +subprocess.check_call(["git", "fetch", "--refetch", "check-dco", "master"]) ancestor = subprocess.check_output(["git", "merge-base", "check-dco/master", "HEAD"], diff --git a/.gitlab-ci.d/check-patch.py b/.gitlab-ci.d/check-patch.py index 68c549a146..be13e6f77d 100755 --- a/.gitlab-ci.d/check-patch.py +++ b/.gitlab-ci.d/check-patch.py @@ -24,7 +24,7 @@ print(f"adding upstream git repo @ {repourl}") # base for the user's branch. We thus need to figure out a common # ancestor between the user's branch and current git master. subprocess.check_call(["git", "remote", "add", "check-patch", repourl]) -subprocess.check_call(["git", "fetch", "check-patch", "master"]) +subprocess.check_call(["git", "fetch", "--refetch", "check-patch", "master"]) ancestor = subprocess.check_output(["git", "merge-base", "check-patch/master", "HEAD"], -- 2.30.2