fix(cua-driver): scope trajectory recording to the session that started it #7887
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "CI: Release Reminder" | |
| # This workflow only reads PR metadata through GitHub's API. It deliberately | |
| # never checks out or executes contributor-controlled code, so | |
| # pull_request_target is safe here and lets the reminder work for fork PRs. | |
| on: | |
| pull_request_target: | |
| types: [opened, synchronize, reopened, labeled, unlabeled] | |
| jobs: | |
| release-reminder: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - name: Check for publishable changes and remind | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| LABELS_JSON: ${{ toJSON(github.event.pull_request.labels.*.name) }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| # Get changed files in this PR | |
| CHANGED_FILES=$(gh pr diff "$PR_NUMBER" --repo "$REPO" --name-only 2>/dev/null || true) | |
| if [ -z "$CHANGED_FILES" ]; then | |
| exit 0 | |
| fi | |
| # Map paths to publishable services | |
| declare -A PATH_TO_SERVICE=( | |
| ["libs/python/cua-cli/"]="pypi/cli" | |
| ["libs/python/cua-auto/"]="pypi/auto" | |
| ["libs/python/agent/"]="pypi/agent" | |
| ["libs/python/computer/"]="pypi/computer" | |
| ["libs/python/core/"]="pypi/core" | |
| ["libs/python/som/"]="pypi/som" | |
| ["libs/python/bench-ui/"]="pypi/bench-ui" | |
| ["libs/cua-bench/"]="pypi/bench" | |
| ["libs/python/computer-server/"]="pypi/computer-server" | |
| ["libs/python/mcp-server/"]="pypi/mcp-server" | |
| ["libs/typescript/cua-cli/"]="npm/cli" | |
| ["libs/typescript/computer/"]="npm/computer" | |
| ["libs/typescript/core/"]="npm/core" | |
| ["libs/typescript/playground/"]="npm/playground" | |
| ["libs/cuabot/"]="npm/cuabot" | |
| ["libs/xfce-cua/"]="docker/xfce-cua" | |
| ["libs/xfce/"]="docker/xfce" | |
| ["libs/kasm/"]="docker/kasm" | |
| ["libs/lumier/"]="docker/lumier" | |
| ["libs/qemu-docker/android/"]="docker/qemu-android" | |
| ["libs/qemu-docker/linux/"]="docker/qemu-linux" | |
| ["libs/qemu-docker/windows/"]="docker/qemu-windows" | |
| ) | |
| # Find affected services | |
| AFFECTED=() | |
| for path_prefix in "${!PATH_TO_SERVICE[@]}"; do | |
| if echo "$CHANGED_FILES" | grep -q "^${path_prefix}"; then | |
| AFFECTED+=("${PATH_TO_SERVICE[$path_prefix]}") | |
| fi | |
| done | |
| # Deduplicate and sort | |
| IFS=$'\n' AFFECTED=($(printf '%s\n' "${AFFECTED[@]}" | sort -u)); unset IFS | |
| if [ ${#AFFECTED[@]} -eq 0 ]; then | |
| echo "No publishable packages affected." | |
| exit 0 | |
| fi | |
| # Check which ones already have release labels | |
| LABELS="$LABELS_JSON" | |
| HAS_NO_RELEASE=false | |
| if echo "$LABELS" | grep -q '"no-release"'; then | |
| HAS_NO_RELEASE=true | |
| fi | |
| LABELED=() | |
| UNLABELED=() | |
| for svc in "${AFFECTED[@]}"; do | |
| if echo "$LABELS" | grep -q "\"release:${svc}\""; then | |
| LABELED+=("$svc") | |
| else | |
| UNLABELED+=("$svc") | |
| fi | |
| done | |
| # Build comment body | |
| COMMENT_MARKER="<!-- release-reminder -->" | |
| BODY="${COMMENT_MARKER}\n" | |
| BODY+="### 📦 Publishable packages changed\n\n" | |
| BODY+="This comment is status-only. Editing it or adding task-list checkboxes cannot authorize a release.\n" | |
| BODY+="Only owner-applied \`release:<service>\` labels can do that.\n\n" | |
| if [ ${#LABELED[@]} -gt 0 ]; then | |
| for svc in "${LABELED[@]}"; do | |
| BODY+="- ✅ \`${svc}\` — owner-authorized auto-release on merge\n" | |
| done | |
| fi | |
| if [ ${#UNLABELED[@]} -gt 0 ]; then | |
| for svc in "${UNLABELED[@]}"; do | |
| if [ "$HAS_NO_RELEASE" = "true" ]; then | |
| BODY+="- ⏭️ ~\`${svc}\`~ — skipped (no-release)\n" | |
| else | |
| BODY+="- ⏸️ \`${svc}\` — no owner-authorized release label\n" | |
| fi | |
| done | |
| fi | |
| if [ "$HAS_NO_RELEASE" = "false" ] && [ ${#UNLABELED[@]} -gt 0 ]; then | |
| BODY+="\nAsk the release owner to apply \`release:<service>\` labels to auto-release on merge" | |
| BODY+=" (+ optional \`bump:minor\` or \`bump:major\`, default is patch)." | |
| BODY+="\nOr add \`no-release\` to skip." | |
| fi | |
| # Delete every previous generated reminder, including duplicates left by | |
| # older workflow runs, then post one clean status comment. | |
| EXISTING_COMMENT_IDS=$(gh api --paginate \ | |
| "repos/${REPO}/issues/${PR_NUMBER}/comments?per_page=100" \ | |
| --jq ".[] | select(.body | contains(\"${COMMENT_MARKER}\")) | .id" 2>/dev/null || true) | |
| while IFS= read -r comment_id; do | |
| if [ -n "$comment_id" ]; then | |
| gh api -X DELETE \ | |
| "repos/${REPO}/issues/${PR_NUMBER}/comments/${comment_id}" 2>/dev/null || true | |
| fi | |
| done <<< "$EXISTING_COMMENT_IDS" | |
| echo -e "$BODY" | gh pr comment "$PR_NUMBER" --repo "$REPO" --body-file - |