From 256444c319ea44755d73344e86323d52dfab9e0a Mon Sep 17 00:00:00 2001 From: Daniel Juarez Date: Tue, 18 Nov 2025 15:14:37 +0100 Subject: [PATCH 1/3] Fix git fetch leaving lock files behind with GitCmdObjectDB You may face that the repo object leaves lock files behind after fetch, so we need to clean them up with a forced object delete Ref: https://github.com/gitpython-developers/GitPython/issues/718#issuecomment-360267779 We suspect this is due to git cat-file calls in fetch implementation together with using GitCmdObjectDB as the object database Ref: https://gitpython.readthedocs.io/en/stable/tutorial.html#gitcmdobjectdb Using GitDB seems to fix the issue but we keep using GitCmdObjectDB for consistency --- jens/git_wrapper.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jens/git_wrapper.py b/jens/git_wrapper.py index 833e04d..8b248e1 100644 --- a/jens/git_wrapper.py +++ b/jens/git_wrapper.py @@ -61,6 +61,14 @@ def fetch(repository_path, prune=False): def fetch_exec(*args, **kwargs): repo = git.Repo(repository_path, odbt=git.GitCmdObjectDB) repo.remotes.origin.fetch(*args, **kwargs) + # You may face that the repo object leaves lock files behind after fetch, so we need to + # clean them up with a forced object delete + # Ref: https://github.com/gitpython-developers/GitPython/issues/718#issuecomment-360267779 + # We suspect this is due to git cat-file calls in fetch implementation together with + # using GitCmdObjectDB as the object database + # Ref: https://gitpython.readthedocs.io/en/stable/tutorial.html#gitcmdobjectdb + # Using GitDB seems to fix the issue but we keep using GitCmdObjectDB for consistency + repo.__del__() fetch_exec(name='fetch', args=args, kwargs=kwargs) From 596756934de9529fb287ada0a2eacb67c4646ee8 Mon Sep 17 00:00:00 2001 From: Daniel Juarez Date: Tue, 18 Nov 2025 15:32:30 +0100 Subject: [PATCH 2/3] No more Python 3.7 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7412360..99c586b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.8, 3.9] os: [ubuntu-latest] include: - python-version: 3.6 From 4ee2a727dee8690610cb28f82b9300c12284093f Mon Sep 17 00:00:00 2001 From: Daniel Juarez Date: Tue, 18 Nov 2025 15:39:39 +0100 Subject: [PATCH 3/3] Prepare release 1.4.1-3 --- .github/workflows/build.yml | 3 --- puppet-jens.spec | 5 ++++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99c586b..4c836b3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,9 +10,6 @@ jobs: matrix: python-version: [3.8, 3.9] os: [ubuntu-latest] - include: - - python-version: 3.6 - os: ubuntu-20.04 steps: - uses: actions/checkout@v2 diff --git a/puppet-jens.spec b/puppet-jens.spec index 1029265..4ff3c6c 100644 --- a/puppet-jens.spec +++ b/puppet-jens.spec @@ -1,7 +1,7 @@ Summary: Jens is a Puppet modules/hostgroups librarian Name: puppet-jens Version: 1.4.1 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv3 Group: Applications/System @@ -82,6 +82,9 @@ export GIT_COMMITTER_NAME="RPM build" %{_unitdir}/jens-purge-queue.service %changelog +* Tue Nov 18 2025 Daniel Juarez - 1.4.1-3 +- Fix race condition leaving lock files behind after git fetch operations. + * Wed Jun 28 2023 Nacho Barrientos - 1.4.1-2 - Rebuild for RHEL9.