Skip to content

github: fetch PR base_sha via REST, not gh pr list - #73

Merged
adithya-s-k merged 1 commit into
huggingface:mainfrom
dfm88:fix/pr-list-base-sha
Jul 13, 2026
Merged

adithya-s-k merged 1 commit into
huggingface:mainfrom
dfm88:fix/pr-list-base-sha

Conversation

@dfm88

@dfm88 dfm88 commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • gh pr list --json never exposes baseRefOid — every pr_diff/pr_runtime
    run against a repo with merged PRs has failed since v0.1.
  • Fetch base.sha per surviving PR via the REST pulls endpoint instead.

How to reproduce

repo2rlenv generate --llm openai/gpt-4.1  --repo dagghe/pyOMA2 \
  --pipeline pr_diff \
  --pipeline-opt limit=10 \
  --out ./datasets/rl_test1

will produce something like:

Traceback (most recent call last):
  File ".venv/lib/python3.12/site-packages/repo2rlenv/pipelines/pr_diff.py", line 470, in run
    prs = provider.list_merged_prs(
        owner,
    ...<5 lines>...
        token=token,
    )
  File ".venv/lib/python3.12/site-packages/repo2rlenv/github.py", line 87, in list_merged_prs
    raw = _run_gh(args, token=token)
  File ".venv/lib/python3.12/site-packages/repo2rlenv/github.py", line 57, in _run_gh
    raise GitHubError(f"gh {' '.join(args)!r} failed: {proc.stderr.strip()}")

Test plan

  • uv run pytest -q — 684 passed
  • uv run ruff check . / ruff format --check . — clean

Out of scope

  • CI never exercises the real gh call (e2e test skipped — no GH token
    in CI env) — follow-up issue, not this PR.

`gh pr list --json` never exposes `baseRefOid`, so fetch base.sha per
PR via the REST pulls endpoint instead, which does return it.
@adithya-s-k
adithya-s-k merged commit 86be2e1 into huggingface:main Jul 13, 2026
@adithya-s-k

Copy link
Copy Markdown
Collaborator

thanks @dfm88 for fixing the PR base SHA lookup, appreciate the clear repro!

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.

2 participants