Skip to content

paper-publisher: honor --create-pr in link command - #300

Open
crs7617 wants to merge 1 commit into
huggingface:mainfrom
crs7617:fix/paper-publisher-create-pr
Open

crs7617 wants to merge 1 commit into
huggingface:mainfrom
crs7617:fix/paper-publisher-create-pr

Conversation

@crs7617

@crs7617 crs7617 commented Nov 11, 2026

Copy link
Copy Markdown

Fixes #290

Problem
link --create-pr printed "PR creation not yet implemented" and then called
upload_file without create_pr, so the README change landed on main.

Change

  • Pass create_pr through to HfApi.upload_file and keep the returned CommitInfo.
  • In PR mode, print "Opened PR" with the PR URL and add pr_url to the JSON output
    (main() prints that dict). Direct-commit output is unchanged.

Testing

  • Added scripts/test_paper_manager.py (unittest, mocked HfApi, no network or token).
  • (a) create_pr=True forwards the flag and reports the PR URL. It fails without the
    fix and passes with it.
  • (b) The default path still commits directly. This is a regression guard and passes
    before and after.
  • Existing test_build_skill_distribution.py still passes.
  • Not tried against the real Hub.

Not addressed

  • With several arXiv IDs plus --create-pr, each paper opens its own PR against main,
    so they may conflict once one is merged.
  • If the paper is already in the README, the script still uploads an unchanged file.
    That already happens in direct mode.
  • The README is always read from main, not from an open PR branch.
  • The new test isn't run by CI, which only runs test_build_skill_distribution.py.
    Happy to wire it in if you want.

Thanks @JacobTRND for the report and diagnosis. I used Claude Code to help
investigate and draft; I reviewed the diff and ran the tests myself.

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.

huggingface-paper-publisher: paper_manager.py link --create-pr commits directly to main

1 participant