ogr
ogr copied to clipboard
Create MRs for GitLab from fork to upstream is tricky
I suspect something has changed in the past 1-2 years as I'm no longer able to create MRs on gitlab.com using upsint:
ipdb> function
<function GitlabProject.create_pr at 0x7efdcef8c0e0>
ipdb> args
args = (<GitlabProject(namespace="redhat/research", repo="mastering-git")>, 'add slides for 5 and 6', '', 'main', 'class5-slides-6-2022')
kwargs = {'fork_username': 'TomasTomecek'}
ipdb> kwargs
{'fork_username': 'TomasTomecek'}
ogr.exceptions.GitlabAPIException: Requested fork doesn't exist
My fork exists and is public: https://gitlab.com/TomasTomecek/mastering-git
python-gitlab==3.14.0
From the docstring:
How to create PR:
- upstream -> upstream - call on upstream, fork_username unset
- fork -> upstream - call on fork, fork_username unset
also can call on upstream with fork_username, not supported way of using
- fork -> fork - call on fork, fork_username set
- fork -> other_fork - call on fork, fork_username set to other_fork owner
"""
It seems creating MRs from target_project when source is fork is discouraged but it should still work.