Skip to content

머지되거나 닫힌 PR을 브랜치 이름만으로 워크트리에 붙인다 #393

Closed

Description

@yansfil

The task you are doing when you want this

브랜치 이름을 다시 쓰는 작업에서도, 사이드바와 Overview에 그 워크트리의 PR만 보이길 원한다.

What hide does today

core는 pull_request.head_branch == checkout.branch인 첫 PR을 체크아웃에 붙인다(herdr-core/src/runtime/projects.rs).
PR의 상태와 head 커밋은 보지 않는다.
그래서 머지된 브랜치 이름을 새 작업에 다시 쓰면, 옛 머지 PR이 새 워크트리에 붙을 수 있다.

이 저장소에서 실제로 잘못 붙은 사례는 확인하지 않았고, 코드를 읽어 확인한 위험이다.
정리 시트의 머지 증명은 이미 "merged pull request exactly matches this worktree HEAD"를 요구하므로(herdr-core/src/worktree_cleanup.rs), 이 규칙이 빠진 곳은 사이드바와 Overview의 연결이다.

같은 계열 도구가 같은 버그를 고쳤다.

  • Conductor 0.76.0: "Fixed a new workspace sometimes showing an unrelated merged pull request because its branch name had been used before".
  • Paseo: "Branch names are reusable; selecting the newest terminal request by branch alone can silently attach an old promotion or feature request to new work." (docs/forge-providers.md, changelog feat: name the class of a failed device connection in its usage event #2172).
  • Superset: "Historical PRs should only attach when this workspace still points at the exact PR head commit."

What it should do instead

  • 열린 PR은 head 브랜치와 head 저장소 소유자가 같을 때 붙는다.
  • 머지되거나 닫힌 PR은 PR의 head SHA가 워크트리 HEAD와 같거나, HEAD가 그 PR의 커밋에 들어 있을 때만 붙는다(Paseo, Superset, Orca).
  • 같은 브랜치의 PR이 여럿이면 열림, 머지, 닫힘 순으로 고른다.
  • HEAD가 바뀌면 연결을 다시 판정한다.

commits/{sha}/pulls는 이 저장소에서 #384의 merge commit과 head 양쪽에 대해 #384를 돌려줬다(2026-10-04 확인).

Where the authority for it lives

연결 규칙은 core의 herdr-core/src/runtime/projects.rs가 가지고, 필요한 headRefOid는 herdr-core/src/github.rs의 조회 필드에 더하면 된다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions