[PR #109] [CLOSED] Fix unique index collision risk in issue transfer tasks #112

Closed
opened 2026-10-27 21:09:41 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Comfy-Org/Comfy-PR/pull/109
Author: @Copilot
Created: 11/6/2025
Status: ❌ Closed

Base: main ← Head: copilot/sub-pr-105-yet-again


📝 Commits (10+)

  • 5eb12f3 feat: add desktop issue transfer task
  • a29017f feat: register desktop issue transfer task in run-gh-tasks
  • bef29cf feat: add ComfyUI to Desktop issue transfer task
  • 14d5bfe feat: add Frontend to Desktop issue transfer task
  • c988cd7 feat: register new desktop issue transfer tasks in run-gh-tasks
  • 878c842 feat: Implement GitHub issue transfer tasks between ComfyUI and frontend/desktop repositories
  • bb3a3db docs(easylabel.tsx): update comments to clarify allowed label patterns for better understanding and maintainability
  • e05ab4a refactor(gh-issue-transfer-frontend-to-desktop): remove limit on issue transfer to allow processing of all issues
  • 2916190 Initial plan
  • 42469ee fix: use composite unique index with source repo info to prevent collisions

📊 Changes

8 files changed (+1169 additions, -8 deletions)

View changed files

➕ app/tasks/gh-issue-transfer-comfyui-to-desktop/index.ts (+229 -0)
📝 app/tasks/gh-issue-transfer-comfyui-to-frontend/index.spec.ts (+13 -2)
📝 app/tasks/gh-issue-transfer-comfyui-to-frontend/index.ts (+22 -3)
➕ app/tasks/gh-issue-transfer-desktop-to-frontend/index.spec.ts (+424 -0)
➕ app/tasks/gh-issue-transfer-desktop-to-frontend/index.ts (+229 -0)
➕ app/tasks/gh-issue-transfer-frontend-to-desktop/index.ts (+229 -0)
📝 app/tasks/run-gh-tasks.ts (+16 -1)
📝 run/easylabel.tsx (+7 -2)

📄 Description

The unique index on sourceIssueNumber alone creates collision risk when transferring issues from multiple source repositories (e.g., issue #123 from comfyanonymous/ComfyUI and issue #123 from Comfy-Org/ComfyUI_frontend).

Changes

  • Type definitions: Added sourceOwner and sourceRepo fields to all task types
  • Database index: Changed from { sourceIssueNumber: 1 } to composite { sourceOwner: 1, sourceRepo: 1, sourceIssueNumber: 1 }
  • Query operations: Updated all findOne() and findOneAndUpdate() calls to use composite key
  • Test mocks: Updated to match new composite key structure

Affected tasks

  • gh-issue-transfer-frontend-to-desktop
  • gh-issue-transfer-comfyui-to-desktop
  • gh-issue-transfer-comfyui-to-frontend
  • gh-issue-transfer-desktop-to-frontend
// Before
await GithubFrontendToDesktopIssueTransferTask.createIndex({ sourceIssueNumber: 1 }, { unique: true });

// After
await GithubFrontendToDesktopIssueTransferTask.createIndex(
  { sourceOwner: 1, sourceRepo: 1, sourceIssueNumber: 1 },
  { unique: true }
);

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


🔄 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/109 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 11/6/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `copilot/sub-pr-105-yet-again` --- ### 📝 Commits (10+) - [`5eb12f3`](https://github.com/Comfy-Org/Comfy-PR/commit/5eb12f3ee1f851778597fdef6fb2b73d6600091c) feat: add desktop issue transfer task - [`a29017f`](https://github.com/Comfy-Org/Comfy-PR/commit/a29017f6b8e425970aa7583a4910367bf2af3166) feat: register desktop issue transfer task in run-gh-tasks - [`bef29cf`](https://github.com/Comfy-Org/Comfy-PR/commit/bef29cf4353a6aacd12d54523cbe6e864ae1de2d) feat: add ComfyUI to Desktop issue transfer task - [`14d5bfe`](https://github.com/Comfy-Org/Comfy-PR/commit/14d5bfe826370ade3b419ca239f0b59fdfd52516) feat: add Frontend to Desktop issue transfer task - [`c988cd7`](https://github.com/Comfy-Org/Comfy-PR/commit/c988cd70c14e686c496fdc5e6666addec11bc823) feat: register new desktop issue transfer tasks in run-gh-tasks - [`878c842`](https://github.com/Comfy-Org/Comfy-PR/commit/878c842740fd5c32a6f4f0c1a1e244c045189d6b) feat: Implement GitHub issue transfer tasks between ComfyUI and frontend/desktop repositories - [`bb3a3db`](https://github.com/Comfy-Org/Comfy-PR/commit/bb3a3dbf7c026acc6089980e4a711e6b1e06546b) docs(easylabel.tsx): update comments to clarify allowed label patterns for better understanding and maintainability - [`e05ab4a`](https://github.com/Comfy-Org/Comfy-PR/commit/e05ab4a3426759eb5ab242c613e37b3212165f2d) refactor(gh-issue-transfer-frontend-to-desktop): remove limit on issue transfer to allow processing of all issues - [`2916190`](https://github.com/Comfy-Org/Comfy-PR/commit/291619042611188a8034302eb0932095d8cd3c13) Initial plan - [`42469ee`](https://github.com/Comfy-Org/Comfy-PR/commit/42469ee17fd992470c9ff1f6bdb0f6b8c67249b9) fix: use composite unique index with source repo info to prevent collisions ### 📊 Changes **8 files changed** (+1169 additions, -8 deletions) <details> <summary>View changed files</summary> ➕ `app/tasks/gh-issue-transfer-comfyui-to-desktop/index.ts` (+229 -0) 📝 `app/tasks/gh-issue-transfer-comfyui-to-frontend/index.spec.ts` (+13 -2) 📝 `app/tasks/gh-issue-transfer-comfyui-to-frontend/index.ts` (+22 -3) ➕ `app/tasks/gh-issue-transfer-desktop-to-frontend/index.spec.ts` (+424 -0) ➕ `app/tasks/gh-issue-transfer-desktop-to-frontend/index.ts` (+229 -0) ➕ `app/tasks/gh-issue-transfer-frontend-to-desktop/index.ts` (+229 -0) 📝 `app/tasks/run-gh-tasks.ts` (+16 -1) 📝 `run/easylabel.tsx` (+7 -2) </details> ### 📄 Description The unique index on `sourceIssueNumber` alone creates collision risk when transferring issues from multiple source repositories (e.g., issue #123 from `comfyanonymous/ComfyUI` and issue #123 from `Comfy-Org/ComfyUI_frontend`). ## Changes - **Type definitions**: Added `sourceOwner` and `sourceRepo` fields to all task types - **Database index**: Changed from `{ sourceIssueNumber: 1 }` to composite `{ sourceOwner: 1, sourceRepo: 1, sourceIssueNumber: 1 }` - **Query operations**: Updated all `findOne()` and `findOneAndUpdate()` calls to use composite key - **Test mocks**: Updated to match new composite key structure ## Affected tasks - `gh-issue-transfer-frontend-to-desktop` - `gh-issue-transfer-comfyui-to-desktop` - `gh-issue-transfer-comfyui-to-frontend` - `gh-issue-transfer-desktop-to-frontend` ```typescript // Before await GithubFrontendToDesktopIssueTransferTask.createIndex({ sourceIssueNumber: 1 }, { unique: true }); // After await GithubFrontendToDesktopIssueTransferTask.createIndex( { sourceOwner: 1, sourceRepo: 1, sourceIssueNumber: 1 }, { unique: true } ); ``` <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/Comfy-Org/Comfy-PR/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-27 21:09:41 +00:00
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#112
No description provided.