Skip to content

skills(fix): resolve PR comments from base repository#497

Open
Ducksss wants to merge 1 commit into
openai:mainfrom
Ducksss:PinZheng/fix-gh-address-comments-fork-pr
Open

skills(fix): resolve PR comments from base repository#497
Ducksss wants to merge 1 commit into
openai:mainfrom
Ducksss:PinZheng/fix-gh-address-comments-fork-pr

Conversation

@Ducksss

@Ducksss Ducksss commented Jun 18, 2026

Copy link
Copy Markdown

Fixes #495.

Summary

  • Resolve the current PR from the URL returned by gh pr view.
  • Query review comments against the repository that owns the PR number instead of the contributor fork.
  • Add a small unittest regression for cross-repository PRs.

Reproduction

  • The test mocks a fork PR where gh pr view reports head repository Nick2bad4u/oh-my-posh but the PR URL is JanDeDobbeleer/oh-my-posh/pull/7582.
  • Before the fix, get_current_pr_ref() returned the fork owner, causing GraphQL to query a PR number that does not exist in the fork.

Tests

  • python3 -m unittest discover -s tests
  • python3 -m py_compile skills/.curated/gh-address-comments/scripts/fetch_comments.py tests/test_gh_address_comments_fetch_comments.py

Summary:
- Parse the PR URL from gh pr view to identify the repository that
  owns the pull request number.
- Add a regression test for fork PRs where the head repository differs
  from the base repository.

Rationale:
- Review-thread GraphQL queries must use the base repository because PR
  numbers belong there, not in contributor forks.
- Keeping the lookup anchored to gh pr view preserves the existing
  current-branch workflow while fixing cross-repo PRs.

Tests:
- python3 -m unittest discover -s tests
- python3 -m py_compile skills/.curated/gh-address-comments/scripts/fetch_comments.py tests/test_gh_address_comments_fetch_comments.py
@Ducksss Ducksss requested a review from a team June 18, 2026 11:59
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.

gh-address-comments fetch_comments.py resolves fork PRs against the head repo

1 participant