Skip to content

Commit 4e45010

Browse files
committed
ci(release): fail fast on red release children
(cherry picked from commit 8d70387)
1 parent afdf9aa commit 4e45010

7 files changed

Lines changed: 144 additions & 27 deletions

File tree

‎.agents/skills/release-openclaw-ci/SKILL.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ Use this with `$release-openclaw-maintainer` and `$openclaw-testing` when a rele
1616
- Watch one parent run plus compact child summaries. Avoid broad `gh run view` polling loops; REST quota is easy to burn.
1717
- Fetch logs only for failed or currently-blocking jobs. If quota is low, stop polling and wait for reset.
1818
- Treat live-provider flakes separately from code failures: prove key validity, provider HTTP status, retry evidence, and exact failing lane before editing code.
19+
- Full Release Validation parent monitors fail fast: once a required child job
20+
fails, the parent cancels the remaining child matrix and prints the failed
21+
job summary. Inspect that first red job instead of waiting for unrelated
22+
matrix tails.
1923

2024
## Preflight
2125

@@ -73,6 +77,9 @@ gh workflow run full-release-validation.yml \
7377
```
7478

7579
Use `release_profile=stable` unless the operator explicitly asks for the broad advisory provider/media matrix. Use narrow `rerun_group` after focused fixes.
80+
Publish with `openclaw-release-publish.yml` using `release_profile=from-validation`
81+
unless a maintainer intentionally wants to cross-check a specific profile; the
82+
publish workflow reads the effective profile from the full-validation manifest.
7683

7784
## Watch
7885

‎.agents/skills/release-openclaw-maintainer/SKILL.md‎

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,21 @@ Use this skill for release and publish-time workflow. Load `$release-private` if
4949
the next beta number until the matching npm package has actually published.
5050
If a published beta needs a fix, commit the fix on the release branch and
5151
increment to the next `-beta.N`.
52-
- For a beta release train, run the fast local preflight first, publish the
53-
beta to npm `beta`, then run the expensive published-package roster focused
54-
on install/update/Docker/Parallels/NPM Telegram. If anything fails, fix it on
55-
the release branch, commit/push/pull, increment beta number, and repeat. Run
56-
the full expensive roster at least once before stable/latest promotion; for
57-
later beta attempts, rerun only lanes whose evidence changed unless the fix
58-
touches broad release, install/update, plugin, Docker, Parallels, or live QA
59-
behavior. After each beta is published, scan current `main` once for critical
60-
fixes that landed after the release branch cut and backport only important
61-
low-risk fixes. Operators may authorize up to 4 autonomous beta attempts;
62-
after 4 failed beta attempts, stop and report.
52+
- For a beta release train, keep Full Release Validation as a pre-publish gate
53+
unless the operator explicitly waives it. Run the fast local preflight, npm
54+
preflight, full release validation, and performance in parallel where safe.
55+
If anything fails before npm publish, fix it on the release branch,
56+
forward-port the fix to `main`, move the unpublished beta tag/prerelease to
57+
the fixed commit, and rerun the affected pre-publish gates. If anything fails
58+
after npm publish, fix it, forward-port to `main`, increment beta number, and
59+
repeat. After each beta publish, run the published-package roster focused on
60+
install/update/Docker/Parallels/NPM Telegram. For later beta attempts, rerun
61+
only lanes whose evidence changed unless the fix touches broad release,
62+
install/update, plugin, Docker, Parallels, or live QA behavior. After each
63+
beta is live, scan current `main` once for critical fixes that landed after
64+
the release branch cut and backport only important low-risk fixes. Operators
65+
may authorize up to 4 autonomous beta attempts; after 4 failed beta attempts,
66+
stop and report.
6367
- As soon as the release candidate SHA exists, dispatch `OpenClaw Performance`
6468
with `target_ref=<release-sha>` in parallel with the other release work. Do
6569
not wait for full release validation to start the performance signal.
@@ -468,8 +472,10 @@ node --import tsx scripts/openclaw-npm-postpublish-verify.ts <published-version>
468472
- The npm workflow and the private mac publish workflow accept
469473
`preflight_only=true` to run validation/build/package steps without uploading
470474
public release assets.
471-
- Real npm publish requires a prior successful npm preflight run id so the
472-
publish job promotes the prepared tarball instead of rebuilding it.
475+
- Real npm publish requires a prior successful npm preflight run id and the
476+
successful Full Release Validation run id for the same tag/SHA so the publish
477+
job promotes the prepared tarball instead of rebuilding it and attaches the
478+
correct release evidence.
473479
- Real private mac publish requires a prior successful private mac preflight
474480
run id so the publish job promotes the prepared artifacts instead of
475481
rebuilding or renotarizing them again.
@@ -499,11 +505,12 @@ node --import tsx scripts/openclaw-npm-postpublish-verify.ts <published-version>
499505
instead of uploading public GitHub release assets.
500506
- Private smoke-test runs upload ad-hoc, non-notarized build artifacts as
501507
workflow artifacts and intentionally skip stable `appcast.xml` generation.
502-
- For stable releases, npm preflight, public mac validation, private mac
503-
validation, and private mac preflight must all pass before any real publish
504-
run starts. For beta releases, npm preflight plus the selected Docker,
505-
install/update, Parallels, and release-check lanes are sufficient unless mac
506-
beta validation was explicitly requested.
508+
- For stable releases, npm preflight, Full Release Validation, public mac
509+
validation, private mac validation, and private mac preflight must all pass
510+
before any real publish run starts. For beta releases, npm preflight and Full
511+
Release Validation must pass before npm publish unless the operator explicitly
512+
waives the full gate; mac beta validation is still only required when
513+
requested.
507514
- Real publish runs may be dispatched from `main` or from a
508515
`release/YYYY.M.D` branch. For release-branch runs, the tag must be contained
509516
in that release branch, and the real publish must reuse a successful preflight

‎.github/workflows/full-release-validation.yml‎

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,21 @@ jobs:
380380
gh_with_retry api --paginate "repos/${GITHUB_REPOSITORY}/actions/runs/${run_id}/jobs?per_page=100" --jq '.jobs[]'
381381
}
382382
383+
fail_fast_failed_jobs() {
384+
local failed_jobs_json
385+
failed_jobs_json="$(
386+
fetch_child_jobs |
387+
jq -s '[.[] | select(.status == "completed" and .conclusion != "success" and .conclusion != "skipped")]'
388+
)"
389+
if jq -e 'length > 0' <<< "$failed_jobs_json" >/dev/null; then
390+
echo "::error::${workflow} has failed child jobs before the workflow completed; cancelling the remaining matrix."
391+
jq '.[] | {name, conclusion, url: .html_url}' <<< "$failed_jobs_json"
392+
cancel_child
393+
trap - EXIT INT TERM
394+
exit 1
395+
fi
396+
}
397+
383398
cancel_child() {
384399
if [[ -n "${run_id:-}" ]]; then
385400
echo "Cancelling child workflow ${workflow}: ${run_id}" >&2
@@ -395,6 +410,9 @@ jobs:
395410
break
396411
fi
397412
poll_count=$((poll_count + 1))
413+
if (( poll_count % 2 == 0 )); then
414+
fail_fast_failed_jobs
415+
fi
398416
if (( poll_count % 10 == 0 )); then
399417
echo "Still waiting on ${workflow}: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${run_id}"
400418
fetch_child_jobs | jq 'select(.status != "completed") | {name, status, url: .html_url}' || true
@@ -510,6 +528,21 @@ jobs:
510528
gh_with_retry api --paginate "repos/${GITHUB_REPOSITORY}/actions/runs/${run_id}/jobs?per_page=100" --jq '.jobs[]'
511529
}
512530
531+
fail_fast_failed_jobs() {
532+
local failed_jobs_json
533+
failed_jobs_json="$(
534+
fetch_child_jobs |
535+
jq -s '[.[] | select(.status == "completed" and .conclusion != "success" and .conclusion != "skipped")]'
536+
)"
537+
if jq -e 'length > 0' <<< "$failed_jobs_json" >/dev/null; then
538+
echo "::error::${workflow} has failed child jobs before the workflow completed; cancelling the remaining matrix."
539+
jq '.[] | {name, conclusion, url: .html_url}' <<< "$failed_jobs_json"
540+
cancel_child
541+
trap - EXIT INT TERM
542+
exit 1
543+
fi
544+
}
545+
513546
cancel_child() {
514547
if [[ -n "${run_id:-}" ]]; then
515548
echo "Cancelling child workflow ${workflow}: ${run_id}" >&2
@@ -525,6 +558,9 @@ jobs:
525558
break
526559
fi
527560
poll_count=$((poll_count + 1))
561+
if (( poll_count % 2 == 0 )); then
562+
fail_fast_failed_jobs
563+
fi
528564
if (( poll_count % 10 == 0 )); then
529565
echo "Still waiting on ${workflow}: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${run_id}"
530566
fetch_child_jobs | jq 'select(.status != "completed") | {name, status, url: .html_url}' || true
@@ -690,6 +726,24 @@ jobs:
690726
[[ "$saw_advisory" == "1" && "$failed" == "0" ]]
691727
}
692728
729+
fail_fast_failed_jobs() {
730+
local failed_jobs_json
731+
if [[ "$workflow" == "openclaw-release-checks.yml" && "$CHILD_WORKFLOW_REF" =~ ^tideclaw/alpha/[0-9]{4}-[0-9]{2}-[0-9]{2}-[0-9]{4}Z$ ]]; then
732+
return 0
733+
fi
734+
failed_jobs_json="$(
735+
fetch_child_jobs |
736+
jq -s '[.[] | select(.status == "completed" and .conclusion != "success" and .conclusion != "skipped")]'
737+
)"
738+
if jq -e 'length > 0' <<< "$failed_jobs_json" >/dev/null; then
739+
echo "::error::${workflow} has failed child jobs before the workflow completed; cancelling the remaining matrix."
740+
jq '.[] | {name, conclusion, url: .html_url}' <<< "$failed_jobs_json"
741+
cancel_child
742+
trap - EXIT INT TERM
743+
exit 1
744+
fi
745+
}
746+
693747
cancel_child() {
694748
if [[ -n "${run_id:-}" ]]; then
695749
echo "Cancelling child workflow ${workflow}: ${run_id}" >&2
@@ -705,6 +759,9 @@ jobs:
705759
break
706760
fi
707761
poll_count=$((poll_count + 1))
762+
if (( poll_count % 2 == 0 )); then
763+
fail_fast_failed_jobs
764+
fi
708765
if (( poll_count % 10 == 0 )); then
709766
echo "Still waiting on ${workflow}: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${run_id}"
710767
fetch_child_jobs | jq 'select(.status != "completed") | {name, status, url: .html_url}' || true
@@ -962,13 +1019,31 @@ jobs:
9621019
}
9631020
trap cancel_child EXIT INT TERM
9641021
1022+
fail_fast_failed_jobs() {
1023+
local failed_jobs_json
1024+
failed_jobs_json="$(
1025+
gh_with_retry run view "$run_id" --json jobs \
1026+
--jq '[.jobs[] | select(.status == "completed" and .conclusion != "success" and .conclusion != "skipped")]'
1027+
)"
1028+
if jq -e 'length > 0' <<< "$failed_jobs_json" >/dev/null; then
1029+
echo "::error::npm-telegram-beta-e2e.yml has failed child jobs before the workflow completed; cancelling the remaining run."
1030+
jq '.[] | {name, conclusion, url}' <<< "$failed_jobs_json"
1031+
cancel_child
1032+
trap - EXIT INT TERM
1033+
exit 1
1034+
fi
1035+
}
1036+
9651037
poll_count=0
9661038
while true; do
9671039
status="$(gh_with_retry run view "$run_id" --json status --jq '.status')"
9681040
if [[ "$status" == "completed" ]]; then
9691041
break
9701042
fi
9711043
poll_count=$((poll_count + 1))
1044+
if (( poll_count % 2 == 0 )); then
1045+
fail_fast_failed_jobs
1046+
fi
9721047
if (( poll_count % 10 == 0 )); then
9731048
echo "Still waiting on npm-telegram-beta-e2e.yml: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${run_id}"
9741049
gh_with_retry run view "$run_id" --json jobs --jq '.jobs[] | select(.status != "completed") | {name, status, url}' || true

‎.github/workflows/openclaw-release-publish.yml‎

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ on:
4646
default: true
4747
type: boolean
4848
release_profile:
49-
description: Release coverage profile used for release evidence summaries
49+
description: Release coverage profile used for release evidence summaries; default reads it from the validation manifest
5050
required: false
51-
default: beta
51+
default: from-validation
5252
type: choice
5353
options:
54+
- from-validation
5455
- beta
5556
- stable
5657
- full
@@ -135,9 +136,9 @@ jobs:
135136
exit 1
136137
fi
137138
case "$RELEASE_PROFILE" in
138-
beta|stable|full) ;;
139+
from-validation|beta|stable|full) ;;
139140
*)
140-
echo "release_profile must be one of: beta, stable, full" >&2
141+
echo "release_profile must be one of: from-validation, beta, stable, full" >&2
141142
exit 1
142143
;;
143144
esac
@@ -259,6 +260,7 @@ jobs:
259260
echo "sha=$release_sha" >> "$GITHUB_OUTPUT"
260261
261262
- name: Validate full release validation manifest
263+
id: full_manifest
262264
if: ${{ inputs.publish_openclaw_npm }}
263265
env:
264266
GH_TOKEN: ${{ github.token }}
@@ -289,14 +291,15 @@ jobs:
289291
echo "Full release validation target SHA mismatch: expected $EXPECTED_SHA, got $target_sha" >&2
290292
exit 1
291293
fi
292-
if [[ "$release_profile" != "$EXPECTED_RELEASE_PROFILE" ]]; then
294+
if [[ "$EXPECTED_RELEASE_PROFILE" != "from-validation" && "$release_profile" != "$EXPECTED_RELEASE_PROFILE" ]]; then
293295
echo "Full release validation profile mismatch: expected $EXPECTED_RELEASE_PROFILE, got $release_profile" >&2
294296
exit 1
295297
fi
296298
if [[ "$rerun_group" != "all" ]]; then
297299
echo "Full release validation must run rerun_group=all before npm publish; got $rerun_group" >&2
298300
exit 1
299301
fi
302+
echo "release_profile=$release_profile" >> "$GITHUB_OUTPUT"
300303
301304
- name: Validate release tag is reachable from a trusted release branch
302305
env:
@@ -332,7 +335,7 @@ jobs:
332335
env:
333336
RELEASE_TAG: ${{ inputs.tag }}
334337
TARGET_SHA: ${{ steps.manifest.outputs.sha || steps.ref.outputs.sha }}
335-
RELEASE_PROFILE: ${{ inputs.release_profile }}
338+
RELEASE_PROFILE: ${{ steps.full_manifest.outputs.release_profile || inputs.release_profile }}
336339
FULL_RELEASE_VALIDATION_RUN_ID: ${{ inputs.full_release_validation_run_id }}
337340
run: |
338341
{
@@ -501,7 +504,7 @@ jobs:
501504
wait_for_run() {
502505
local workflow="$1"
503506
local run_id="$2"
504-
local status conclusion url updated_at created_at duration_seconds duration_label last_state
507+
local status conclusion url updated_at created_at duration_seconds duration_label last_state failed_json
505508
506509
last_state=""
507510
while true; do
@@ -510,6 +513,14 @@ jobs:
510513
if [[ "$status" == "completed" ]]; then
511514
break
512515
fi
516+
failed_json="$(gh run view --repo "$GITHUB_REPOSITORY" "$run_id" --json jobs \
517+
--jq '[.jobs[] | select(.status == "completed" and .conclusion != "success" and .conclusion != "skipped")]' || true)"
518+
if [[ -n "${failed_json}" ]] && jq -e 'length > 0' <<< "$failed_json" >/dev/null; then
519+
echo "${workflow} has failed jobs before the workflow completed: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${run_id}" >&2
520+
jq '.[] | {name, conclusion, url}' <<< "$failed_json" >&2 || true
521+
print_failed_run_summary "${run_id}"
522+
return 1
523+
fi
513524
url="$(printf '%s' "$run_json" | jq -r '.url')"
514525
updated_at="$(printf '%s' "$run_json" | jq -r '.updatedAt')"
515526
state="${status}:${updated_at}"

‎scripts/release-candidate-checklist.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ export function buildPublishCommand(options) {
477477
["npm_dist_tag", options.npmDistTag],
478478
["plugin_publish_scope", options.pluginPublishScope],
479479
["publish_openclaw_npm", "true"],
480-
["release_profile", options.releaseProfile],
480+
["release_profile", "from-validation"],
481481
["wait_for_clawhub", "false"],
482482
];
483483
if (options.npmTelegramRunId) {

‎test/scripts/package-acceptance-workflow.test.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ describe("package acceptance workflow", () => {
179179
expect(hydrateWindowsPnpm.run).toContain('"--filter",');
180180
expect(hydrateWindowsPnpm.run).toContain('"openclaw",');
181181
expect(hydrateWindowsPnpm.run).toContain(
182-
'New-Item -ItemType Junction -Path $workspaceNodeModules -Target $env:PNPM_CONFIG_MODULES_DIR',
182+
"New-Item -ItemType Junction -Path $workspaceNodeModules -Target $env:PNPM_CONFIG_MODULES_DIR",
183183
);
184184
expect(hydrateWindowsPnpm.run).toContain(".pnpm-workspace-state-v1.json");
185185
expect(hydrateWindowsPnpm.run).not.toContain("Remove-Item -Recurse -Force");
@@ -1464,6 +1464,16 @@ describe("package artifact reuse", () => {
14641464
expect(pluginNpmWorkflow).toContain("environment: npm-release");
14651465
expect(clawHubWorkflow).toContain("environment: clawhub-plugin-release");
14661466
expect(openclawNpmWorkflow).toContain("environment: npm-release");
1467+
expect(releaseWorkflow).toContain("default: from-validation");
1468+
expect(releaseWorkflow).toContain(
1469+
'if [[ "$EXPECTED_RELEASE_PROFILE" != "from-validation" && "$release_profile" != "$EXPECTED_RELEASE_PROFILE" ]]; then',
1470+
);
1471+
expect(releaseWorkflow).toContain(
1472+
'echo "release_profile=$release_profile" >> "$GITHUB_OUTPUT"',
1473+
);
1474+
expect(releaseWorkflow).toContain(
1475+
"has failed jobs before the workflow completed: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${run_id}",
1476+
);
14671477
expect(releaseWorkflow.lastIndexOf("create_or_update_github_release")).toBeLessThan(
14681478
releaseWorkflow.indexOf('if [[ -n "${clawhub_pid}" ]] && ! wait "${clawhub_pid}"'),
14691479
);

‎test/scripts/plugin-prerelease-test-plan.test.ts‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,13 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => {
561561
expect(fullReleaseWorkflow.jobs.release_checks["timeout-minutes"]).toBe(
562562
"${{ inputs.release_profile != 'minimum' && 240 || 60 }}",
563563
);
564+
const fullReleaseSource = readFileSync(".github/workflows/full-release-validation.yml", "utf8");
565+
expect(
566+
fullReleaseSource.match(/has failed child jobs before the workflow completed/gu)?.length,
567+
).toBeGreaterThanOrEqual(3);
568+
expect(fullReleaseSource).toContain(
569+
"npm-telegram-beta-e2e.yml has failed child jobs before the workflow completed; cancelling the remaining run.",
570+
);
564571
});
565572

566573
it("keeps runtime tool coverage blocking in release checks", () => {

0 commit comments

Comments
 (0)