feat(import): complete OpenAPI onboarding and verify delivery
CI / Rust Checks (pull_request) Failing after 1s
CI / UI Checks (pull_request) Skipped
CI / Frontend E2E (pull_request) Skipped
CI / Community Image Smoke (pull_request) Skipped
CI / Deploy (pull_request) Skipped

This commit is contained in:
bsodfather committed 2026-10-09 17:50:38 +03:00
1 parent bb3e376767
commit e93de7015a
244 files changed
+57020 -5139

No files matched your search

+36 -3
View File
@@ -153,15 +153,40 @@ validate_backup_migration() {
return 1
fi
shadow_target_file="$(mktemp)"
if ! timeout 2m docker run --rm \
"$admin_image" crank-migrate plan --target-version > "$shadow_target_file"; then
rm -f "$shadow_target_file"
echo "Migration plan target version could not be read" >&2
return 1
fi
if ! IFS= read -r shadow_target_version < "$shadow_target_file" \
|| ! printf '%s\n' "$shadow_target_version" | cmp -s - "$shadow_target_file"; then
rm -f "$shadow_target_file"
echo "Migration plan returned an invalid target version" >&2
return 1
fi
rm -f "$shadow_target_file"
case "$shadow_target_version" in
''|0*|*[!0-9]*)
echo "Migration plan returned an invalid target version" >&2
return 1
;;
esac
shadow_id="crank-migration-check-$$"
shadow_network="${shadow_id}-network"
shadow_postgres="${shadow_id}-postgres"
shadow_password="crank-shadow-migration-password"
shadow_admin="crank_shadow_admin"
shadow_user="crank_shadow_owner"
shadow_preflight_file=""
shadow_cleanup() {
docker rm -fv "$shadow_postgres" >/dev/null 2>&1 || true
docker network rm "$shadow_network" >/dev/null 2>&1 || true
if [ -n "$shadow_preflight_file" ]; then
rm -f "$shadow_preflight_file"
fi
}
trap shadow_cleanup EXIT
trap 'exit 130' HUP INT TERM
@@ -206,10 +231,18 @@ validate_backup_migration() {
timeout 10m docker run --rm --network "$shadow_network" \
-e CRANK_DATABASE_URL="$shadow_database_url" \
"$admin_image" crank-migrate apply
shadow_preflight="$(timeout 2m docker run --rm --network "$shadow_network" \
shadow_preflight_file="$(mktemp)"
if ! timeout 2m docker run --rm --network "$shadow_network" \
-e CRANK_DATABASE_URL="$shadow_database_url" \
"$admin_image" crank-migrate preflight)"
printf '%s\n' "$shadow_preflight" | grep -Fxq '{"status":"current","version":13}'
"$admin_image" crank-migrate preflight > "$shadow_preflight_file"; then
echo "Shadow migration preflight command failed" >&2
return 1
fi
if ! printf '%s\n' "{\"status\":\"current\",\"version\":${shadow_target_version}}" \
| cmp -s - "$shadow_preflight_file"; then
echo "Shadow migration preflight did not confirm the target schema" >&2
return 1
fi
shadow_cleanup
trap - EXIT HUP INT TERM