fix(ci): allow empty success diagnostics (#105569)

* fix(ci): allow empty success diagnostics

* docs(agents): guard non-main PR landing
This commit is contained in:
Peter Steinberger
2026-07-12 18:57:42 +01:00
committed by GitHub
parent 619a68e97e
commit 1634d849c7
3 changed files with 14 additions and 2 deletions
@@ -2238,6 +2238,7 @@ jobs:
env:
OUTPUT_DIR: ${{ steps.run_lane.outputs.output_dir }}
RUNTIME_ROOT: ${{ steps.create_sut.outputs.runtime_root }}
RUN_LANE_OUTCOME: ${{ steps.run_lane.outcome }}
shell: bash
run: |
set -euo pipefail
@@ -2391,7 +2392,10 @@ jobs:
mapfile -t gateway_logs < <(
sudo find "$RUNTIME_ROOT/tmp" -xdev -type f -name 'openclaw-*.log' -print | sort
)
((${#gateway_logs[@]} > 0 && ${#gateway_logs[@]} <= 8))
((${#gateway_logs[@]} <= 8))
if [[ "$RUN_LANE_OUTCOME" != "success" ]]; then
((${#gateway_logs[@]} > 0))
fi
for index in "${!gateway_logs[@]}"; do
log_path="$(sudo realpath -e "${gateway_logs[$index]}")"
case "$log_path" in
@@ -2407,7 +2411,10 @@ jobs:
find "$diagnostics_dir" -maxdepth 1 -type f -name 'gateway-model-config-*.json' -print |
sort
)
((${#model_config_proofs[@]} > 0 && ${#model_config_proofs[@]} <= 8))
((${#model_config_proofs[@]} <= 8))
if [[ "$RUN_LANE_OUTCOME" != "success" ]]; then
((${#model_config_proofs[@]} > 0))
fi
for proof_path in "${model_config_proofs[@]}"; do
[[ "$(stat -c '%F:%a' "$proof_path")" == "regular file:600" ]]
proof_bytes="$(stat -c '%s' "$proof_path")"
+1
View File
@@ -214,6 +214,7 @@ Skills own workflows; root owns hard policy and routing.
- CI polling: exact SHA, relevant checks only, minimal fields. Skip routine noise (`Auto response`, `Labeler`, docs agents, performance/stale). Logs only after failure/completion or concrete need.
- Trusted-workflow release-branch CI: pass `target_ref` + `release_candidate_ref`; never `release_gate` (requires workflow head == target).
- Agent PR landing to `main`: use only the repo-native `scripts/pr` wrapper: run `scripts/pr review-init <PR>`, follow its emitted checkout/guard guidance, initialize and complete review artifacts with `scripts/pr review-artifacts-init <PR>`, validate them with `scripts/pr review-validate-artifacts <PR>`, then run `OPENCLAW_TESTBOX=1 scripts/pr prepare-run <PR>` and `scripts/pr merge-run <PR>`. The Testbox flag is mandatory for agents so prepare verifies hosted CI/Testbox on the current head or reuses a patch-identical pre-rebase run green within 24 hours instead of running full gates locally. `prepare-run` fails fast; invoke only after exact-head CI is complete and green. For owner-approved reviewed fork code without hosted Testbox, use `OPENCLAW_PR_GATES_REMOTE=testbox` instead. Do not rebase only because `main` advanced; merge drift is advisory unless strict drift is explicitly enabled, while GitHub still blocks conflicts. Do not idle on `auto-response` or `check-docs`.
- Non-main PRs: do not run `scripts/pr prepare-run` or `merge-run`; they diff against `main`. Use review artifacts, exact base-head CI, revalidate `headRefOid`, then `gh pr merge --match-head-commit <verified-sha>`.
- After `scripts/pr merge-run` removes its worktree, `cd` to a persistent repo before follow-up commands.
- `scripts/pr` review JSON: land-ready recommendation `READY FOR /prepare-pr`, `issueValidation.status=valid`; never `APPROVE`.
@@ -565,6 +565,10 @@ describe("release Telegram QA workflow", () => {
expect(captureStep?.if).toContain("steps.terminate_sut.outputs.quiescent == 'true'");
expect(captureStep?.env?.OUTPUT_DIR).toBe("${{ steps.run_lane.outputs.output_dir }}");
expect(captureStep?.env?.RUNTIME_ROOT).toBe("${{ steps.create_sut.outputs.runtime_root }}");
expect(captureStep?.env?.RUN_LANE_OUTCOME).toBe("${{ steps.run_lane.outcome }}");
expect(captureStep?.run).toContain('[[ "$RUN_LANE_OUTCOME" != "success" ]]');
expect(captureStep?.run).toContain("((${#gateway_logs[@]} > 0))");
expect(captureStep?.run).toContain("((${#model_config_proofs[@]} > 0))");
expect(captureStep?.run).toContain("-name 'openclaw-*.log'");
expect(captureStep?.run).toContain(
'trusted_temp_root="$(mktemp -d "${RUNNER_TEMP}/openclaw-telegram-diagnostics.XXXXXX")"',