Skip to content

Create MRs for GitLab from fork to upstream is tricky #818

@TomasTomecek

Description

@TomasTomecek

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.


Related to #412

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/gitlabGitLab-forge relatedcomplexity/single-taskRegular task; should be done within daysgain/lowDoesn't bring much value to usersimpact/lowAffects only few of the userskind/bugAn unexpected problem or behavior

    Type

    No type

    Projects

    Status

    backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions