From 59015d4d05c15e4aa59df93d2bba25a8fc4a1526 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 17 Sep 2024 12:56:34 -0600 Subject: [PATCH 1/5] fix issues with sparse config --- git_fleximod/submodule.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/git_fleximod/submodule.py b/git_fleximod/submodule.py index 30a53f00f..c939d54bc 100644 --- a/git_fleximod/submodule.py +++ b/git_fleximod/submodule.py @@ -186,7 +186,7 @@ def _add_remote(self, git): return newremote else: i = 0 - while "newremote" in remotes: + while newremote in remotes: i = i + 1 newremote = f"newremote.{i:02d}" else: @@ -303,9 +303,9 @@ def sparse_checkout(self): print(f"Error checking out {self.name:>20} at {self.fxtag}") else: print(f"Successfully checked out {self.name:>20} at {self.fxtag}") - rgit.config_set_value(f'submodule "{self.name}"', "active", "true") - rgit.config_set_value(f'submodule "{self.name}"', "url", self.url) - rgit.config_set_value(f'submodule "{self.name}"', "path", self.path) + rgit.config_set_value('submodule.' + self.name, "active", "true") + rgit.config_set_value('submodule.' + self.name, "url", self.url) + rgit.config_set_value('submodule.' + self.name, "path", self.path) def update(self): """ From 024d2e4af822ed14ae46327223a63c3f10f50b08 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 17 Sep 2024 13:27:26 -0600 Subject: [PATCH 2/5] try updating poetry --- .github/workflows/pytest.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 0868dd9a3..7d89a8912 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -18,7 +18,7 @@ jobs: # reference the matrixe python version here. - uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.12' # Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow # from installing Poetry every time, which can be slow. Note the use of the Poetry version @@ -29,7 +29,7 @@ jobs: uses: actions/cache@v4 with: path: ~/.local - key: poetry-1.7.1 + key: poetry-1.8.2 # Install Poetry. You could do this manually, or there are several actions that do this. # `snok/install-poetry` seems to be minimal yet complete, and really just calls out to @@ -42,7 +42,7 @@ jobs: # cache it. - uses: snok/install-poetry@v1 with: - version: 1.7.1 + version: 1.8.2 virtualenvs-create: true virtualenvs-in-project: true From d485f0abbe944e357f11825bfd27dbefc13d0a6f Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 17 Sep 2024 13:30:34 -0600 Subject: [PATCH 3/5] add tmate for debugging --- .github/workflows/pytest.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 7d89a8912..6cb8102b9 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -74,4 +74,7 @@ jobs: git config --global user.name "${GITHUB_ACTOR}" git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" poetry run pytest + - name: Setup tmate session + if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3 From ee5decab4e9d50260f3b378ec6cb3b6156e63ccb Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 17 Sep 2024 16:03:33 -0600 Subject: [PATCH 4/5] avoid spurious warnings --- git_fleximod/utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/git_fleximod/utils.py b/git_fleximod/utils.py index eef15113a..c4f43d523 100644 --- a/git_fleximod/utils.py +++ b/git_fleximod/utils.py @@ -312,10 +312,7 @@ def execute_subprocess(commands, status_to_caller=False, output_to_caller=False) "returned status {0}".format(error.returncode) ) msg = failed_command_msg(msg_context, commands, output=error.output) - if return_to_caller: - logging.warning(error) - logging.warning(msg) - else: + if not return_to_caller: logging.error(error) logging.error(msg) log_process_output(error.output) From e850ebeed7b96768f484902afcc670549a1f127b Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 17 Sep 2024 16:28:05 -0600 Subject: [PATCH 5/5] fix one get another --- git_fleximod/gitinterface.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git_fleximod/gitinterface.py b/git_fleximod/gitinterface.py index f0dc19090..fb20883cd 100644 --- a/git_fleximod/gitinterface.py +++ b/git_fleximod/gitinterface.py @@ -82,6 +82,8 @@ def config_get_value(self, section, name): def config_set_value(self, section, name, value): if self._use_module: with self.repo.config_writer() as writer: + if "." in section: + section = section.replace("."," \"")+'"' writer.set_value(section, name, value) writer.release() # Ensure changes are saved else: