Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Preserve installed Git hooks during patch assembly

pulse-triage[bot]32dc4b20c46e
diff --git a/scripts/release_control/stable_patch.py b/scripts/release_control/stable_patch.py
index 5a20796c81..722fadaece 100644
--- a/scripts/release_control/stable_patch.py
+++ b/scripts/release_control/stable_patch.py
@@ -23,7 +23,7 @@ SCHEMA = 1
def git(root: Path, *args: str, check: bool = True) -> subprocess.CompletedProcess:
- return subprocess.run(["git", "-c", "core.hooksPath=/dev/null", "-c", "user.name=Pulse release",
+ return subprocess.run(["git", "-c", "user.name=Pulse release",
"-c", "user.email=release@invalid", "-C", str(root), *args],
text=True, capture_output=True, check=check)
diff --git a/scripts/release_control/stable_patch_test.py b/scripts/release_control/stable_patch_test.py
index 489e270120..92da470489 100644
--- a/scripts/release_control/stable_patch_test.py
+++ b/scripts/release_control/stable_patch_test.py
@@ -5,6 +5,7 @@ from pathlib import Path
import subprocess
import tempfile
import unittest
+from unittest import mock
import stable_patch as patch
@@ -151,6 +152,12 @@ class StablePatchTest(unittest.TestCase):
self.assertIn('python3 scripts/release_control/stable_patch_test.py',
(repo / '.github/workflows/canonical-governance.yml').read_text())
+ def test_assembly_does_not_disable_installed_git_hooks(self):
+ with mock.patch.object(patch.subprocess, 'run') as run:
+ patch.git(self.root, 'commit', '-m', 'fixture')
+ argv = run.call_args.args[0]
+ self.assertFalse(any('hooksPath' in value for value in argv))
+
def test_dirty_checkout_is_not_discarded(self):
self.write('untracked', 'do not discard')
with self.assertRaisesRegex(ValueError, 'clean disposable'):