Skip to content

feat: POST /branches/link for existing GitHub branches - #18

Open
Anshulgada wants to merge 1 commit into
Paca-AI:masterfrom
Anshulgada:feat/link-branch-clean
Open

feat: POST /branches/link for existing GitHub branches#18
Anshulgada wants to merge 1 commit into
Paca-AI:masterfrom
Anshulgada:feat/link-branch-clean

Conversation

@Anshulgada

Copy link
Copy Markdown

Summary

Adds a link-only branch endpoint mirroring POST .../pull-requests/link.

  • POST /projects/:projectId/tasks/:taskId/branches/link — verify branch exists on GitHub, insert into github_task_branches (one branch → many tasks)
  • github_link_branch_to_task MCP tool
  • url.PathEscape on GitHub ref URLs so branch names with / (e.g. feature/foo) resolve correctly

Fixes IDE/agent workflows where POST /branches fails with Reference already exists.

Closes #16

Test plan

  • go test ./... in backend/
  • Link existing branch via API
  • Link same branch to a second task
  • 404 when branch does not exist on GitHub
  • 409 when already linked to same task

Add link-only endpoint mirroring pull-requests/link: verify branch ref
on GitHub, insert into github_task_branches, emit github.branch_linked.

- URL-encode branch ref segments (fix/foo branch names)
- MCP tool github_link_branch_to_task
- Unit tests with public FOSS fixtures only

Closes Paca-AI#16
Copilot AI review requested due to automatic review settings July 31, 2026 06:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Add POST /tasks/:taskId/branches/link to link existing branches without GitHub create

2 participants