- Notifications
You must be signed in to change notification settings - Fork673
Project.repository_merge_base([...]) with forks (remotes)#2883
-
I am trying to streamline some cherry-picking for gitlab workflows. The principle is simple:
Now, I can rather simple get to the point where I have the source branch and target branch as objects in the API workflow: # def get_project(project_id) -> Projectmr=project.mergerequests.get(id)project=get_project(project_id)source=get_project(mr.source_project_id,mr.manager.gitlab).branches.get(mr.source_branch)target=project.branches.get(mr.target_branch) Generally these two originates from different sources, i.e. I tried: mb=project.repository_merge_base([target.commit["web_url"],source.commit["web_url"]]) to no avail (not that i fully expected this to work)... So basically, how can I use The merge-request can either be merged, or not merged, both cases are interesting! |
BetaWas this translation helpful?Give feedback.
All reactions
First thing I would do is look at the upstream documentation:
https://docs.gitlab.com/ee/api/repositories.html#merge-base
From my quick glance I don't think it will work how you hope. I believe it only takesrefs
aka SHA values.
One thing that might be helpful for debugging is:target.pprint()
that should print out all the values in the object. Which can be helpful. All the Python GitLab objects supportpprint()
,pformat()
,to_json()
, andasdict()
. Depending on the situation they can be useful in debugging code.
Replies: 1 comment 1 reply
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
First thing I would do is look at the upstream documentation: https://docs.gitlab.com/ee/api/repositories.html#merge-base From my quick glance I don't think it will work how you hope. I believe it only takes One thing that might be helpful for debugging is: |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thanks for your feedback, indeed it doesn't look like it. As for the debugging, I already played with |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1