Skip to content

Resolve direct PR links in issue-scoped tools#168

Merged
alvarosanchez merged 1 commit into
mainfrom
fix/direct-pr-link-resolution
Jun 30, 2026
Merged

Resolve direct PR links in issue-scoped tools#168
alvarosanchez merged 1 commit into
mainfrom
fix/direct-pr-link-resolution

Conversation

@alvarosanchez

Copy link
Copy Markdown
Owner

Summary

  • resolve issue-scoped PR tools from durable paperclip-github-plugin.pull-request-link entities when the Paperclip issue has no GitHub issue-origin link
  • merge direct PR references with GitHub issue-derived PR references without weakening repository ambiguity checks
  • reject explicit repository/PR selections that are not directly linked
  • document the direct-link resolution contract

Closes #167.

Why

create_pull_request already persisted a durable direct PR link for native Paperclip issues, but later tools such as get_pull_request({ paperclipIssueId }) only consulted GitHub issue-origin metadata. That made the atomic create flow succeed and link the PR while immediate follow-up reads incorrectly reported that the issue was not linked.

Verification

  • pnpm typecheck
  • pnpm test — 262 passing
  • pnpm build
  • git diff --check

Staging

Deployed an unreleased 0.14.1-issue167.1 build to the staging plugin worker and invoked the same get_pull_request call with the original native Paperclip issue and completed staging run context.

Before the fix:

This Paperclip issue is not linked to GitHub yet.

After the fix:

  • HTTP 200
  • no tool error
  • resolved alvarosanchez/paperclip#3
  • state: closed
  • head SHA: 6f24ec5bb463231f5473bd98333efda1a1c0c139

The regression test covers atomic create_pull_request → durable direct link → get_pull_request({ paperclipIssueId }). A second test covers same-number direct PRs across repositories and requires an explicit matching repository.

Copilot AI review requested due to automatic review settings June 30, 2026 18:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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.

@alvarosanchez alvarosanchez force-pushed the fix/direct-pr-link-resolution branch from 54ae336 to d876061 Compare June 30, 2026 18:06
@alvarosanchez alvarosanchez merged commit aa17c2e into main Jun 30, 2026
1 check passed
@alvarosanchez alvarosanchez deleted the fix/direct-pr-link-resolution branch June 30, 2026 18:08
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.

Resolve direct PR links for paperclipIssueId-scoped PR tools

2 participants