From c18200c23ca285e1342193601bc0418db7364fda Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 28 Jun 2026 20:47:10 +0800 Subject: [PATCH] fix(runner): require non110 registration condition [skip ci] --- docs/LOGBOOK.md | 12 ++++++++++++ ops/runner/check-awoooi-non110-runner-readiness.sh | 3 ++- .../test_check_awoooi_non110_runner_readiness.py | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/LOGBOOK.md b/docs/LOGBOOK.md index 209e50584..1598bd37e 100644 --- a/docs/LOGBOOK.md +++ b/docs/LOGBOOK.md @@ -1,3 +1,15 @@ +## 2026-06-28 — 20:44 non-110 runner service registration condition verifier + +**完成內容**: +- `ops/runner/check-awoooi-non110-runner-readiness.sh` 的 service limit verifier 新增 `.runner` `ConditionPathExists` requirement,避免 service 缺 registration gate 時被誤判為 ready。 +- `ops/runner/test_check_awoooi_non110_runner_readiness.py` 補測 `registration_condition=1`,並確認 `.runner` 內容仍不被讀出。 + +**驗證結果**: +- `python3.11 -m pytest ops/runner/test_check_awoooi_non110_runner_readiness.py ops/runner/test_guard_gitea_runner_pressure.py -q`:`6 passed`。 +- 188 live verifier:`RUNNER_SERVICE_LIMITS ... registration_condition=1`;`AWOOOI_NON110_RUNNER_READY=0`,剩餘 blockers 仍為 registration missing、service inactive、no active runner。 + +**邊界**:未讀 `.runner` 內容、runner token、secret、raw session、SQLite、auth 或 `.env`;未啟動 runner service;未操作 Docker / K8s / DB;未使用 GitHub。 + ## 2026-06-28 — 20:36 Delivery Workbench CD runner queue 欄位投影 **完成內容**: diff --git a/ops/runner/check-awoooi-non110-runner-readiness.sh b/ops/runner/check-awoooi-non110-runner-readiness.sh index d8743b142..ebf7b70d3 100755 --- a/ops/runner/check-awoooi-non110-runner-readiness.sh +++ b/ops/runner/check-awoooi-non110-runner-readiness.sh @@ -308,7 +308,8 @@ unit_has_required_limits() { grep -Eq '^[[:space:]]*TasksMax=' <<<"$text" || return 1 grep -Eq '^[[:space:]]*NoNewPrivileges=true' <<<"$text" || return 1 grep -Eq '^[[:space:]]*Restart=' <<<"$text" || return 1 - printf 'RUNNER_SERVICE_LIMITS unit=%s cpu=1 memory=1 tasks=1 no_new_privileges=1 restart=1\n' "$unit" + grep -Eq '^[[:space:]]*ConditionPathExists=.*\.runner[[:space:]]*$' <<<"$text" || return 1 + printf 'RUNNER_SERVICE_LIMITS unit=%s cpu=1 memory=1 tasks=1 no_new_privileges=1 restart=1 registration_condition=1\n' "$unit" return 0 } diff --git a/ops/runner/test_check_awoooi_non110_runner_readiness.py b/ops/runner/test_check_awoooi_non110_runner_readiness.py index aa1cfa6dd..34a99629b 100644 --- a/ops/runner/test_check_awoooi_non110_runner_readiness.py +++ b/ops/runner/test_check_awoooi_non110_runner_readiness.py @@ -34,6 +34,9 @@ runner: def _write_unit(path: Path) -> None: path.write_text( """ +[Unit] +ConditionPathExists=/tmp/.runner + [Service] ExecStart=/tmp/act_runner daemon --config /tmp/config.yaml Restart=always @@ -168,5 +171,6 @@ def test_non110_readiness_accepts_registration_state_presence_without_reading_it assert "RUNNER_REGISTRATION" in result.stdout assert "present=1" in result.stdout assert "content_read=false" in result.stdout + assert "registration_condition=1" in result.stdout assert "secret-token-like-content" not in result.stdout assert "AWOOOI_NON110_RUNNER_READY=1" in result.stdout