Fix Space pin waiter indent so distribute can find the run

This commit is contained in:
Victor Kuznetsov committed 2026-09-11 11:01:04 -07:00
1 parent df94f2c908
commit 927429d349
2 files changed
+7 -11

No files matched your search

+2 -11
View File
@@ -142,17 +142,8 @@ jobs:
--event workflow_dispatch \
--limit 10 \
--json databaseId,createdAt \
| python3 -c '
import json
import sys
dispatched_at = sys.argv[1]
runs = json.load(sys.stdin)
print(next(
(run["databaseId"] for run in runs if run["createdAt"] >= dispatched_at),
"",
))
' "$dispatched_at"
| python3 -c "import json,sys; t=sys.argv[1]; print(next((r['databaseId'] for r in json.load(sys.stdin) if r['createdAt']>=t), ''))" \
"$dispatched_at"
)
if [ -n "$run_id" ]; then
break
+5
View File
@@ -175,6 +175,11 @@ def test_space_pin_is_dispatched_before_the_factory_rebuild() -> None:
assert "pin-library.yml" in script
assert "RAIW_HF_SPACE_TOKEN secret is not set" in script
assert "restart_space" in script
# Nested YAML indent inside python -c crashed 0.40.1's waiter with
# IndentationError before it could see the dispatched pin run.
waiter = re.search(r"python3 -c \"(.*?)\"", script)
assert waiter is not None
assert waiter.group(1).lstrip() == waiter.group(1)
@pytest.mark.skipif(os.name != "posix" or shutil.which("bash") is None, reason="Executes an Ubuntu Bash workflow")