Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

🐛 Fix PR creation for a repo the user does not own #922

Merged
merged 3 commits into from
Aug 9, 2022

Conversation

SBrandeis
Copy link
Contributor

There is a bug preventing anyone to create a Pull Request with upload_file. This bug has two parts:

  • fetch_upload_modes (pre-upload call) was missing the ?create_pr=1 query parameter when requesting the pre-upload edpoint, resulting in a 403 HTTP error
  • post_lfs_batch_info would specify body.ref.name when revision is passed, resulting in an HTTPError 403 when trying to open a PR

This pull request addresses those two points

cc: @lewtun @abhishekkrthakur

cc @coyotte508 : not sure ?create_pr=1 should be required for the pre-upload endpoint, wdyt?

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Jun 22, 2022

The documentation is not available anymore as the PR was closed or merged.

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, LGTM! Would be worthwile to add a test to ensure that this does work correctly now

@SBrandeis SBrandeis requested a review from Wauplin August 4, 2022 15:45
@Wauplin Wauplin merged commit 2e42097 into huggingface:main Aug 9, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants