Skip to content

Fix safe_outputs failure in resolve-pull-request-review-thread test - #11352

Merged
pelikhan merged 1 commit into
mainfrom
copilot/fix-safe-outputs-job
Aug 5, 2026
Merged

Fix safe_outputs failure in resolve-pull-request-review-thread test#11352
pelikhan merged 1 commit into
mainfrom
copilot/fix-safe-outputs-job

Conversation

Copilot AI commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

The safe_outputs job of Test Copilot Resolve Pull Request Review Thread failed because the resolve_pull_request_review_thread mutation was handed a non-node-id thread_id — a leaked GitHub REST 422 error payload — producing Could not resolve to a node with the global id.

The bad value originates in the e2e.sh fixture create_test_pr_with_review_comment: when the review-comment POST fails (e.g. 422 before the commit lands in the PR diff), the fixture could still emit a pr,comment_id,thread_id tuple with an empty/garbage identifier, which is then passed as the workflow_dispatch input consumed by the workflow's samples: block.

Changes (e2e.sh)

  • Fail closed on comment creation: return an empty fixture unless the review-comment POST yields a numeric comment id, so the caller's [[ -n ... ]] guards skip the dispatch instead of triggering with a bogus id.
  • Validate the resolved thread id: drop any thread_id that isn't shaped like a GraphQL node id (^[A-Za-z0-9_=-]+$), so error payloads / partial responses are never forwarded as a dispatch input.
if [[ -z "$comment_id" || ! "$comment_id" =~ ^[0-9]+$ ]]; then
    echo ""; return
fi
...
if [[ -n "$thread_id" && ! "$thread_id" =~ ^[A-Za-z0-9_=-]+$ ]]; then
    thread_id=""
fi

The test remains meaningful when the fixture succeeds; the harness can no longer dispatch the workflow with an invalid thread identifier.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review August 5, 2026 17:33
@pelikhan
pelikhan merged commit 563b641 into main Aug 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants