Skip to content

Commit 2953b3c

Browse files
committed
Merge remote-tracking branch 'upstream/main' into fix/issue-76209-cache-exists-sync
# Conflicts: # CHANGELOG.md
2 parents 16da967 + cd24da0 commit 2953b3c

70 files changed

Lines changed: 3445 additions & 458 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ gitcrawl cluster-detail openclaw/openclaw --id <cluster-id> --member-limit 20 --
3838
```
3939

4040
- The helper reports repo-local activity first and can fetch public GitHub contribution totals for the same window with `--global`.
41+
- The helper is intentionally cache-friendly for gitcrawl-backed `gh`: it rounds repo-local windows to the UTC day, rounds global contribution windows to the UTC hour, and counts PRs/issues from one paginated issues response before fetching commits separately. Prefer reusing the helper instead of hand-rolling several `gh api` loops.
4142
- Report activity compactly, for example `OpenClaw last 12mo: 4 PRs, 2 issues, 11 commits; GitHub public last 12mo: 86 commits, 9 PRs, 3 issues, 12 reviews`.
4243
- If `name` is empty, use the login only. If profile lookup is rate-limited or unavailable, say `account age unknown` rather than omitting the opener.
4344
- Use identity and activity as triage signal, not proof by itself: new, low-activity, or bot-like accounts can raise review caution, but code, repro, and CI evidence still decide.

‎.github/workflows/mantis-discord-status-reactions.yml‎

Lines changed: 45 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,9 @@ jobs:
420420
--json > "$metadata"
421421
}
422422
423+
if ! command -v ffmpeg >/dev/null 2>&1 || ! command -v ffprobe >/dev/null 2>&1; then
424+
sudo apt-get update && sudo apt-get install -y ffmpeg || true
425+
fi
423426
if ! make_desktop_preview baseline || ! make_desktop_preview candidate; then
424427
rm -f "$root/baseline/discord-status-reactions-tool-only-desktop-preview.gif"
425428
rm -f "$root/candidate/discord-status-reactions-tool-only-desktop-preview.gif"
@@ -471,6 +474,40 @@ jobs:
471474
echo "- Candidate desktop video: \`candidate/discord-status-reactions-tool-only-desktop.mp4\`"
472475
} > "$root/mantis-report.md"
473476
477+
jq -n \
478+
--arg baseline_status "$baseline_status" \
479+
--arg candidate_status "$candidate_status" \
480+
--arg baseline_sha "${{ needs.validate_refs.outputs.baseline_revision }}" \
481+
--arg candidate_sha "${{ needs.validate_refs.outputs.candidate_revision }}" \
482+
'{
483+
schemaVersion: 1,
484+
id: "discord-status-reactions",
485+
title: "Mantis Discord Status Reactions QA",
486+
summary: "Mantis reran Discord status reactions against the known queued-only baseline and the candidate ref. The baseline reproduced the bug, while the candidate showed the expected queued -> thinking -> done reaction sequence.",
487+
scenario: "discord-status-reactions-tool-only",
488+
comparison: {
489+
baseline: { sha: $baseline_sha, expected: "queued-only", status: $baseline_status, reproduced: ($baseline_status == "fail") },
490+
candidate: { sha: $candidate_sha, expected: "queued -> thinking -> done", status: $candidate_status, fixed: ($candidate_status == "pass") },
491+
pass: (($baseline_status == "fail") and ($candidate_status == "pass"))
492+
},
493+
artifacts: [
494+
{ kind: "timeline", lane: "baseline", label: "Baseline queued-only", path: "baseline/discord-status-reactions-tool-only-timeline.png", targetPath: "baseline.png", alt: "Baseline Discord status reaction timeline", width: 420 },
495+
{ kind: "timeline", lane: "candidate", label: "Candidate queued -> thinking -> done", path: "candidate/discord-status-reactions-tool-only-timeline.png", targetPath: "candidate.png", alt: "Candidate Discord status reaction timeline", width: 420 },
496+
{ kind: "desktopScreenshot", lane: "baseline", label: "Baseline desktop/VNC browser", path: "baseline/discord-status-reactions-tool-only-desktop.png", targetPath: "baseline-desktop.png", alt: "Baseline Mantis desktop browser screenshot", width: 420 },
497+
{ kind: "desktopScreenshot", lane: "candidate", label: "Candidate desktop/VNC browser", path: "candidate/discord-status-reactions-tool-only-desktop.png", targetPath: "candidate-desktop.png", alt: "Candidate Mantis desktop browser screenshot", width: 420 },
498+
{ kind: "motionPreview", lane: "baseline", label: "Baseline motion preview", path: "baseline/discord-status-reactions-tool-only-desktop-preview.gif", targetPath: "baseline-desktop-preview.gif", alt: "Animated baseline desktop preview", width: 420, required: false },
499+
{ kind: "motionPreview", lane: "candidate", label: "Candidate motion preview", path: "candidate/discord-status-reactions-tool-only-desktop-preview.gif", targetPath: "candidate-desktop-preview.gif", alt: "Animated candidate desktop preview", width: 420, required: false },
500+
{ kind: "motionClip", lane: "baseline", label: "Baseline change MP4", path: "baseline/discord-status-reactions-tool-only-desktop-change.mp4", targetPath: "baseline-desktop-change.mp4", required: false },
501+
{ kind: "motionClip", lane: "candidate", label: "Candidate change MP4", path: "candidate/discord-status-reactions-tool-only-desktop-change.mp4", targetPath: "candidate-desktop-change.mp4", required: false },
502+
{ kind: "fullVideo", lane: "baseline", label: "Baseline desktop MP4", path: "baseline/discord-status-reactions-tool-only-desktop.mp4", targetPath: "baseline-desktop.mp4" },
503+
{ kind: "fullVideo", lane: "candidate", label: "Candidate desktop MP4", path: "candidate/discord-status-reactions-tool-only-desktop.mp4", targetPath: "candidate-desktop.mp4" },
504+
{ kind: "metadata", lane: "baseline", label: "Baseline preview metadata", path: "baseline/discord-status-reactions-tool-only-desktop-preview.json", targetPath: "baseline-desktop-preview.json", required: false },
505+
{ kind: "metadata", lane: "candidate", label: "Candidate preview metadata", path: "candidate/discord-status-reactions-tool-only-desktop-preview.json", targetPath: "candidate-desktop-preview.json", required: false },
506+
{ kind: "metadata", lane: "run", label: "Comparison JSON", path: "comparison.json", targetPath: "comparison.json" },
507+
{ kind: "report", lane: "run", label: "Mantis report", path: "mantis-report.md", targetPath: "mantis-report.md" }
508+
]
509+
}' > "$root/mantis-evidence.json"
510+
474511
cat "$root/mantis-report.md" >> "$GITHUB_STEP_SUMMARY"
475512
476513
if [[ "$baseline_status" != "fail" ]]; then
@@ -511,155 +548,17 @@ jobs:
511548
GH_TOKEN: ${{ steps.mantis_app_token.outputs.token }}
512549
TARGET_PR: ${{ needs.resolve_request.outputs.pr_number }}
513550
ARTIFACT_URL: ${{ steps.upload_artifact.outputs.artifact-url }}
514-
BASELINE_SHA: ${{ needs.validate_refs.outputs.baseline_revision }}
515-
CANDIDATE_SHA: ${{ needs.validate_refs.outputs.candidate_revision }}
516551
REQUEST_SOURCE: ${{ needs.resolve_request.outputs.request_source }}
517552
shell: bash
518553
run: |
519554
set -euo pipefail
520555
521-
if [[ ! "$TARGET_PR" =~ ^[0-9]+$ ]]; then
522-
echo "pr_number must be numeric, got '${TARGET_PR}'." >&2
523-
exit 1
524-
fi
525-
526556
root=".artifacts/qa-e2e/mantis/discord-status-reactions"
527-
for required in \
528-
"$root/comparison.json" \
529-
"$root/baseline/discord-status-reactions-tool-only-timeline.png" \
530-
"$root/candidate/discord-status-reactions-tool-only-timeline.png" \
531-
"$root/baseline/discord-status-reactions-tool-only-desktop.png" \
532-
"$root/candidate/discord-status-reactions-tool-only-desktop.png" \
533-
"$root/baseline/discord-status-reactions-tool-only-desktop.mp4" \
534-
"$root/candidate/discord-status-reactions-tool-only-desktop.mp4"
535-
do
536-
if [[ ! -f "$required" ]]; then
537-
echo "Missing required QA evidence file: $required" >&2
538-
exit 1
539-
fi
540-
done
541-
542-
gh api "repos/${GITHUB_REPOSITORY}/pulls/${TARGET_PR}" --jq '.number' >/dev/null
543-
544-
artifact_root="mantis/discord-status-reactions/pr-${TARGET_PR}/run-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
545-
artifacts_worktree="$(mktemp -d)"
546-
git init --quiet "$artifacts_worktree"
547-
git -C "$artifacts_worktree" config user.name "github-actions[bot]"
548-
git -C "$artifacts_worktree" config user.email "41898282+github-actions[bot]@users.noreply.github.com"
549-
git -C "$artifacts_worktree" remote add origin "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
550-
551-
if git -C "$artifacts_worktree" fetch --quiet origin qa-artifacts; then
552-
git -C "$artifacts_worktree" checkout --quiet -B qa-artifacts FETCH_HEAD
553-
else
554-
git -C "$artifacts_worktree" checkout --quiet --orphan qa-artifacts
555-
fi
556-
557-
mkdir -p "$artifacts_worktree/$artifact_root"
558-
cp "$root/baseline/discord-status-reactions-tool-only-timeline.png" "$artifacts_worktree/$artifact_root/baseline.png"
559-
cp "$root/candidate/discord-status-reactions-tool-only-timeline.png" "$artifacts_worktree/$artifact_root/candidate.png"
560-
cp "$root/baseline/discord-status-reactions-tool-only-desktop.png" "$artifacts_worktree/$artifact_root/baseline-desktop.png"
561-
cp "$root/candidate/discord-status-reactions-tool-only-desktop.png" "$artifacts_worktree/$artifact_root/candidate-desktop.png"
562-
has_desktop_previews="false"
563-
if [[ -f "$root/baseline/discord-status-reactions-tool-only-desktop-preview.gif" && -f "$root/candidate/discord-status-reactions-tool-only-desktop-preview.gif" ]]; then
564-
cp "$root/baseline/discord-status-reactions-tool-only-desktop-preview.gif" "$artifacts_worktree/$artifact_root/baseline-desktop-preview.gif"
565-
cp "$root/candidate/discord-status-reactions-tool-only-desktop-preview.gif" "$artifacts_worktree/$artifact_root/candidate-desktop-preview.gif"
566-
cp "$root/baseline/discord-status-reactions-tool-only-desktop-preview.json" "$artifacts_worktree/$artifact_root/baseline-desktop-preview.json"
567-
cp "$root/candidate/discord-status-reactions-tool-only-desktop-preview.json" "$artifacts_worktree/$artifact_root/candidate-desktop-preview.json"
568-
has_desktop_previews="true"
569-
fi
570-
has_change_clips="false"
571-
if [[ -f "$root/baseline/discord-status-reactions-tool-only-desktop-change.mp4" && -f "$root/candidate/discord-status-reactions-tool-only-desktop-change.mp4" ]]; then
572-
cp "$root/baseline/discord-status-reactions-tool-only-desktop-change.mp4" "$artifacts_worktree/$artifact_root/baseline-desktop-change.mp4"
573-
cp "$root/candidate/discord-status-reactions-tool-only-desktop-change.mp4" "$artifacts_worktree/$artifact_root/candidate-desktop-change.mp4"
574-
has_change_clips="true"
575-
fi
576-
cp "$root/baseline/discord-status-reactions-tool-only-desktop.mp4" "$artifacts_worktree/$artifact_root/baseline-desktop.mp4"
577-
cp "$root/candidate/discord-status-reactions-tool-only-desktop.mp4" "$artifacts_worktree/$artifact_root/candidate-desktop.mp4"
578-
cp "$root/comparison.json" "$artifacts_worktree/$artifact_root/comparison.json"
579-
cp "$root/mantis-report.md" "$artifacts_worktree/$artifact_root/mantis-report.md"
580-
581-
git -C "$artifacts_worktree" add "$artifact_root"
582-
if git -C "$artifacts_worktree" diff --cached --quiet; then
583-
echo "No QA screenshot/video artifact changes to publish."
584-
else
585-
git -C "$artifacts_worktree" commit --quiet -m "qa: publish Mantis Discord evidence for PR ${TARGET_PR}"
586-
git -C "$artifacts_worktree" push --quiet origin HEAD:qa-artifacts
587-
fi
588-
589-
encoded_artifact_root="${artifact_root// /%20}"
590-
raw_base="https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/qa-artifacts/${encoded_artifact_root}"
591-
baseline_status="$(jq -r '.baseline.status' "$root/comparison.json")"
592-
candidate_status="$(jq -r '.candidate.status' "$root/comparison.json")"
593-
pass="$(jq -r '.pass' "$root/comparison.json")"
594-
preview_section=""
595-
if [[ "$has_desktop_previews" == "true" ]]; then
596-
preview_section="$(cat <<EOF
597-
598-
| Baseline motion preview | Candidate motion preview |
599-
| --- | --- |
600-
| <img src="${raw_base}/baseline-desktop-preview.gif" width="420" alt="Animated baseline desktop preview"> | <img src="${raw_base}/candidate-desktop-preview.gif" width="420" alt="Animated candidate desktop preview"> |
601-
EOF
602-
)"
603-
fi
604-
change_clip_section=""
605-
if [[ "$has_change_clips" == "true" ]]; then
606-
change_clip_section="$(cat <<EOF
607-
608-
Motion-trimmed clips:
609-
- [Baseline change MP4](${raw_base}/baseline-desktop-change.mp4)
610-
- [Candidate change MP4](${raw_base}/candidate-desktop-change.mp4)
611-
EOF
612-
)"
613-
fi
614-
comment_file="$(mktemp)"
615-
cat > "$comment_file" <<EOF
616-
<!-- mantis-discord-status-reactions -->
617-
## Mantis Discord Status Reactions QA
618-
619-
Summary: Mantis reran Discord status reactions against the known queued-only baseline and the candidate ref. The baseline reproduced the bug, while the candidate showed the expected queued -> thinking -> done reaction sequence.
620-
621-
- Scenario: \`discord-status-reactions-tool-only\`
622-
- Trigger: \`${REQUEST_SOURCE}\`
623-
- Run: https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}
624-
- Artifact: ${ARTIFACT_URL}
625-
- Baseline: \`${baseline_status}\` at \`${BASELINE_SHA}\`
626-
- Candidate: \`${candidate_status}\` at \`${CANDIDATE_SHA}\`
627-
- Overall: \`${pass}\`
628-
629-
| Baseline queued-only | Candidate queued -> thinking -> done |
630-
| --- | --- |
631-
| <img src="${raw_base}/baseline.png" width="420" alt="Baseline Discord status reaction timeline"> | <img src="${raw_base}/candidate.png" width="420" alt="Candidate Discord status reaction timeline"> |
632-
633-
| Baseline desktop/VNC browser | Candidate desktop/VNC browser |
634-
| --- | --- |
635-
| <img src="${raw_base}/baseline-desktop.png" width="420" alt="Baseline Mantis desktop browser screenshot"> | <img src="${raw_base}/candidate-desktop.png" width="420" alt="Candidate Mantis desktop browser screenshot"> |
636-
${preview_section}
637-
${change_clip_section}
638-
639-
Full videos:
640-
- [Baseline desktop MP4](${raw_base}/baseline-desktop.mp4)
641-
- [Candidate desktop MP4](${raw_base}/candidate-desktop.mp4)
642-
643-
Raw QA files: https://github.com/${GITHUB_REPOSITORY}/tree/qa-artifacts/${artifact_root}
644-
EOF
645-
646-
comment_id="$(
647-
gh api --paginate "repos/${GITHUB_REPOSITORY}/issues/${TARGET_PR}/comments" \
648-
--jq '.[] | select(.body | contains("<!-- mantis-discord-status-reactions -->")) | .id' \
649-
| tail -n 1
650-
)"
651-
652-
if [[ -n "$comment_id" ]]; then
653-
comment_payload="$(mktemp)"
654-
jq -n --rawfile body "$comment_file" '{ body: $body }' > "$comment_payload"
655-
if gh api --method PATCH "repos/${GITHUB_REPOSITORY}/issues/comments/${comment_id}" --input "$comment_payload" >/dev/null; then
656-
echo "Updated Mantis QA evidence comment on PR #${TARGET_PR}."
657-
else
658-
echo "::warning::Could not update existing Mantis QA evidence comment ${comment_id}; creating a new one."
659-
gh pr comment "$TARGET_PR" --body-file "$comment_file"
660-
echo "Created Mantis QA evidence comment on PR #${TARGET_PR}."
661-
fi
662-
else
663-
gh pr comment "$TARGET_PR" --body-file "$comment_file"
664-
echo "Created Mantis QA evidence comment on PR #${TARGET_PR}."
665-
fi
557+
node scripts/mantis/publish-pr-evidence.mjs \
558+
--manifest "$root/mantis-evidence.json" \
559+
--target-pr "$TARGET_PR" \
560+
--artifact-root "mantis/discord-status-reactions/pr-${TARGET_PR}/run-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" \
561+
--marker "<!-- mantis-discord-status-reactions -->" \
562+
--artifact-url "$ARTIFACT_URL" \
563+
--run-url "https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" \
564+
--request-source "$REQUEST_SOURCE"
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Mantis Scenario
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
scenario_id:
7+
description: Mantis scenario id to run
8+
required: true
9+
default: discord-status-reactions-tool-only
10+
type: choice
11+
options:
12+
- discord-status-reactions-tool-only
13+
- slack-desktop-smoke
14+
baseline_ref:
15+
description: Optional baseline ref for before/after scenarios
16+
required: false
17+
default: 0bf06e953fdda290799fc9fb9244a8f67fdae593
18+
type: string
19+
candidate_ref:
20+
description: Candidate ref, tag, or SHA
21+
required: true
22+
default: main
23+
type: string
24+
pr_number:
25+
description: Optional PR number to receive QA evidence
26+
required: false
27+
type: string
28+
29+
permissions:
30+
actions: write
31+
contents: read
32+
33+
concurrency:
34+
group: mantis-scenario-${{ inputs.scenario_id }}-${{ inputs.pr_number || inputs.candidate_ref || github.run_id }}
35+
cancel-in-progress: false
36+
37+
jobs:
38+
dispatch:
39+
name: Dispatch selected Mantis workflow
40+
runs-on: blacksmith-8vcpu-ubuntu-2404
41+
steps:
42+
- name: Dispatch scenario
43+
env:
44+
GH_TOKEN: ${{ github.token }}
45+
BASELINE_REF: ${{ inputs.baseline_ref }}
46+
CANDIDATE_REF: ${{ inputs.candidate_ref }}
47+
PR_NUMBER: ${{ inputs.pr_number }}
48+
SCENARIO_ID: ${{ inputs.scenario_id }}
49+
shell: bash
50+
run: |
51+
set -euo pipefail
52+
53+
case "$SCENARIO_ID" in
54+
discord-status-reactions-tool-only)
55+
args=(
56+
workflow run mantis-discord-status-reactions.yml
57+
--repo "$GITHUB_REPOSITORY"
58+
--ref main
59+
-f "baseline_ref=${BASELINE_REF}"
60+
-f "candidate_ref=${CANDIDATE_REF}"
61+
)
62+
if [[ -n "${PR_NUMBER:-}" ]]; then
63+
args+=(-f "pr_number=${PR_NUMBER}")
64+
fi
65+
gh "${args[@]}"
66+
;;
67+
slack-desktop-smoke)
68+
args=(
69+
workflow run mantis-slack-desktop-smoke.yml
70+
--repo "$GITHUB_REPOSITORY"
71+
--ref main
72+
-f "candidate_ref=${CANDIDATE_REF}"
73+
)
74+
if [[ -n "${PR_NUMBER:-}" ]]; then
75+
args+=(-f "pr_number=${PR_NUMBER}")
76+
fi
77+
gh "${args[@]}"
78+
;;
79+
*)
80+
echo "Unsupported Mantis scenario: ${SCENARIO_ID}" >&2
81+
exit 1
82+
;;
83+
esac

0 commit comments

Comments
 (0)