fix(deploy): ignore parent Git checkout in backup binding
Managed validation / Managed repository validation (pull_request) Successful in 2m16s
GeoIntel release gates / Compile, test, contracts and builds (pull_request) Successful in 2m7s
GeoIntel release gates / Python and npm vulnerability policy (pull_request) Successful in 26s
GeoIntel release gates / Production AI image, SBOM and container scan (pull_request) Successful in 7m43s
GeoIntel release gates / Deploy exact gated revision to Unraid (pull_request) Skipped
Managed validation / Managed repository validation (pull_request) Successful in 2m16s
GeoIntel release gates / Compile, test, contracts and builds (pull_request) Successful in 2m7s
GeoIntel release gates / Python and npm vulnerability policy (pull_request) Successful in 26s
GeoIntel release gates / Production AI image, SBOM and container scan (pull_request) Successful in 7m43s
GeoIntel release gates / Deploy exact gated revision to Unraid (pull_request) Skipped
This commit is contained in:
@@ -45,6 +45,8 @@ def test_backup_binds_prepared_source_without_requiring_dot_git() -> None:
|
||||
optional_git_fallback = script.index('if command -v git >/dev/null 2>&1')
|
||||
docker_access = script.index("docker inspect -f '{{.State.Running}}'")
|
||||
assert controller_resolution < optional_git_fallback < docker_access
|
||||
assert 'git -C "$ROOT" rev-parse --show-toplevel' in script
|
||||
assert '"$(cd "$git_top" && pwd -P)" = "$(cd "$ROOT" && pwd -P)"' in script
|
||||
assert 'SOURCE_REVISION="$explicit_sha"' in script
|
||||
assert '"backup_tool_revision": ${SOURCE_REVISION@Q}' in script
|
||||
assert '"running_image_revision": ${RUNNING_IMAGE_REVISION@Q}' in script
|
||||
|
||||
@@ -70,7 +70,7 @@ done
|
||||
resolve_source_revision() {
|
||||
local controller_sha="" explicit_sha="${GEOINTEL_BUILD_SHA:-}"
|
||||
local gitea_sha="${GITEA_COMMIT_SHA:-}" github_sha="${GITHUB_SHA:-}"
|
||||
local git_head="" git_dirty="false" source=""
|
||||
local git_head="" git_top="" git_dirty="false" source=""
|
||||
|
||||
if [ -n "$gitea_sha" ]; then
|
||||
if ! [[ "$gitea_sha" =~ ^[0-9A-Fa-f]{40}$ ]]; then
|
||||
@@ -115,6 +115,9 @@ resolve_source_revision() {
|
||||
fi
|
||||
|
||||
if command -v git >/dev/null 2>&1 && git -C "$ROOT" rev-parse --git-dir >/dev/null 2>&1; then
|
||||
git_top="$(git -C "$ROOT" rev-parse --show-toplevel 2>/dev/null || true)"
|
||||
fi
|
||||
if [ -n "$git_top" ] && [ "$(cd "$git_top" && pwd -P)" = "$(cd "$ROOT" && pwd -P)" ]; then
|
||||
git_head="$(git -C "$ROOT" rev-parse HEAD 2>/dev/null || true)"
|
||||
git_head="${git_head,,}"
|
||||
if ! [[ "$git_head" =~ ^[0-9a-f]{40}$ ]]; then
|
||||
|
||||
Reference in New Issue
Block a user