[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: forward-bug.pl (was: Wheezy!)



On Mon, Mar 07, 2011 at 08:45:20PM +0100, gregor herrmann wrote:
> > I've just spent about 15 minutes trying to create a simple "proof-of-concept"
> > bug forwarding script.
> 
> Wow, very nice! Thanks.
  
> > It's nothing more than a hack: it takes the Debian bug number and the name
> > of the CPAN distribution (this probably can be replaced by reading the value
> > of "Upstream-Name" in d/copyright), 
> 
> Yup, or from d/watch or d/control or anything that looks like a CPAN
> URL :)

It now extracts the distribution name from the Homepage field in d/control
or the Source field in d/copyright.

> > To create the bug on CPAN's RT it is obviously needed a valid BitCard or PAUSE
> > account.
> 
> Having this in a file (like rtpaste does) might be nice.

Indeed. Now it reads the '~/.pause' file (just like cpan-upload and 
Dist::Zilla do).
Since I noticed that users with a BitCard account needs to provide an
external cookie from the BitCard login it should be enough.

> I guess I should really try it :)
> And I'm sure it's useful!
> 
> Ok, here we go:
> Let's find a friendly upstream: done.
> Edit script (login, pass, 'https' for the RT URL): done.
> Install dependencies: done.
> 
> Run it: ./forward-bug.pl 616566 Config-Model-Itself
> 
> $EDITOR appears. Edit. Close $EDITOR:
> 
> The script exits with status 255 and
> "odd number of arguments passed"
> 
> Playing around.
> 
> Oops, if I exit $EDITOR without saving the ticket gets created:
> https://rt.cpan.org/Public/Bug/Display.html?id=66455
> 
> A trivial example with Proc::InvokeEditor works, no idea why it
> doesn't in this context. Maybe it's safer to put it outside the
> ticket creation?
> 
> Oh, the following behaves differently:
> 
>     my $string = "foo";
>     print Proc::InvokeEditor -> edit($string);
> 
> and
> 
>     my $string = "foo";
>     my $result = Proc::InvokeEditor -> edit($string);
>     print $result;

Seems caused by the fact that Proc::InvokeEditor -> edit() returns an array
ref... well, I think I fixed this as you suggested. (the https url is now
also used).
 
> And the bug is marked as forwarded:
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=616566
> 
> Although the forwarded address doesn't look so good:
> http://rt.cpan.org/Public/Bug/Display.html?id=RT::Client::REST::Ticket=HASH(0x9379030)
> :)
> Should probably be $ticket->id or something like that in the $url
> line.
>
> (I leave the RT bug and the 'forwarded' value of the Debian bugs as
> they are for now.)

Oops, I forgot the '-> id' thing, sorry. Fixed now.

I've also added some documentation, and checks on user input and bug status
(if the bug has been already closed/forwarded the script exits).

Maybe we can also move it to the Group's SVN, to make contributions by
others easier.

> > P.S. I can also try to do something similar for the forward-patch
> > thing (and then merge both the scripts in one) but I don't feel
> > like doing it right now.
> 
> No hurry but I hope that at some point you feel like looking into it
> :)

Of course. When the forward-bug.pl will be enough stable I'll do it.

Thank you for the experiment and the review.

Cheers

-- 
perl -E'$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'


Reply to: