* feat: implement automatic PR discovery and attachment for task attempts - Add GitHub API methods to list PRs for a branch (open and all states) - Create /pr/attach endpoint to discover and attach existing PRs - Automatically mark tasks as done when attached PR is merged - Update Merge model to support PR status on creation - Handle both open and closed/merged PRs during attachment This improves on #837 by using GitHub API to automatically discover PRs rather than requiring manual input of PR details. * fix: address PR review feedback - Fix compilation issue by using find_latest_by_task_attempt_id - Properly handle Merge enum (Direct vs Pr variants) - Remove redundant list_prs_for_branch method - Simplify PR discovery to use only list_all_prs_for_branch - Only check for existing PR merges, not direct merges * fix: resolve compilation issues - Fix SQLx cache issue by restoring exact original create_pr method - Fix API response type for GitHub token error - Fix ProjectError variant name to ProjectNotFound - Add update_status call after PR creation for non-open PRs * fix: address PR review feedback - Fix compilation issue by using find_latest_by_task_attempt_id - Properly handle Merge enum (Direct vs Pr variants) - Remove redundant list_prs_for_branch method - Simplify PR discovery to use only list_all_prs_for_branch - Only check for existing PR merges, not direct merges - Update code to match current TaskAttempt struct (branch: String, target_branch: String) * Clippy, fmt, cleanup --------- Co-authored-by: Alex Netsch <alex@bloop.ai>
1.8 KiB
1.8 KiB