[PR #202] fix(gh-design): skip self-review requests and tolerate 422 errors #203

Open
opened 2026-10-27 21:10:34 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/Comfy-PR/pull/202
Author: @snomiao
Created: 4/22/2026
Status: 🔄 Open

Base: main ← Head: fix/gh-design-self-review


📝 Commits (10+)

  • 2004175 fix(gh-design): skip self-review requests and tolerate 422 errors
  • 4cf8723 Update app/tasks/gh-design/gh-design.ts
  • 2c8cfd9 Merge branch 'fix/gh-design-self-review' of https://github.com/Comfy-Org/Comfy-PR into fix/gh-design-self-review
  • 33e8f70 fix(gh-design): skip self-review requests and tolerate 422 errors
  • 7472a00 Update app/tasks/gh-design/gh-design.ts
  • d5a2921 fix(gh-design): address review comments — typed catch, filter author from persisted reviewers
  • f97f018 test(gh-design): add filterReviewers unit tests
  • cee9996 refactor(gh-design): extract filterReviewers to side-effect-free module, fix guard condition
  • 7ab8d77 fix(gh-design): resolve merge conflict — adopt filterReviewers helper
  • 0cc2d8f fix(gh-design): only persist reviewers on successful API call

📊 Changes

3 files changed (+100 additions, -15 deletions)

View changed files

➕ app/tasks/gh-design/filterReviewers.spec.ts (+51 -0)
➕ app/tasks/gh-design/filterReviewers.ts (+17 -0)
📝 app/tasks/gh-design/gh-design.ts (+32 -15)

📄 Description

Summary

The 5-minute Combined GitHub Tasks workflow has been failing every run. Root cause:

GitHub Design Task: 21128ms - Review cannot be requested from pull request author.
1 task(s) failed. Exiting with error code 1.

REQUEST_REVIEWERS is hardcoded to ["PabloWiedemann"] in app/tasks/gh-design/gh-design.ts. When Pablo opens a PR himself, the task calls gh.pulls.requestReviewers with him as the reviewer, GitHub responds 422 Review cannot be requested from pull request author, and run-gh-tasks.ts then exits non-zero — turning one avoidable PR-level error into a full workflow failure on every 5-minute tick.

Fix

  • Skip self-review: filter the PR author (task.user) out of the reviewer list before calling the API (case-insensitive comparison).
  • Tolerate 422: wrap the call in a try/catch that swallows only status === 422 (non-collaborators, etc.), rethrowing anything else. 422s are retried on subsequent runs since the condition may be transient.
  • Persist only on success: reviewer list is saved to DB only after a successful API call, keeping DB state accurate.
  • No redundant retries: the guard condition uses the filtered newReviewers list, so when all eligible reviewers are already requested, the block is skipped entirely.
  • Extracted filterReviewers() into a side-effect-free module with 8 unit tests covering author filtering, case insensitivity, and edge cases.

Test plan

  • CI run_comfy_pr and run_combined_github_tasks pass
  • filterReviewers.spec.ts — 8 tests passing
  • Next scheduled Combined GitHub Tasks run finishes green.
  • PRs by non-authors still get reviewer requests as before.
  • PRs authored by a REQUEST_REVIEWERS member skip the call silently.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Comfy-Org/Comfy-PR/pull/202 **Author:** [@snomiao](https://github.com/snomiao) **Created:** 4/22/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/gh-design-self-review` --- ### 📝 Commits (10+) - [`2004175`](https://github.com/Comfy-Org/Comfy-PR/commit/200417524b19c16a3872c826bf08ed9a72dbd917) fix(gh-design): skip self-review requests and tolerate 422 errors - [`4cf8723`](https://github.com/Comfy-Org/Comfy-PR/commit/4cf8723132db1a019b689cc7b6f1d94d4d8c802f) Update app/tasks/gh-design/gh-design.ts - [`2c8cfd9`](https://github.com/Comfy-Org/Comfy-PR/commit/2c8cfd96cd0132153c3633dd5b9aac7d5b27b445) Merge branch 'fix/gh-design-self-review' of https://github.com/Comfy-Org/Comfy-PR into fix/gh-design-self-review - [`33e8f70`](https://github.com/Comfy-Org/Comfy-PR/commit/33e8f703229b4eb12d1df35aa804d87e95661d49) fix(gh-design): skip self-review requests and tolerate 422 errors - [`7472a00`](https://github.com/Comfy-Org/Comfy-PR/commit/7472a007e7b65179eeac2a582836d543e2d2d659) Update app/tasks/gh-design/gh-design.ts - [`d5a2921`](https://github.com/Comfy-Org/Comfy-PR/commit/d5a2921fcf910e9aa538dc86824e09169e05c2a9) fix(gh-design): address review comments — typed catch, filter author from persisted reviewers - [`f97f018`](https://github.com/Comfy-Org/Comfy-PR/commit/f97f018731e7766fed5f1f655a99b3be4e87276f) test(gh-design): add filterReviewers unit tests - [`cee9996`](https://github.com/Comfy-Org/Comfy-PR/commit/cee9996dc9ec170d782b7bd5583f3c9af0dda4cd) refactor(gh-design): extract filterReviewers to side-effect-free module, fix guard condition - [`7ab8d77`](https://github.com/Comfy-Org/Comfy-PR/commit/7ab8d77bbd297f6adf1b62423d39c78a8d0ae82e) fix(gh-design): resolve merge conflict — adopt filterReviewers helper - [`0cc2d8f`](https://github.com/Comfy-Org/Comfy-PR/commit/0cc2d8f734678753e0235d79d17e177a7bf629a2) fix(gh-design): only persist reviewers on successful API call ### 📊 Changes **3 files changed** (+100 additions, -15 deletions) <details> <summary>View changed files</summary> ➕ `app/tasks/gh-design/filterReviewers.spec.ts` (+51 -0) ➕ `app/tasks/gh-design/filterReviewers.ts` (+17 -0) 📝 `app/tasks/gh-design/gh-design.ts` (+32 -15) </details> ### 📄 Description ## Summary The 5-minute [`Combined GitHub Tasks`](https://github.com/Comfy-Org/Comfy-PR/actions/runs/24778612522) workflow has been failing every run. Root cause: ``` GitHub Design Task: 21128ms - Review cannot be requested from pull request author. 1 task(s) failed. Exiting with error code 1. ``` `REQUEST_REVIEWERS` is hardcoded to `["PabloWiedemann"]` in `app/tasks/gh-design/gh-design.ts`. When Pablo opens a PR himself, the task calls `gh.pulls.requestReviewers` with him as the reviewer, GitHub responds **422 Review cannot be requested from pull request author**, and `run-gh-tasks.ts` then exits non-zero — turning one avoidable PR-level error into a full workflow failure on every 5-minute tick. ## Fix - **Skip self-review**: filter the PR author (`task.user`) out of the reviewer list before calling the API (case-insensitive comparison). - **Tolerate 422**: wrap the call in a try/catch that swallows only `status === 422` (non-collaborators, etc.), rethrowing anything else. 422s are retried on subsequent runs since the condition may be transient. - **Persist only on success**: reviewer list is saved to DB only after a successful API call, keeping DB state accurate. - **No redundant retries**: the guard condition uses the filtered `newReviewers` list, so when all eligible reviewers are already requested, the block is skipped entirely. - **Extracted `filterReviewers()`** into a side-effect-free module with 8 unit tests covering author filtering, case insensitivity, and edge cases. ## Test plan - [x] CI `run_comfy_pr` and `run_combined_github_tasks` pass - [x] `filterReviewers.spec.ts` — 8 tests passing - [ ] Next scheduled `Combined GitHub Tasks` run finishes green. - [ ] PRs by non-authors still get reviewer requests as before. - [ ] PRs authored by a `REQUEST_REVIEWERS` member skip the call silently. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Comfy-Org/Comfy-PR#203
No description provided.