Bug#839072: autopkgtest: Allow for GitHub-style PR urls
Martin Pitt
mpitt at debian.org
Wed Sep 28 14:52:08 UTC 2016
Hello Barry,
Barry Warsaw [2016-09-28 10:26 -0400]:
> So the idea then is to allow URLs that can additionally specify that
> PR ref. Then I could run autopkgtest like so:
>
> $ autopkgtest https://github.com/CanonicalLtd/ubuntu-image.git+refs/pull/68/merge -- schroot yakkety-amd64
>
> Notice the '+' separating the .git URL from the PR refspec.
>
> I'm not sure this is the best possible syntax, and I'd like to be able
> to support GitLab PRs too, which apparently don't use a + or the same
> refspec for their merge requests, although the same general
> implementation (clone then fetch) *should* work.
First, thanks for working on this! I'd love to make it straightfoward
to test a github branch with a single autopkgtest invocation.
I would actually like to generalize this, and use one and the same
method and syntax for both cases. Right now an url#mybranch argument
just does "git clone --branch mybranch url" which does not work for
these "floating" refs of PRs. But this seems to work:
git clone url
git fetch -fu origin $BRANCHNAME:testbranch
git checkout testbranch
So the existing http://foo.org/proj.git#stable syntax (proper branch)
would continue to work, but you can then use
http://foo.org/proj.git#refs/pull/1234/head
(which is what I use for systemd PRs).
Would that also work for gitlab?
Thanks,
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
More information about the autopkgtest-devel
mailing list