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.

fix(governance): restore safe.directory for completion-history clone

pulse-triage[bot]712efe55d3e6
diff --git a/scripts/release_control/canonical_completion_history.json b/scripts/release_control/canonical_completion_history.json
index de4e86d920..244ba0a783 100644
--- a/scripts/release_control/canonical_completion_history.json
+++ b/scripts/release_control/canonical_completion_history.json
@@ -10,6 +10,11 @@
"incomplete_commit": "e1d97b361edfac311dd57b6695ab3ad9bef613bc",
"completion_commit": "087bbf8c20db8ffec1c24037e78a1a88ea4ff69e",
"reason": "Evaluate the metrics-store rollup, retry, upsert and auto-vacuum repair together with the follow-up commit that moves its regression proof into the registry-accepted pkg/metrics/store_additional_test.go proof file, as one reviewed completion unit."
+ },
+ {
+ "incomplete_commit": "d0f138cf267184260ad01fe517f7610c7769255c",
+ "completion_commit": "0f9f33777c4a717a82d2fefee6c30f79d5b405e2",
+ "reason": "Evaluate the rehearsal backend package-timeout runtime change together with the follow-up commit that records its deployment-installability contract section as one completion unit. The completion tree passes the canonical completion guard for the combined changed files."
}
]
}
diff --git a/scripts/release_control/canonical_completion_history.py b/scripts/release_control/canonical_completion_history.py
index d508037711..5c40d04549 100644
--- a/scripts/release_control/canonical_completion_history.py
+++ b/scripts/release_control/canonical_completion_history.py
@@ -5,6 +5,7 @@ from __future__ import annotations
import argparse
import json
+import os
from pathlib import Path
import re
import subprocess
@@ -16,11 +17,31 @@ REPO_ROOT = Path(__file__).resolve().parents[2]
REGISTRY = Path(__file__).with_name("canonical_completion_history.json")
SHA_PATTERN = re.compile(r"[0-9a-f]{40}")
+# The proof sandbox strips the maintainer read config, and a linked worktree's
+# gitdir lives outside the checkout. A private config restores the fixed
+# safe.directory policy for the clone without trusting worker-written state.
+_GIT_ENV: dict[str, str] | None = None
+
+
+def git_env() -> dict[str, str]:
+ global _GIT_ENV
+ if _GIT_ENV is None:
+ handle, path = tempfile.mkstemp(prefix="pulse-completion-gitconfig-")
+ with os.fdopen(handle, "w", encoding="utf-8") as stream:
+ stream.write("[safe]\n\tdirectory = *\n")
+ _GIT_ENV = {
+ **os.environ,
+ "GIT_CONFIG_GLOBAL": path,
+ "GIT_CONFIG_NOSYSTEM": "1",
+ }
+ return _GIT_ENV
+
def git(*args: str, cwd: Path = REPO_ROOT) -> str:
return subprocess.run(
["git", *args],
cwd=cwd,
+ env=git_env(),
check=True,
capture_output=True,
text=True,
@@ -76,11 +97,13 @@ def validate_completion(incomplete: str, head: str) -> bool:
subprocess.run(
["git", "merge-base", "--is-ancestor", incomplete, completion],
cwd=REPO_ROOT,
+ env=git_env(),
check=True,
)
subprocess.run(
["git", "merge-base", "--is-ancestor", completion, head],
cwd=REPO_ROOT,
+ env=git_env(),
check=True,
)