Skip to content

Commit

Permalink
Script/Tickets code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyn committed Oct 22, 2024
1 parent d924853 commit a638c50
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
1 change: 0 additions & 1 deletion cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ requires 'IO::Prompt::Tiny';
requires 'IO::Uncompress::Bunzip2', '2.106';
requires 'IO::Zlib';
requires 'IPC::Run3', '0.048';
requires 'JSON::MaybeXS', '1.004004'; # indirect dep
requires 'List::Util', '1.62';
requires 'Log::Any::Adapter';
requires 'Log::Any::Adapter::Log4perl';
Expand Down
21 changes: 6 additions & 15 deletions lib/MetaCPAN/Script/Tickets.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use namespace::autoclean;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0;

use HTTP::Request::Common qw( GET );
use Log::Contextual qw( :log :dlog );
use Net::GitHub::V4 ();
use Ref::Util qw( is_hashref is_ref );
use Text::CSV_XS ();
use URI::Escape qw( uri_escape );
use Log::Contextual qw( :log :dlog );
use Net::GitHub::V4 ();
use Ref::Util qw( is_hashref is_ref );
use Text::CSV_XS ();
use URI::Escape qw( uri_escape );

with 'MetaCPAN::Role::Script', 'MooseX::Getopt';

Expand All @@ -21,12 +21,6 @@ has rt_summary_url => (
default => 'https://rt.cpan.org/Public/bugs-per-dist.tsv',
);

has github_issues => (
is => 'ro',
required => 1,
default => 'https://api.github.com/repos/%s/%s/issues?per_page=100',
);

has github_token => (
is => 'ro',
lazy => 1,
Expand Down Expand Up @@ -117,8 +111,6 @@ sub index_github_bugs {

my %summary;

my $json = JSON::MaybeXS->new( allow_nonref => 1 );

RELEASE: while ( my $release = $scroll->next ) {
my $resources = $release->resources;
my ( $user, $repo, $source )
Expand Down Expand Up @@ -261,7 +253,7 @@ sub parse_tsv {
source => $self->rt_dist_url( $row->{dist} ),
active => $row->{active},
closed => $row->{inactive},
map { $_ => $row->{$_} + 0 }
map { $_ => $row->{$_} + 0 }
grep { not /^(dist|active|inactive)$/ }
keys %$row,
};
Expand Down Expand Up @@ -312,4 +304,3 @@ http://fastapi.metacpan.org/v1/distribution/Moose
http://fastapi.metacpan.org/v1/distribution/HTTP-BrowserDetect
=cut

5 changes: 0 additions & 5 deletions t/00_setup.t
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ ok(
scheme => 'file',
path => $fakecpan_dir->child('bugs.tsv')->absolute->stringify,
),
github_issues => uri(
scheme => 'file',
path => $fakecpan_dir->child('github')->absolute->stringify
. '/%s/%s.json?per_page=100'
),
} )->run,
'tickets'
);
Expand Down

0 comments on commit a638c50

Please sign in to comment.