Skip to content

[aw-failures] [aw-fix] P1: PR Code Quality Reviewer — safe-outputs review 422 "can not request changes on your own PR" on *-mine [Content truncated due to length] #47390

Description

@github-actions

Fix the PR-review safe-output path to downgrade REQUEST_CHANGESCOMMENT (and drop unresolvable line comments) when the PR is authored by the workflow's own identity — it hard-fails every review on maintainer/bot *-miner PRs.

Problem

The safe_outputs job fails outright when the reviewer targets a PR whose author is the same identity the workflow runs as. GitHub pulls.createReview returns 422 "Review Can not request changes on your own pull request", and the body-only retry fails identically. Result: 4/4 safe outputs failed, review never posted.

Affected workflow / runs

  • Workflow: PR Code Quality Reviewer (.github/workflows/pr-code-quality-reviewer.lock.yml)
  • Failing runs (both on automated miner branches, PR author == workflow identity):
  • Every copilot/*-branch run in the same window succeeded → the failure tracks author-identity, not infra.
Evidence

Two 422 signatures in one finalization of §29946005059:

  1. create_pull_request_review_comment422 "Line could not be resolved and Line could not be resolved" (unresolvable diff lines) → falls back to body-only review.
  2. submit_pull_request_review (event REQUEST_CHANGES) → 422 "Review Can not request changes on your own pull request" (non-retryable). The body-only retry keeps the same event and fails identically.

audit-diff (§29946005059 vs successful §29947043700): no firewall anomalies, no tooling/MCP drift, comparable metrics (10 vs 12 API calls). Confirms a pure API-policy failure, not a code/infra regression.

Probable root cause

The safe-outputs PR-review finalizer unconditionally submits event=REQUEST_CHANGES with line-anchored comments without (a) checking whether the PR author equals the reviewing identity, or (b) validating comment lines are resolvable in the diff. GitHub rejects self-authored REQUEST_CHANGES with a non-retryable 422; the body-only fallback reuses the same event, so it also fails.

Proposed remediation

  1. Detect self-authored PRs (PR author login == workflow token identity) and downgrade REQUEST_CHANGES/APPROVECOMMENT before submission.
  2. On "Line could not be resolved", drop the unresolvable comments and submit the remaining valid ones — and ensure the body-only fallback also switches to event=COMMENT so it can succeed on self-authored PRs.
  3. If nothing remains postable after downgrade, emit a clean noop instead of hard-failing the job.

Success criteria / verification

  • Reviewer run on a *-miner/self-authored PR completes with a posted COMMENT review (or clean noop); safe_outputs job green.
  • No 422 "can not request changes on your own pull request" in Process Safe Outputs logs.
  • Backfill re-run against PR [linter-miner] feat(linters): add stringbytesroundtrip linter #47375 posts a body-only COMMENT review successfully.

Parent: #44298 (PR Code Quality Reviewer reliability). Analyzed runs: 29946005059, 29910168345, 29947043700.
Related to #44298

Generated by 🔍 [aw] Failure Investigator (6h) · age00 131.7 AIC · ⌖ 37.4 AIC · ⊞ 3.8K ·

  • expires on Jul 29, 2026, 11:22 AM UTC-08:00

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions