~alpine/devel

5 4

Introducing mkmr

Rasmus Thomsen <oss@cogitri.dev>
Details
Message ID
<38c03a13520d52e1418666015866a8e72893b41c.camel@cogitri.dev>
DKIM signature
missing
Download raw message
Hello list,

maxice8 (aka. Leo on our Gitlab instance) and I started working on
mkmr, a small python3 tool to create (and manage) merge requests on
gitlab instances (from the CLI). We hope that this tool will cut back
on the overhead Gitlab introduces (e.g. when having to click through
the webUI) and maybe this will even help people migrate from the ML to
Gitlab :)


Setting it up is pretty easy:

0. Create a Gitlab account and fork 
https://gitlab.alpinelinux.org/alpine/aports (or whatever repo you want
to work on). Add a personal access token on 
https://gitlab.alpinelinux.org/profile/personal_access_tokens with the
"api" scope enabled (and copy that token to your clipboard).
1. apk add mkmr
2. Clone your fork. Afterwards add a remote called "upstream", pointing
to the upstream repository (e.g. 
https://gitlab.alpinelinux.org/alpine/aports, whatever you forked from)
(3. in theory this is optional, but you should switch to a different
branch now, since you can't have multiple merge requests open from the
same branch)
4. Make the changes you want to do & commit
5. Run "mkmr". It will ask you to enter a token on the first run (use
the one from 0.) and if you have multiple commits you can select which
commit to use for the title and description. You can set these manually
too, see "man mkmr" for more info. mkmr will ask you to confirm that
the title, description and the included commits are correct and after
you press enter it'll create the MR for you!
6. Run "git push origin" to push your changes. If you want to amend
further changes to the MR simply do "git commit --amend" (if you have
one commit), or use fixup commits and rebase (if you have multiple
commits). Afterwards you can force push. In the future mkmr should do
the initial push for you.

mkmr is in somewhat early stages right now, but it's actively used for
the MRs maxice8 and I create as of now, so we try to test it as much as
we can - but further testing and suggestions would be welcome of
course! See https://github.com/maxice8/mkmr/ for the README with
further information about all of this.

Thanks,

Rasmus "Cogitri" Thomsen
Details
Message ID
<20200322163110.2ce6f8f1@enterprise>
In-Reply-To
<38c03a13520d52e1418666015866a8e72893b41c.camel@cogitri.dev> (view parent)
DKIM signature
missing
Download raw message
Note that this is available in Alpine Linux Edge as it is in the
testing/ repository
Details
Message ID
<2319c320-5796-3c00-9cbe-740942a20e34@gmail.com>
In-Reply-To
<38c03a13520d52e1418666015866a8e72893b41c.camel@cogitri.dev> (view parent)
DKIM signature
missing
Download raw message
On 3/23/20 12:21 AM, Rasmus Thomsen wrote:
> Hello list,
> 
> maxice8 (aka. Leo on our Gitlab instance) and I started working on
> mkmr, a small python3 tool to create (and manage) merge requests on
> gitlab instances (from the CLI). We hope that this tool will cut back
> on the overhead Gitlab introduces (e.g. when having to click through
> the webUI) and maybe this will even help people migrate from the ML to
> Gitlab :)
> 
> 
> Setting it up is pretty easy:
> 
> 0. Create a Gitlab account and fork 
> https://gitlab.alpinelinux.org/alpine/aports

Sounds good,

If I have a repo say,
https://gitlab.alpinelinux.org/user1/aports
can I merge branches 'directly' on it via mkmr scripts ?
eg. merge user1/aports/dev to user1/aports/master

-- 
Regards,
V.Krishn
Rasmus Thomsen <oss@cogitri.dev>
Details
Message ID
<F7CBD0FB-E194-4CCD-ABEC-2E1CB851F6B9@cogitri.dev>
In-Reply-To
<2319c320-5796-3c00-9cbe-740942a20e34@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Hello,

I'm not quite certain if I understand the question correctly, but if you set both the upstream and the origin remote to user1/aports it'll create a MR from whatever branch you're on right now to user1/aports/master.

Regards,

Rasmus Thomsen

On March 22, 2020 7:33:35 PM UTC, "V.Krishn" <vkrishn4@gmail.com> wrote:
>On 3/23/20 12:21 AM, Rasmus Thomsen wrote:
>> Hello list,
>> 
>> maxice8 (aka. Leo on our Gitlab instance) and I started working on
>> mkmr, a small python3 tool to create (and manage) merge requests on
>> gitlab instances (from the CLI). We hope that this tool will cut back
>> on the overhead Gitlab introduces (e.g. when having to click through
>> the webUI) and maybe this will even help people migrate from the ML
>to
>> Gitlab :)
>> 
>> 
>> Setting it up is pretty easy:
>> 
>> 0. Create a Gitlab account and fork 
>> https://gitlab.alpinelinux.org/alpine/aports
>
>Sounds good,
>
>If I have a repo say,
>https://gitlab.alpinelinux.org/user1/aports
>can I merge branches 'directly' on it via mkmr scripts ?
>eg. merge user1/aports/dev to user1/aports/master
>
>-- 
>Regards,
>V.Krishn

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
Details
Message ID
<C1HMIGZOGAFA.2C3NW8H7JA5XD@enterprise>
In-Reply-To
<2319c320-5796-3c00-9cbe-740942a20e34@gmail.com> (view parent)
DKIM signature
missing
Download raw message
On Mon Mar 23, 2020 at 1:03 AM, V.Krishn wrote:
> On 3/23/20 12:21 AM, Rasmus Thomsen wrote:
> > Hello list,
> > 
> > maxice8 (aka. Leo on our Gitlab instance) and I started working on
> > mkmr, a small python3 tool to create (and manage) merge requests on
> > gitlab instances (from the CLI). We hope that this tool will cut back
> > on the overhead Gitlab introduces (e.g. when having to click through
> > the webUI) and maybe this will even help people migrate from the ML to
> > Gitlab :)
> > 
> > 
> > Setting it up is pretty easy:
> > 
> > 0. Create a Gitlab account and fork 
> > https://gitlab.alpinelinux.org/alpine/aports
>
> 
> Sounds good,
>
> 
> If I have a repo say,
> https://gitlab.alpinelinux.org/user1/aports
> can I merge branches 'directly' on it via mkmr scripts ?
> eg. merge user1/aports/dev to user1/aports/master
>

If you have a merge request with the source_branch=dev and the target_branch=master then you can
indeed use mgmr to merge it.

All of my testing happens on Alpine Linux's aports where i have my repo-fork as the --origin and
alpine/aports as my --target, but i don't see why it wouldn't work if both --origin and --target are
the same.

> 
> --
> Regards,
> V.Krishn
>
> 
>
> 
Details
Message ID
<f1550425-401f-dfb0-1eb5-520f3c922cc4@gmail.com>
In-Reply-To
<F7CBD0FB-E194-4CCD-ABEC-2E1CB851F6B9@cogitri.dev> (view parent)
DKIM signature
missing
Download raw message
On 3/23/20 1:14 AM, Rasmus Thomsen wrote:
> Hello,
> 
> I'm not quite certain if I understand the question correctly, but if you set both the upstream and the origin remote to user1/aports it'll create a MR from whatever branch you're on right now to user1/aports/master.

Was more of a general API feature/question, wherein allowing me to,
merge user1/aports/dev -> user1/aports/master
but creating NO MR.

Currently for given repo user1/aports at gitlab for same I would do,
----------
git clone http://.../user1/aports
cd aports && git branch dev && git checkout dev
".. make all changes .."
git commit ...
git checkout master
git merge dev, git push origin master
----------

what I would like to do is use API, and

git clone http://.../user1/aports
cd aports && git branch dev && git checkout dev
".. make all changes .."
git commit ...
git push origin dev

Then use API or a feature in mkmr,
1. merge dev->master,
2. then send a MR for master (changes)
----------
but then (1) above may not be something in scope of mkmr

maybe I need to go through the API as what can be done :(

> 
> Regards,
> 
> Rasmus Thomsen
> 
> On March 22, 2020 7:33:35 PM UTC, "V.Krishn" <vkrishn4@gmail.com> wrote:
>> On 3/23/20 12:21 AM, Rasmus Thomsen wrote:
>>> Hello list,
>>>
>>> maxice8 (aka. Leo on our Gitlab instance) and I started working on
>>> mkmr, a small python3 tool to create (and manage) merge requests on
>>> gitlab instances (from the CLI). We hope that this tool will cut back
>>> on the overhead Gitlab introduces (e.g. when having to click through
>>> the webUI) and maybe this will even help people migrate from the ML
>> to
>>> Gitlab :)
>>>
>>>
>>> Setting it up is pretty easy:
>>>
>>> 0. Create a Gitlab account and fork 
>>> https://gitlab.alpinelinux.org/alpine/aports
>>
>> Sounds good,
>>
>> If I have a repo say,
>> https://gitlab.alpinelinux.org/user1/aports
>> can I merge branches 'directly' on it via mkmr scripts ?
>> eg. merge user1/aports/dev to user1/aports/master
>>
>> -- 
>> Regards,
>> V.Krishn
> 

-- 
Regards,
V.Krishn
Reply to thread Export thread (mbox)