Skip to content

Commit 59e9765

Browse files
authored
fix(ci): accept extended-stable patch successors (#126936)
* fix(ci): accept extended-stable patch successors * fix(ci): align Telegram extended-stable successors
1 parent 45db176 commit 59e9765

4 files changed

Lines changed: 51 additions & 6 deletions

File tree

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ jobs:
223223
context_ref="${context_ref#refs/heads/}"
224224
context_ref="${context_ref#refs/tags/}"
225225
target_version="$(jq -er '.version | select(type == "string")' target/package.json)"
226+
extended_stable_line=""
226227
release_version_pattern=""
227228
expected_version=""
228229
identity_kind=""
@@ -236,7 +237,7 @@ jobs:
236237
exit 1
237238
fi
238239
elif [[ "$context_ref" =~ ^extended-stable/([0-9]{4}\.([1-9]|1[0-2])\.33)$ ]]; then
239-
expected_version="${BASH_REMATCH[1]}"
240+
extended_stable_line="${BASH_REMATCH[1]%.33}"
240241
identity_kind="extended-stable branch"
241242
elif [[ "$context_ref" =~ ^v([0-9]{4}\.([1-9]|1[0-2])\.[1-9][0-9]*(-(alpha|beta)\.[1-9][0-9]*)?)$ ]]; then
242243
expected_version="${BASH_REMATCH[1]}"
@@ -245,7 +246,14 @@ jobs:
245246
echo "target_context_ref must be a canonical OpenClaw release branch or tag." >&2
246247
exit 1
247248
fi
248-
if [[ -n "$expected_version" &&
249+
if [[ "$identity_kind" == "extended-stable branch" ]]; then
250+
if [[ ! "$target_version" =~ ^([0-9]{4}\.([1-9]|1[0-2]))\.([1-9][0-9]*)$ ]] ||
251+
[[ "${BASH_REMATCH[1]}" != "$extended_stable_line" ]] ||
252+
(( 10#${BASH_REMATCH[3]} < 33 )); then
253+
echo "Target package version ${target_version} does not belong to extended-stable branch ${context_ref}; expected a final ${extended_stable_line}.PATCH version with PATCH >= 33." >&2
254+
exit 1
255+
fi
256+
elif [[ -n "$expected_version" &&
249257
"$identity_kind" != "release branch" &&
250258
"$target_version" != "$expected_version" ]]; then
251259
echo "Target package version ${target_version} does not match ${identity_kind} ${context_ref}; expected ${expected_version}." >&2

‎scripts/release-telegram-provenance.sh‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ if [[ "$normalized_context_ref" =~ ^release/([0-9]{4}\.[0-9]+\.[0-9]+)$ ]]; then
6363
echo "Telegram candidate version ${candidate_version} does not belong to release ${release_version}." >&2
6464
exit 1
6565
fi
66-
elif [[ "$normalized_context_ref" =~ ^extended-stable/([0-9]{4}\.[0-9]+\.33)$ ]]; then
66+
elif [[ "$normalized_context_ref" =~ ^extended-stable/([0-9]{4}\.([1-9]|1[0-2])\.33)$ ]]; then
6767
context_version="${BASH_REMATCH[1]}"
68+
context_line="${context_version%.33}"
6869
candidate_version="$(jq -er '.version' "${candidate_root}/package.json")"
69-
if [[ "$candidate_version" != "$context_version" ]]; then
70-
echo "Telegram candidate version ${candidate_version} does not match context ${normalized_context_ref}." >&2
70+
if [[ ! "$candidate_version" =~ ^([0-9]{4}\.([1-9]|1[0-2]))\.([1-9][0-9]*)$ ]] ||
71+
[[ "${BASH_REMATCH[1]}" != "$context_line" ]] ||
72+
(( 10#${BASH_REMATCH[3]} < 33 )); then
73+
echo "Telegram candidate version ${candidate_version} does not belong to context ${normalized_context_ref}; expected a final ${context_line}.PATCH version with PATCH >= 33." >&2
7174
exit 1
7275
fi
7376
context_release_branch="$normalized_context_ref"

‎test/scripts/openclaw-release-telegram-qa-workflow.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,25 @@ describe("release Telegram QA workflow", () => {
526526
]);
527527
});
528528

529+
it("accepts only same-line extended-stable successors in both provenance blocks", () => {
530+
for (const provenanceBlock of PROVENANCE_BLOCKS) {
531+
const accepted = runCandidateProvenance(provenanceBlock, {
532+
candidateVersion: "2026.7.35",
533+
targetContextRef: "extended-stable/2026.7.33",
534+
});
535+
expect(accepted.status, `${provenanceBlock.stepName}: ${accepted.stderr}`).toBe(0);
536+
537+
for (const candidateVersion of ["2026.7.32", "2026.8.35", "2026.7.35-beta.1"]) {
538+
const rejected = runCandidateProvenance(provenanceBlock, {
539+
candidateVersion,
540+
targetContextRef: "extended-stable/2026.7.33",
541+
});
542+
expect(rejected.status, `${provenanceBlock.stepName}: ${candidateVersion}`).toBe(1);
543+
expect(rejected.stderr).toContain("PATCH >= 33");
544+
}
545+
}
546+
});
547+
529548
it("accepts only strict signed frozen beta branch heads in both provenance blocks", () => {
530549
for (const provenanceBlock of PROVENANCE_BLOCKS) {
531550
const frozen = runCandidateProvenance(provenanceBlock, {

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4001,6 +4001,7 @@ describe("package artifact reuse", () => {
40014001
["release/2026.8.1", "2026.8.1"],
40024002
["release/2026.8.1", "2026.8.1-beta.3"],
40034003
["extended-stable/2026.7.33", "2026.7.33"],
4004+
["extended-stable/2026.7.33", "2026.7.35"],
40044005
["v2026.8.1", "2026.8.1"],
40054006
["v2026.8.1-alpha.2", "2026.8.1-alpha.2"],
40064007
["v2026.8.1-beta.3", "2026.8.1-beta.3"],
@@ -4013,7 +4014,9 @@ describe("package artifact reuse", () => {
40134014
it.each([
40144015
["release/2026.8.1", "2026.8.2", "does not belong to release branch"],
40154016
["release/2026.8.1", "2026.8.1-alpha.2", "expected 2026.8.1 or a beta prerelease"],
4016-
["extended-stable/2026.7.33", "2026.7.33-beta.1", "does not match extended-stable branch"],
4017+
["extended-stable/2026.7.33", "2026.7.32", "PATCH >= 33"],
4018+
["extended-stable/2026.7.33", "2026.8.35", "does not belong to extended-stable branch"],
4019+
["extended-stable/2026.7.33", "2026.7.35-beta.1", "does not belong to extended-stable branch"],
40174020
["v2026.8.1", "2026.8.1-beta.1", "does not match release tag"],
40184021
["v2026.8.1-alpha.2", "2026.8.1-alpha.3", "does not match release tag"],
40194022
])(
@@ -4043,6 +4046,16 @@ describe("package artifact reuse", () => {
40434046
expect(rejected.stderr).toContain("expected 2026.8.1 or a beta prerelease");
40444047
});
40454048

4049+
it("validates an exact-SHA extended-stable successor against its canonical branch", () => {
4050+
const result = runFullReleaseTargetIdentityValidation({
4051+
targetContextRef: "extended-stable/2026.6.33",
4052+
targetRef: "a".repeat(40),
4053+
version: "2026.6.35",
4054+
});
4055+
4056+
expect(result.status, result.stderr).toBe(0);
4057+
});
4058+
40464059
it("rejects exact-SHA release contexts outside the named branch or tag", () => {
40474060
const divergedBranch = runFullReleaseTargetIdentityValidation({
40484061
comparisonStatus: "diverged",
@@ -5906,11 +5919,13 @@ describe("package artifact reuse", () => {
59065919
expect(telegramDispatch.env).toMatchObject({
59075920
PARENT_WORKFLOW_REF: "${{ github.ref_name }}",
59085921
PARENT_WORKFLOW_SHA: "${{ github.sha }}",
5922+
TARGET_CONTEXT_REF: "${{ inputs.target_context_ref }}",
59095923
});
59105924
expect(telegramDispatch.run).toContain('--ref "$PARENT_WORKFLOW_REF"');
59115925
expect(telegramDispatch.run).toContain(
59125926
'-f expected_trusted_workflow_sha="$PARENT_WORKFLOW_SHA"',
59135927
);
5928+
expect(telegramDispatch.run).toContain('-f target_context_ref="$TARGET_CONTEXT_REF"');
59145929
expect(telegramDispatch.run).toContain('[[ "$child_head_sha" != "$PARENT_WORKFLOW_SHA" ]]');
59155930
expect(telegramDispatch.run).not.toContain("commits/main");
59165931
expect(telegramDispatch.run).not.toContain("dispatch_attempt");

0 commit comments

Comments
 (0)