[yt-dev] Fun with the bitbucket REST API

Matthew Turk matthewturk at gmail.com
Sun Jan 4 18:14:04 PST 2015


Hi all,

With help from Nathan and Kacper, the hgbb extension now has support for
listing PRs, getting info on PRs by number, pulling in PRs to a local repo,
and also issuing new ones.  The commands are:

hg bbprs  # lists
hg bbprs -i PRNUMBER # gets info on a PR
hg bbprs -p PRNUMBER # pulls changesets in
hg bbnewpr # creates a new PR

There's also a config option for the default "upstream" repo -- so if you
set this in your .hg/hgrc file for your yt repo:

[bb]
upstream = yt_analysis/yt

then it should Just Do The Right Thing in most cases, including still only
pushing to your repo, and allowing you to specify which repo to PR to.  For
instance, I just made a new PR first to Nathan's yt repo:

hg bbnewpr -t "Slightly update README" -d "This slightly updates the README
file." -r tip -n ngoldbaum/yt

and then to the main yt repo:

hg bbnewpr -t "Slightly update README" -d "This slightly updates the README
file." -r tip

Note that I specified the revision to PR from -- this will default '.', so
whatever the current state of the repo is.

IIRC, we're still sending hgbb out with the yt-supplemental repo, so if you
just update your repo there and enable the extension this should work.

-Matt

On Sun, Jan 4, 2015 at 5:37 PM, Matthew Turk <matthewturk at gmail.com> wrote:

> Hi Nathan,
>
> Here's my script that successfully created a PR to your unrelated repo
> from my yt repo.
>
> http://paste.yt-project.org/show/5322/
>
> I've contributed to hgbb in the past; I am thinking maybe I will suggest a
> few additional improvements based on the REST API.
>
> -Matt
>
> On Sun, Jan 4, 2015 at 5:14 PM, Nathan Goldbaum <nathan12343 at gmail.com>
> wrote:
>
>>
>>
>> On Sun, Jan 4, 2015 at 3:05 PM, Matthew Turk <matthewturk at gmail.com>
>> wrote:
>>
>>> Hey Nathan,
>>>
>>> Have you experimented with issuing PRs via the API?  I read the API a
>>> while back and it looks like it *might* be possible to issue PRs from a
>>> repo to a repo other than the one you forked from.
>>>
>>
>> I'm not sure.  According to the API docs, this is possible:
>>
>>
>> https://confluence.atlassian.com/display/BITBUCKET/pullrequests+Resource#pullrequestsResource-POST(create)anewpullrequest
>>
>> I've never tried it.
>>
>>
>>> It would be pretty cool to expand the hgbb extension to do some neat
>>> stuff like "get me PR #whatever" or "issue PR from this to that" etc.
>>>
>>>
>> That would be super useful.  Given that hgbb hasn't seen any updates
>> since 2012 there are probably a number of places to make it nicer by making
>> use of the new API.  You might want to engage with Georg Brandl about
>> maintaining it?
>>
>> That said, if you want to use version 2.0 of the bitbucket API, you might
>> need to do some substantial updates to hgbb to port it over to the new API.
>>
>>
>>> -Matt
>>>
>>> On Sun, Jan 4, 2015 at 2:41 PM, Nathan Goldbaum <nathan12343 at gmail.com>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> I'm in the middle of putting together a changelog for the upcoming 3.1
>>>> release.
>>>>
>>>> Just in case anyone needs to do this in the future, I've put together a
>>>> quick script that interacts with the bitbucket REST API to generate a
>>>> summary of all merged pull requests since the release of yt 3.0 on August
>>>> 4th.
>>>>
>>>> The script is here: https://bpaste.net/show/f86b1b4c0326
>>>>
>>>> My plan now is to use the output of this script to manually create a
>>>> changelog for the docs and release announcement.
>>>>
>>>> Hope that's helpful,
>>>>
>>>> -Nathan
>>>>
>>>> _______________________________________________
>>>> yt-dev mailing list
>>>> yt-dev at lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>>>>
>>>>
>>>
>>> _______________________________________________
>>> yt-dev mailing list
>>> yt-dev at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>>>
>>>
>>
>> _______________________________________________
>> yt-dev mailing list
>> yt-dev at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20150104/ffbbd795/attachment.html>


More information about the yt-dev mailing list