From bcdfc379bf297dacf3e7a5c925f290e917562e8a Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 18 Jun 2024 17:19:40 +0200 Subject: [PATCH 01/22] use Test::Fatal rather than Test::Exception (via Test::Most) Test::Exception has too much magic. --- cpanfile | 1 + t/model/archive.t | 5 +++-- t/util.t | 7 ++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cpanfile b/cpanfile index 88473ce24..945a2de4b 100644 --- a/cpanfile +++ b/cpanfile @@ -175,6 +175,7 @@ requires 'PPI', '1.274'; # Perl::Critic requires 'PPIx::QuoteLike', '0.022'; # Perl::Critic requires 'PPIx::Regexp', '0.085'; # Perl::Critic requires 'String::Format', '1.18'; # Perl::Critic +requires 'Test::Fatal'; requires 'Test::Harness', '3.44'; # Contains App::Prove requires 'Test::More', '1.302190'; requires 'Test::Most'; diff --git a/t/model/archive.t b/t/model/archive.t index d9eaf3c29..48e7977c5 100644 --- a/t/model/archive.t +++ b/t/model/archive.t @@ -7,19 +7,20 @@ use MetaCPAN::TestHelpers qw( fakecpan_dir ); use Test::Most import => [qw( cmp_bag done_testing is isa_ok like ok require_ok subtest throws_ok ) ]; +use Test::Fatal; my $CLASS = 'MetaCPAN::Model::Archive'; require_ok $CLASS; subtest 'missing required arguments' => sub { - throws_ok { $CLASS->new } qr{archive}; + like exception { $CLASS->new }, qr/^Attribute \(file\) is required/; }; subtest 'file does not exist' => sub { my $file = 'hlaglhalghalghj.blah'; my $archive = $CLASS->new( file => $file ); - throws_ok { $archive->files } qr{$file does not exist}; + like exception { $archive->files }, qr{$file does not exist}; }; subtest 'archive extraction' => sub { diff --git a/t/util.t b/t/util.t index b90e8a3a9..c48636d5f 100644 --- a/t/util.t +++ b/t/util.t @@ -10,7 +10,8 @@ use MetaCPAN::Util qw( strip_pod ); -use Test::Most import => [qw( done_testing is lives_ok ok )]; +use Test::More; +use Test::Fatal; ok( generate_sid(), 'generate_sid' ); @@ -43,10 +44,10 @@ ok( generate_sid(), 'generate_sid' ); 'v1.2' => 'v1.2', ); foreach my $before ( sort keys %versions ) { - lives_ok { + is exception { is( version($before), $versions{$before}, "$before => $versions{$before}" ) - } + }, undef; "$before => $versions{$before} does not die"; } } From 22b0936dba4d26f45f97909cc9a0c4f4fc540a60 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 18 Jun 2024 17:22:44 +0200 Subject: [PATCH 02/22] use Test::Deep directly rather than via Test::Most Test::Most just obscures what is being used. --- cpanfile | 2 +- t/model/archive.t | 5 ++--- t/model/release/dependencies.t | 3 ++- t/types.t | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpanfile b/cpanfile index 945a2de4b..008bb4097 100644 --- a/cpanfile +++ b/cpanfile @@ -175,10 +175,10 @@ requires 'PPI', '1.274'; # Perl::Critic requires 'PPIx::QuoteLike', '0.022'; # Perl::Critic requires 'PPIx::Regexp', '0.085'; # Perl::Critic requires 'String::Format', '1.18'; # Perl::Critic +requires 'Test::Deep'; requires 'Test::Fatal'; requires 'Test::Harness', '3.44'; # Contains App::Prove requires 'Test::More', '1.302190'; -requires 'Test::Most'; requires 'Test::Perl::Critic', '1.04'; requires 'Test::RequiresInternet'; requires 'Test::Routine', '0.012'; diff --git a/t/model/archive.t b/t/model/archive.t index 48e7977c5..4cb14a6a3 100644 --- a/t/model/archive.t +++ b/t/model/archive.t @@ -4,10 +4,9 @@ use lib 't/lib'; use Digest::SHA qw( sha1_hex ); use MetaCPAN::TestHelpers qw( fakecpan_dir ); -use Test::Most import => - [qw( cmp_bag done_testing is isa_ok like ok require_ok subtest throws_ok ) - ]; +use Test::More; use Test::Fatal; +use Test::Deep qw(cmp_bag); my $CLASS = 'MetaCPAN::Model::Archive'; require_ok $CLASS; diff --git a/t/model/release/dependencies.t b/t/model/release/dependencies.t index afdc62317..ae47852bf 100644 --- a/t/model/release/dependencies.t +++ b/t/model/release/dependencies.t @@ -5,7 +5,8 @@ use lib 't/lib'; use MetaCPAN::Model::Release (); use MetaCPAN::Script::Runner; use MetaCPAN::TestHelpers qw( fakecpan_dir get_config ); -use Test::Most import => [qw( cmp_bag done_testing subtest )]; +use Test::More; +use Test::Deep qw(cmp_bag); my $config = get_config(); diff --git a/t/types.t b/t/types.t index c590afa29..3f8ce75a5 100644 --- a/t/types.t +++ b/t/types.t @@ -2,7 +2,7 @@ use strict; use warnings; use MetaCPAN::Types::TypeTiny qw( Resources ); -use Test::Most import => [qw( done_testing is_deeply ok )]; +use Test::More; is_deeply( Resources->coerce( { From 1242796a57d8da10e8d492e65d32f74bd7ae0c79 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 18 Jun 2024 17:26:10 +0200 Subject: [PATCH 03/22] use DateTime for date parsing in latest script We use DateTime::Format::ISO8601 elsewhere for parsing dates, so also used it in the latest script. This makes the comparison used more obvious, and removes use of both Regexp::Common::time and Time::Local. --- cpanfile | 3 --- lib/MetaCPAN/Script/Latest.pm | 24 ++++++------------------ 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/cpanfile b/cpanfile index 008bb4097..275e3b482 100644 --- a/cpanfile +++ b/cpanfile @@ -136,15 +136,12 @@ requires 'Pod::Simple', '3.43'; requires 'Pod::Simple::XHTML', '3.24'; requires 'Pod::Text', '4.14'; requires 'Ref::Util'; -requires 'Regexp::Common'; -requires 'Regexp::Common::time'; requires 'Safe', '2.35'; # bug fixes (used by Parse::PMFile) requires 'Scalar::Util', '1.62'; # Moose requires 'Search::Elasticsearch', '== 2.03'; requires 'Term::Choose', '1.754'; # Git::Helpers requires 'Throwable::Error'; requires 'Text::CSV_XS'; -requires 'Time::Local'; requires 'Try::Tiny', '0.30'; requires 'Type::Tiny', '2.000001'; requires 'Types::Path::Tiny'; diff --git a/lib/MetaCPAN/Script/Latest.pm b/lib/MetaCPAN/Script/Latest.pm index d31e7f095..438166071 100644 --- a/lib/MetaCPAN/Script/Latest.pm +++ b/lib/MetaCPAN/Script/Latest.pm @@ -8,8 +8,7 @@ use Moose; use MooseX::Aliases; use Parse::CPAN::Packages::Fast; use CPAN::DistnameInfo; -use Regexp::Common qw(time); -use Time::Local qw( timelocal ); +use DateTime::Format::ISO8601 (); use MetaCPAN::Types::TypeTiny qw( Bool Str ); with 'MetaCPAN::Role::Script', 'MooseX::Getopt'; @@ -165,6 +164,10 @@ sub run { eval { $p->package( $_->{name} ) } } @{ $file_data->{module} }; + $file_data->{date} + = DateTime::Format::ISO8601->parse_datetime( + $file_data->{date} ); + # For each of the packages in this file... foreach my $module (@modules) { @@ -193,12 +196,7 @@ sub run { # If multiple versions of a dist appear in 02packages # only mark the most recent upload as latest. next - if ( - $upgrade - && $self->compare_dates( - $upgrade->{date}, $file_data->{date} - ) - ); + if $upgrade && $upgrade->{date} > $file_data->{date}; $upgrade{ $file_data->{distribution} } = $file_data; } elsif ( $file_data->{status} eq 'latest' ) { @@ -291,16 +289,6 @@ sub reindex { } -sub compare_dates { - my ( $self, $d1, $d2 ) = @_; - for ( $d1, $d2 ) { - if ( $_ =~ /$RE{time}{iso}{-keep}/ ) { - $_ = timelocal( $7, $6, $5, $4, $3 - 1, $2 ); - } - } - return $d1 > $d2; -} - __PACKAGE__->meta->make_immutable; 1; From ee29ed31988a6e7a5ae29bc798857975350f443c Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 18 Jun 2024 17:31:26 +0200 Subject: [PATCH 04/22] note why Authen::SASL is in cpanfile --- cpanfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpanfile b/cpanfile index 275e3b482..601249406 100644 --- a/cpanfile +++ b/cpanfile @@ -5,7 +5,7 @@ requires 'perl', '5.010'; requires 'Archive::Any', '0.0946'; requires 'Archive::Tar', '2.40'; -requires 'Authen::SASL', '2.16'; +requires 'Authen::SASL', '2.16'; # for Email::Sender::Transport::SMTP requires 'BackPAN::Index', '0.42'; requires 'Captcha::reCAPTCHA', '0.99'; requires 'Catalyst', '5.90128'; From 3b62aa9a5554ca8d3b02131827549f84ee738ec8 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 18 Jun 2024 18:42:24 +0200 Subject: [PATCH 05/22] Catalyst wants Term::Size::Any --- cpanfile | 1 + 1 file changed, 1 insertion(+) diff --git a/cpanfile b/cpanfile index 601249406..b9b264019 100644 --- a/cpanfile +++ b/cpanfile @@ -141,6 +141,7 @@ requires 'Scalar::Util', '1.62'; # Moose requires 'Search::Elasticsearch', '== 2.03'; requires 'Term::Choose', '1.754'; # Git::Helpers requires 'Throwable::Error'; +requires 'Term::Size::Any'; # for Catalyst requires 'Text::CSV_XS'; requires 'Try::Tiny', '0.30'; requires 'Type::Tiny', '2.000001'; From 3663340399375b9ef9174663b2cbeaf2164c35fd Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 18 Jun 2024 18:18:50 +0200 Subject: [PATCH 06/22] remove unused dep BackPAN::Index --- cpanfile | 1 - cpanfile.snapshot | 322 --------------------------------- lib/MetaCPAN/Script/Backpan.pm | 3 +- 3 files changed, 1 insertion(+), 325 deletions(-) diff --git a/cpanfile b/cpanfile index b9b264019..a8caa5f74 100644 --- a/cpanfile +++ b/cpanfile @@ -6,7 +6,6 @@ requires 'perl', '5.010'; requires 'Archive::Any', '0.0946'; requires 'Archive::Tar', '2.40'; requires 'Authen::SASL', '2.16'; # for Email::Sender::Transport::SMTP -requires 'BackPAN::Index', '0.42'; requires 'Captcha::reCAPTCHA', '0.99'; requires 'Catalyst', '5.90128'; requires 'Catalyst::Action::RenderView', '0.16'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 4dcea035c..ed013953d 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -1,13 +1,5 @@ # carton snapshot format: version 1.0 DISTRIBUTIONS - Algorithm-C3-0.11 - pathname: H/HA/HAARG/Algorithm-C3-0.11.tar.gz - provides: - Algorithm::C3 0.11 - requirements: - Carp 0.01 - ExtUtils::MakeMaker 0 - perl 5.006 Algorithm-Diff-1.201 pathname: R/RJ/RJBS/Algorithm-Diff-1.201.tar.gz provides: @@ -32,21 +24,6 @@ DISTRIBUTIONS POSIX::strftime::Compiler 0.30 Time::Local 0 perl 5.008001 - App-Cache-0.37 - pathname: L/LB/LBROCARD/App-Cache-0.37.tar.gz - provides: - App::Cache 0.37 - requirements: - Class::Accessor::Chained::Fast 0 - ExtUtils::MakeMaker 0 - File::Find::Rule 0 - File::HomeDir 0 - File::stat 0 - HTTP::Cookies 0 - LWP::UserAgent 0 - Path::Class 0 - Storable 0 - Test::More 0 Archive-Any-0.0946 pathname: O/OA/OALDERS/Archive-Any-0.0946.tar.gz provides: @@ -183,38 +160,6 @@ DISTRIBUTIONS requirements: B 0 ExtUtils::MakeMaker 0 - BackPAN-Index-0.42 - pathname: M/MS/MSCHWERN/BackPAN-Index-0.42.tar.gz - provides: - BackPAN::Index 0.42 - BackPAN::Index::Database 0 - BackPAN::Index::Dist 0 - BackPAN::Index::File 0 - BackPAN::Index::IndexFile 0 - BackPAN::Index::Release 0 - BackPAN::Index::Role::AsHash 0 - BackPAN::Index::Role::HasCache 0 - BackPAN::Index::Role::Log 0 - BackPAN::Index::Schema 0 - BackPAN::Index::Types 0 - Parse::BACKPAN::Packages 0.40 - requirements: - App::Cache 0.37 - Archive::Extract 0 - CLASS 1.00 - CPAN::DistnameInfo 0.09 - DBD::SQLite 1.25 - DBIx::Class 0.08109 - LWP::Simple 0 - Module::Build 0.340201 - Mouse 0.64 - Path::Class 0.17 - Test::Compile 0.11 - Test::More 0.90 - URI 1.54 - autodie 0 - parent 0 - perl 5.008001 Browser-Open-0.04 pathname: C/CF/CFRANKS/Browser-Open-0.04.tar.gz provides: @@ -241,12 +186,6 @@ DISTRIBUTIONS Storable 0 Test::Deep 0 Test::More 0 - CLASS-v1.1.8 - pathname: J/JD/JDEGUEST/CLASS-v1.1.8.tar.gz - provides: - CLASS 1.001008 - requirements: - ExtUtils::MakeMaker 0 CPAN-Checksums-2.14 pathname: A/AN/ANDK/CPAN-Checksums-2.14.tar.gz provides: @@ -707,33 +646,12 @@ DISTRIBUTIONS requirements: Class::Accessor 0 Test::More 0 - Class-Accessor-Grouped-0.10014 - pathname: H/HA/HAARG/Class-Accessor-Grouped-0.10014.tar.gz - provides: - Class::Accessor::Grouped 0.10014 - requirements: - Carp 0 - Class::XSAccessor 1.19 - ExtUtils::MakeMaker 0 - Module::Runtime 0.012 - Scalar::Util 0 - Sub::Name 0.05 - perl 5.006 Class-Accessor-Lite-0.08 pathname: K/KA/KAZUHO/Class-Accessor-Lite-0.08.tar.gz provides: Class::Accessor::Lite 0.08 requirements: ExtUtils::MakeMaker 6.36 - Class-C3-0.35 - pathname: H/HA/HAARG/Class-C3-0.35.tar.gz - provides: - Class::C3 0.35 - requirements: - Algorithm::C3 0.07 - ExtUtils::MakeMaker 0 - Scalar::Util 0 - perl 5.006 Class-C3-Adopt-NEXT-0.14 pathname: E/ET/ETHER/Class-C3-Adopt-NEXT-0.14.tar.gz provides: @@ -747,17 +665,6 @@ DISTRIBUTIONS strict 0 warnings 0 warnings::register 0 - Class-C3-Componentised-1.001002 - pathname: H/HA/HAARG/Class-C3-Componentised-1.001002.tar.gz - provides: - Class::C3::Componentised 1.001002 - Class::C3::Componentised::ApplyHooks undef - requirements: - Class::C3 0.20 - Class::Inspector 1.32 - ExtUtils::MakeMaker 0 - MRO::Compat 0.09 - perl 5.006002 Class-Data-Inheritable-0.09 pathname: R/RS/RSHERER/Class-Data-Inheritable-0.09.tar.gz provides: @@ -1052,18 +959,6 @@ DISTRIBUTIONS perl 5.008 strict 0 warnings 0 - Context-Preserve-0.03 - pathname: E/ET/ETHER/Context-Preserve-0.03.tar.gz - provides: - Context::Preserve 0.03 - requirements: - Carp 0 - Exporter 0 - ExtUtils::MakeMaker 0 - base 0 - perl 5.006 - strict 0 - warnings 0 Cookie-Baker-0.12 pathname: K/KA/KAZEBURO/Cookie-Baker-0.12.tar.gz provides: @@ -1222,128 +1117,6 @@ DISTRIBUTIONS ExtUtils::MakeMaker 6.48 Test::Simple 0.90 perl 5.008001 - DBIx-Class-0.082843 - pathname: R/RI/RIBASUSHI/DBIx-Class-0.082843.tar.gz - provides: - DBIx::Class 0.082843 - DBIx::Class::AccessorGroup undef - DBIx::Class::Admin undef - DBIx::Class::CDBICompat undef - DBIx::Class::Core undef - DBIx::Class::Cursor undef - DBIx::Class::DB undef - DBIx::Class::Exception undef - DBIx::Class::FilterColumn undef - DBIx::Class::InflateColumn undef - DBIx::Class::InflateColumn::DateTime undef - DBIx::Class::InflateColumn::File undef - DBIx::Class::Optional::Dependencies undef - DBIx::Class::Ordered undef - DBIx::Class::PK undef - DBIx::Class::PK::Auto undef - DBIx::Class::Relationship undef - DBIx::Class::Relationship::Base undef - DBIx::Class::ResultClass::HashRefInflator undef - DBIx::Class::ResultSet undef - DBIx::Class::ResultSet::Pager undef - DBIx::Class::ResultSetColumn undef - DBIx::Class::ResultSetManager undef - DBIx::Class::ResultSource undef - DBIx::Class::ResultSource::Table undef - DBIx::Class::ResultSource::View undef - DBIx::Class::ResultSourceHandle undef - DBIx::Class::ResultSourceProxy::Table undef - DBIx::Class::Row undef - DBIx::Class::SQLMaker undef - DBIx::Class::SQLMaker::ClassicExtensions undef - DBIx::Class::SQLMaker::LimitDialects undef - DBIx::Class::SQLMaker::OracleJoins undef - DBIx::Class::Schema undef - DBIx::Class::Schema::Versioned undef - DBIx::Class::Serialize::Storable undef - DBIx::Class::StartupCheck undef - DBIx::Class::Storage undef - DBIx::Class::Storage::DBI undef - DBIx::Class::Storage::DBI::ACCESS undef - DBIx::Class::Storage::DBI::ADO undef - DBIx::Class::Storage::DBI::ADO::MS_Jet undef - DBIx::Class::Storage::DBI::ADO::MS_Jet::Cursor undef - DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server undef - DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server::Cursor undef - DBIx::Class::Storage::DBI::AutoCast undef - DBIx::Class::Storage::DBI::Cursor undef - DBIx::Class::Storage::DBI::DB2 undef - DBIx::Class::Storage::DBI::Firebird undef - DBIx::Class::Storage::DBI::Firebird::Common undef - DBIx::Class::Storage::DBI::IdentityInsert undef - DBIx::Class::Storage::DBI::Informix undef - DBIx::Class::Storage::DBI::InterBase undef - DBIx::Class::Storage::DBI::MSSQL undef - DBIx::Class::Storage::DBI::NoBindVars undef - DBIx::Class::Storage::DBI::ODBC undef - DBIx::Class::Storage::DBI::ODBC::ACCESS undef - DBIx::Class::Storage::DBI::ODBC::DB2_400_SQL undef - DBIx::Class::Storage::DBI::ODBC::Firebird undef - DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server undef - DBIx::Class::Storage::DBI::ODBC::SQL_Anywhere undef - DBIx::Class::Storage::DBI::Oracle undef - DBIx::Class::Storage::DBI::Oracle::Generic undef - DBIx::Class::Storage::DBI::Oracle::WhereJoins undef - DBIx::Class::Storage::DBI::Pg undef - DBIx::Class::Storage::DBI::Replicated undef - DBIx::Class::Storage::DBI::Replicated::Balancer undef - DBIx::Class::Storage::DBI::Replicated::Balancer::First undef - DBIx::Class::Storage::DBI::Replicated::Balancer::Random undef - DBIx::Class::Storage::DBI::Replicated::Pool undef - DBIx::Class::Storage::DBI::Replicated::Replicant undef - DBIx::Class::Storage::DBI::Replicated::WithDSN undef - DBIx::Class::Storage::DBI::SQLAnywhere undef - DBIx::Class::Storage::DBI::SQLAnywhere::Cursor undef - DBIx::Class::Storage::DBI::SQLite undef - DBIx::Class::Storage::DBI::Sybase undef - DBIx::Class::Storage::DBI::Sybase::ASE undef - DBIx::Class::Storage::DBI::Sybase::ASE::NoBindVars undef - DBIx::Class::Storage::DBI::Sybase::FreeTDS undef - DBIx::Class::Storage::DBI::Sybase::MSSQL undef - DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server undef - DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::NoBindVars undef - DBIx::Class::Storage::DBI::UniqueIdentifier undef - DBIx::Class::Storage::DBI::mysql undef - DBIx::Class::Storage::Debug::PrettyTrace undef - DBIx::Class::Storage::Statistics undef - DBIx::Class::Storage::TxnScopeGuard undef - DBIx::Class::UTF8Columns undef - SQL::Translator::Parser::DBIx::Class 1.10 - SQL::Translator::Producer::DBIx::Class::File 0.1 - requirements: - Class::Accessor::Grouped 0.10012 - Class::C3::Componentised 1.0009 - Class::Inspector 1.24 - Config::Any 0.20 - Context::Preserve 0.01 - DBD::SQLite 1.29 - DBI 1.57 - Data::Dumper::Concise 2.020 - Devel::GlobalDestruction 0.09 - ExtUtils::MakeMaker 6.59 - File::Temp 0.22 - Hash::Merge 0.12 - MRO::Compat 0.12 - Module::Find 0.07 - Moo 2.000 - Package::Stash 0.28 - Path::Class 0.18 - SQL::Abstract::Classic 1.91 - Scope::Guard 0.03 - Sub::Name 0.04 - Test::Deep 0.101 - Test::Exception 0.31 - Test::More 0.94 - Test::Warn 0.21 - Text::Balanced 2.00 - Try::Tiny 0.07 - namespace::clean 0.24 - perl 5.008001 Data-Compare-1.29 pathname: D/DC/DCANTRELL/Data-Compare-1.29.tar.gz provides: @@ -2015,19 +1788,6 @@ DISTRIBUTIONS perl 5.008004 strict 0 warnings 0 - Devel-CheckCompiler-0.07 - pathname: S/SY/SYOHEX/Devel-CheckCompiler-0.07.tar.gz - provides: - Devel::AssertC99 undef - Devel::CheckCompiler 0.07 - requirements: - Exporter 0 - ExtUtils::CBuilder 0 - File::Temp 0 - Module::Build::Tiny 0.035 - Test::More 0.98 - parent 0 - perl 5.008001 Devel-Confess-0.009004 pathname: H/HA/HAARG/Devel-Confess-0.009004.tar.gz provides: @@ -3917,21 +3677,6 @@ DISTRIBUTIONS perl 5.006 strict 0 warnings 0 - Module-Build-XSUtil-0.19 - pathname: H/HI/HIDEAKIO/Module-Build-XSUtil-0.19.tar.gz - provides: - Module::Build::XSUtil 0.19 - requirements: - Devel::CheckCompiler 0 - Devel::PPPort 0 - Exporter 0 - ExtUtils::CBuilder 0 - File::Basename 0 - File::Path 0 - Module::Build 0.4005 - XSLoader 0 - parent 0 - perl 5.008001 Module-CPANfile-1.1004 pathname: M/MI/MIYAGAWA/Module-CPANfile-1.1004.tar.gz provides: @@ -5080,44 +4825,6 @@ DISTRIBUTIONS namespace::clean 0.19 overload 0 perl 5.008 - Mouse-v2.5.10 - pathname: S/SK/SKAJI/Mouse-v2.5.10.tar.gz - provides: - Mouse v2.5.10 - Mouse::Exporter undef - Mouse::Meta::Attribute undef - Mouse::Meta::Class undef - Mouse::Meta::Method undef - Mouse::Meta::Method::Accessor undef - Mouse::Meta::Method::Constructor undef - Mouse::Meta::Method::Delegation undef - Mouse::Meta::Method::Destructor undef - Mouse::Meta::Module undef - Mouse::Meta::Role undef - Mouse::Meta::Role::Application undef - Mouse::Meta::Role::Application::RoleSummation undef - Mouse::Meta::Role::Composite undef - Mouse::Meta::Role::Method undef - Mouse::Meta::TypeConstraint undef - Mouse::Object undef - Mouse::PurePerl undef - Mouse::Role v2.5.10 - Mouse::Spec v2.5.10 - Mouse::TypeRegistry undef - Mouse::Util v2.5.10 - Mouse::Util::MetaRole undef - Mouse::Util::TypeConstraints undef - Squirrel undef - Squirrel::Role undef - Test::Mouse undef - ouse undef - requirements: - ExtUtils::CBuilder 0 - Module::Build 0.4005 - Module::Build::XSUtil 0.19 - Scalar::Util 1.14 - XSLoader 0.02 - perl 5.008005 Mozilla-CA-20240313 pathname: L/LW/LWP/Mozilla-CA-20240313.tar.gz provides: @@ -6721,25 +6428,6 @@ DISTRIBUTIONS Test::Deep 0.101 Text::Balanced 2.00 perl 5.006 - SQL-Abstract-Classic-1.91 - pathname: R/RI/RIBASUSHI/SQL-Abstract-Classic-1.91.tar.gz - provides: - SQL::Abstract::Classic 1.91 - SQL::Abstract::Util undef - requirements: - Exporter 5.57 - ExtUtils::MakeMaker 6.59 - List::Util 0 - MRO::Compat 0.12 - SQL::Abstract 1.79 - Scalar::Util 0 - Storable 0 - Test::Deep 0.101 - Test::Exception 0.31 - Test::More 0.88 - Test::Warn 0 - Text::Balanced 2.00 - perl 5.006 SQL-Abstract-Pg-1.0 pathname: S/SR/SRI/SQL-Abstract-Pg-1.0.tar.gz provides: @@ -7168,16 +6856,6 @@ DISTRIBUTIONS perl 5.012 strict 0 warnings 0 - Test-Compile-v3.3.3 - pathname: E/EG/EGILES/Test-Compile-v3.3.3.tar.gz - provides: - Test::Compile v3.3.3 - Test::Compile::Internal v3.3.3 - requirements: - Exporter 5.68 - Module::Build 0.38 - parent 0.225 - perl v5.10.0 Test-Deep-1.204 pathname: R/RJ/RJBS/Test-Deep-1.204.tar.gz provides: diff --git a/lib/MetaCPAN/Script/Backpan.pm b/lib/MetaCPAN/Script/Backpan.pm index 2bb4cc39e..5de6c4897 100644 --- a/lib/MetaCPAN/Script/Backpan.pm +++ b/lib/MetaCPAN/Script/Backpan.pm @@ -5,8 +5,7 @@ use warnings; use Moose; -use Log::Contextual qw( :log :dlog ); -use BackPAN::Index; +use Log::Contextual qw( :log :dlog ); use MetaCPAN::Types::TypeTiny qw( Bool HashRef Str ); with 'MetaCPAN::Role::Script', 'MooseX::Getopt::Dashes'; From 256b1e1e91258f38a8b074752fa3f6d36d00a7ed Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 15:23:20 +0200 Subject: [PATCH 07/22] remove unused dep Plack::Middleware::ServerStatus::Lite --- cpanfile | 1 - cpanfile.snapshot | 41 ----------------------------------------- lib/MetaCPAN/Server.pm | 1 - 3 files changed, 43 deletions(-) diff --git a/cpanfile b/cpanfile index a8caa5f74..836edca14 100644 --- a/cpanfile +++ b/cpanfile @@ -127,7 +127,6 @@ requires 'Plack::App::Directory'; requires 'Plack::Middleware::Header'; requires 'Plack::Middleware::ReverseProxy'; requires 'Plack::Middleware::Rewrite'; -requires 'Plack::Middleware::ServerStatus::Lite'; requires 'Plack::Middleware::Session'; requires 'Plack::Session::Store'; requires 'Pod::Markdown', '3.300'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index ed013953d..eaa5a2da9 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -646,12 +646,6 @@ DISTRIBUTIONS requirements: Class::Accessor 0 Test::More 0 - Class-Accessor-Lite-0.08 - pathname: K/KA/KAZUHO/Class-Accessor-Lite-0.08.tar.gz - provides: - Class::Accessor::Lite 0.08 - requirements: - ExtUtils::MakeMaker 6.36 Class-C3-Adopt-NEXT-0.14 pathname: E/ET/ETHER/Class-C3-Adopt-NEXT-0.14.tar.gz provides: @@ -4831,13 +4825,6 @@ DISTRIBUTIONS Mozilla::CA 20240313 requirements: ExtUtils::MakeMaker 0 - Net-CIDR-Lite-0.22 - pathname: S/ST/STIGTSP/Net-CIDR-Lite-0.22.tar.gz - provides: - Net::CIDR::Lite 0.22 - Net::CIDR::Lite::Span 0.22 - requirements: - ExtUtils::MakeMaker 0 Net-DNS-1.45 pathname: N/NL/NLNETLABS/Net-DNS-1.45.tar.gz provides: @@ -5529,20 +5516,6 @@ DISTRIBUTIONS perl 5.006 strict 0 warnings 0 - Parallel-Scoreboard-0.08 - pathname: K/KA/KAZUHO/Parallel-Scoreboard-0.08.tar.gz - provides: - Parallel::Scoreboard 0.08 - Parallel::Scoreboard::PSGI::App undef - Parallel::Scoreboard::PSGI::App::JSON undef - requirements: - Class::Accessor::Lite 0.05 - ExtUtils::MakeMaker 6.36 - File::Temp 0 - HTML::Entities 0 - JSON 0 - Test::More 0 - Test::Warn 0 Params-Util-1.102 pathname: R/RE/REHSACK/Params-Util-1.102.tar.gz provides: @@ -6167,20 +6140,6 @@ DISTRIBUTIONS Plack::Util::Accessor 0 overload 0 perl 5.006 - Plack-Middleware-ServerStatus-Lite-0.36 - pathname: K/KA/KAZEBURO/Plack-Middleware-ServerStatus-Lite-0.36.tar.gz - provides: - Plack::Middleware::ServerStatus::Lite 0.36 - requirements: - Getopt::Long 2.38 - JSON 2.53 - Module::Build 0.38 - Net::CIDR::Lite 0 - Parallel::Scoreboard 0.03 - Plack::Middleware 0 - Pod::Usage 0 - Try::Tiny 0.09 - parent 0 Plack-Middleware-Session-0.33 pathname: M/MI/MIYAGAWA/Plack-Middleware-Session-0.33.tar.gz provides: diff --git a/lib/MetaCPAN/Server.pm b/lib/MetaCPAN/Server.pm index d477ffbeb..a54486e98 100644 --- a/lib/MetaCPAN/Server.pm +++ b/lib/MetaCPAN/Server.pm @@ -9,7 +9,6 @@ use Digest::SHA (); use Log::Log4perl::Catalyst; use Plack::Builder qw( builder enable ); use Plack::Middleware::ReverseProxy; -use Plack::Middleware::ServerStatus::Lite; use Ref::Util qw( is_arrayref is_hashref ); extends 'Catalyst'; From bea9a5ac91212dfd3aebc74a965d64b4a3a070e8 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 15:23:57 +0200 Subject: [PATCH 08/22] remove unused dep MooseX::Aliases --- cpanfile | 1 - cpanfile.snapshot | 11 ----------- lib/MetaCPAN/Script/Latest.pm | 1 - 3 files changed, 13 deletions(-) diff --git a/cpanfile b/cpanfile index 836edca14..efcb5e1c2 100644 --- a/cpanfile +++ b/cpanfile @@ -101,7 +101,6 @@ requires 'Mojolicious::Plugin::OpenAPI'; requires 'Mojolicious::Plugin::Web::Auth', '0.17'; requires 'Mojo::Pg', '4.08'; requires 'Moose', '2.2201'; -requires 'MooseX::Aliases'; requires 'MooseX::Attribute::Deflator', '2.1.5'; requires 'MooseX::ChainedAccessors'; requires 'MooseX::ClassAttribute'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index eaa5a2da9..218457d61 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -4544,17 +4544,6 @@ DISTRIBUTIONS parent 0.223 strict 1.03 warnings 1.03 - MooseX-Aliases-0.11 - pathname: D/DO/DOY/MooseX-Aliases-0.11.tar.gz - provides: - MooseX::Aliases 0.11 - requirements: - ExtUtils::MakeMaker 6.30 - Moose 2.0000 - Moose::Exporter 0 - Moose::Role 0 - Moose::Util::TypeConstraints 0 - Scalar::Util 0 MooseX-Attribute-Chained-1.0.3 pathname: T/TO/TOMHUKINS/MooseX-Attribute-Chained-1.0.3.tar.gz provides: diff --git a/lib/MetaCPAN/Script/Latest.pm b/lib/MetaCPAN/Script/Latest.pm index 438166071..7bc407ca4 100644 --- a/lib/MetaCPAN/Script/Latest.pm +++ b/lib/MetaCPAN/Script/Latest.pm @@ -5,7 +5,6 @@ use warnings; use Log::Contextual qw( :log ); use Moose; -use MooseX::Aliases; use Parse::CPAN::Packages::Fast; use CPAN::DistnameInfo; use DateTime::Format::ISO8601 (); From 03201d2d8430f597ed4b929911d6bc0f022349be Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 15:24:42 +0200 Subject: [PATCH 09/22] remove unused dep Catalyst::Plugin::Unicode::Encoding --- cpanfile | 1 - 1 file changed, 1 deletion(-) diff --git a/cpanfile b/cpanfile index efcb5e1c2..26dbae02c 100644 --- a/cpanfile +++ b/cpanfile @@ -16,7 +16,6 @@ requires 'Catalyst::Plugin::Session', '0.43'; requires 'Catalyst::Plugin::Session::State::Cookie'; requires 'Catalyst::Plugin::Session::Store'; requires 'Catalyst::Plugin::Static::Simple'; -requires 'Catalyst::Plugin::Unicode::Encoding'; requires 'Catalyst::View::JSON', '0.37'; requires 'CatalystX::Fastly::Role::Response', '0.06'; requires 'CatalystX::InjectComponent'; From 89dbb214bd65c42f9c18cb254271fec10fbf0c03 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 15:26:18 +0200 Subject: [PATCH 10/22] remove unused dep Data::DPath --- cpanfile | 1 - cpanfile.snapshot | 56 ----------------------------------------------- 2 files changed, 57 deletions(-) diff --git a/cpanfile b/cpanfile index 26dbae02c..85e7d54a2 100644 --- a/cpanfile +++ b/cpanfile @@ -31,7 +31,6 @@ requires 'CPAN::Meta::Requirements', '2.140'; requires 'CPAN::Meta::YAML', '0.018'; requires 'CPAN::Repository::Perms'; requires 'Cwd'; -requires 'Data::DPath'; requires 'Data::Dumper'; requires 'DateTime', '1.54'; requires 'DateTime::Format::ISO8601'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 218457d61..e5a522215 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -1123,34 +1123,6 @@ DISTRIBUTIONS Scalar::Util 0 Test::More 0.88 perl 5.006 - Data-DPath-0.59 - pathname: S/SC/SCHWIGON/Data-DPath-0.59.tar.gz - provides: - Data::DPath 0.59 - Data::DPath::Attrs 0.59 - Data::DPath::Context 0.59 - Data::DPath::Filters 0.59 - Data::DPath::Path 0.59 - Data::DPath::Point 0.59 - Data::DPath::Step 0.59 - requirements: - Class::XSAccessor 0 - Class::XSAccessor::Array 0 - Data::Dumper 0 - ExtUtils::MakeMaker 0 - Iterator::Util 0 - List::Util 1.45 - POSIX 0 - Safe 2.30 - Scalar::Util 0 - Sub::Exporter 0 - Text::Balanced 2.02 - aliased 0.33 - constant 0 - if 0 - perl 5.008 - strict 0 - warnings 0 Data-Dump-1.25 pathname: G/GA/GARU/Data-Dump-1.25.tar.gz provides: @@ -2933,23 +2905,6 @@ DISTRIBUTIONS perl 5.006 strict 0 warnings 0 - Iterator-0.03 - pathname: R/RO/ROODE/Iterator-0.03.tar.gz - provides: - Iterator 0.03 - requirements: - Exception::Class 1.21 - ExtUtils::MakeMaker 0 - Test::Simple 0.40 - Iterator-Util-0.02 - pathname: R/RO/ROODE/Iterator-Util-0.02.tar.gz - provides: - Iterator::Util 0.02 - requirements: - Exception::Class 1.21 - ExtUtils::MakeMaker 0 - Iterator 0.01 - Test::Simple 0.40 JSON-4.10 pathname: I/IS/ISHIGAKI/JSON-4.10.tar.gz provides: @@ -7867,17 +7822,6 @@ DISTRIBUTIONS requirements: ExtUtils::MakeMaker 0 perl 5.008001 - aliased-0.34 - pathname: E/ET/ETHER/aliased-0.34.tar.gz - provides: - aliased 0.34 - requirements: - Carp 0 - Exporter 0 - Module::Build::Tiny 0.039 - perl 5.006 - strict 0 - warnings 0 bareword-filehandles-0.007 pathname: I/IL/ILMARI/bareword-filehandles-0.007.tar.gz provides: From 4c86d9635511b9ad3655a1f627d9199fee664e11 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 15:26:46 +0200 Subject: [PATCH 11/22] remove unused dep Find::Lib --- cpanfile | 1 - cpanfile.snapshot | 8 -------- 2 files changed, 9 deletions(-) diff --git a/cpanfile b/cpanfile index 85e7d54a2..e06a3ce1b 100644 --- a/cpanfile +++ b/cpanfile @@ -59,7 +59,6 @@ requires 'File::pushd'; requires 'File::stat'; requires 'File::Temp'; requires 'FindBin'; -requires 'Find::Lib'; requires 'Getopt::Long::Descriptive', '0.103'; requires 'Git::Helpers', '1.000001'; requires 'Gravatar::URL'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index e5a522215..52f6dcfe5 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -2407,14 +2407,6 @@ DISTRIBUTIONS requirements: ExtUtils::MakeMaker 0 perl 5.008001 - Find-Lib-1.04 - pathname: Y/YA/YANNK/Find-Lib-1.04.tar.gz - provides: - Find::Lib 1.04 - requirements: - ExtUtils::MakeMaker 0 - File::Spec 0 - Test::More 0 Getopt-Long-2.58 pathname: J/JV/JV/Getopt-Long-2.58.tar.gz provides: From e46564fd3f263f7dc1fba3593993e068c6ab54cd Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 15:27:41 +0200 Subject: [PATCH 12/22] remove unused dep MooseX::ChainedAccessors --- cpanfile | 1 - cpanfile.snapshot | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/cpanfile b/cpanfile index e06a3ce1b..0e17813e6 100644 --- a/cpanfile +++ b/cpanfile @@ -99,7 +99,6 @@ requires 'Mojolicious::Plugin::Web::Auth', '0.17'; requires 'Mojo::Pg', '4.08'; requires 'Moose', '2.2201'; requires 'MooseX::Attribute::Deflator', '2.1.5'; -requires 'MooseX::ChainedAccessors'; requires 'MooseX::ClassAttribute'; requires 'MooseX::Fastly::Role', '0.02'; requires 'MooseX::Getopt', '0.71'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 52f6dcfe5..460ba4ded 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -4491,23 +4491,6 @@ DISTRIBUTIONS parent 0.223 strict 1.03 warnings 1.03 - MooseX-Attribute-Chained-1.0.3 - pathname: T/TO/TOMHUKINS/MooseX-Attribute-Chained-1.0.3.tar.gz - provides: - Moose::Meta::Attribute::Custom::Trait::Chained v1.0.3 - MooseX::Attribute::Chained v1.0.3 - MooseX::Attribute::Chained::Method::Accessor v1.0.3 - MooseX::Attribute::ChainedClone v1.0.3 - MooseX::Attribute::ChainedClone::Method::Accessor v1.0.3 - MooseX::ChainedAccessors v1.0.3 - MooseX::ChainedAccessors::Accessor v1.0.3 - MooseX::Traits::Attribute::Chained v1.0.3 - MooseX::Traits::Attribute::ChainedClone v1.0.3 - requirements: - Module::Build 0.28 - Moose 0 - Test::More 0.88 - Try::Tiny 0 MooseX-Attribute-Deflator-2.2.2 pathname: P/PE/PERLER/MooseX-Attribute-Deflator-2.2.2.tar.gz provides: From 363122144ff80a1d637dee5f6c6e5400564040a8 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 15:28:12 +0200 Subject: [PATCH 13/22] remove unused dep MooseX::ClassAttribute --- cpanfile | 1 - cpanfile.snapshot | 27 --------------------------- 2 files changed, 28 deletions(-) diff --git a/cpanfile b/cpanfile index 0e17813e6..853f93035 100644 --- a/cpanfile +++ b/cpanfile @@ -99,7 +99,6 @@ requires 'Mojolicious::Plugin::Web::Auth', '0.17'; requires 'Mojo::Pg', '4.08'; requires 'Moose', '2.2201'; requires 'MooseX::Attribute::Deflator', '2.1.5'; -requires 'MooseX::ClassAttribute'; requires 'MooseX::Fastly::Role', '0.02'; requires 'MooseX::Getopt', '0.71'; requires 'MooseX::Getopt::Dashes'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 460ba4ded..99d723b1d 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -4522,33 +4522,6 @@ DISTRIBUTIONS MooseX::Types::Structured 0 Test::More 0.88 Try::Tiny 0 - MooseX-ClassAttribute-0.29 - pathname: D/DR/DROLSKY/MooseX-ClassAttribute-0.29.tar.gz - provides: - MooseX::ClassAttribute 0.29 - MooseX::ClassAttribute::Meta::Role::Attribute 0.29 - MooseX::ClassAttribute::Trait::Application 0.29 - MooseX::ClassAttribute::Trait::Application::ToClass 0.29 - MooseX::ClassAttribute::Trait::Application::ToRole 0.29 - MooseX::ClassAttribute::Trait::Attribute 0.29 - MooseX::ClassAttribute::Trait::Class 0.29 - MooseX::ClassAttribute::Trait::Mixin::HasClassAttributes 0.29 - MooseX::ClassAttribute::Trait::Role 0.29 - MooseX::ClassAttribute::Trait::Role::Composite 0.29 - requirements: - ExtUtils::MakeMaker 0 - List::Util 1.45 - Moose 2.00 - Moose::Exporter 0 - Moose::Meta::Role::Attribute 0 - Moose::Role 0 - Moose::Util 0 - Moose::Util::MetaRole 0 - Scalar::Util 0 - namespace::autoclean 0.11 - namespace::clean 0.20 - strict 0 - warnings 0 MooseX-Emulate-Class-Accessor-Fast-0.009032 pathname: H/HA/HAARG/MooseX-Emulate-Class-Accessor-Fast-0.009032.tar.gz provides: From 65d49a36b38b42c3df20bc1bcdedb3fdbcef6dbe Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 15:29:12 +0200 Subject: [PATCH 14/22] remove direct dep on Module::Extract::Namespaces --- cpanfile | 1 - 1 file changed, 1 deletion(-) diff --git a/cpanfile b/cpanfile index 853f93035..dc9095946 100644 --- a/cpanfile +++ b/cpanfile @@ -153,7 +153,6 @@ requires 'Devel::Confess'; requires 'HTTP::Cookies', '6.10'; requires 'LWP::ConsoleLogger::Easy', '0.000044'; requires 'MetaCPAN::Client', '2.029000'; -requires 'Module::Extract::Namespaces', '1.023'; requires 'Module::Faker', '== 0.017'; requires 'Module::Faker::Dist', '== 0.017'; requires 'OrePAN2', '0.48'; From c0be20320be953d98c798fa96f41b022fd201fea Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 18 Jun 2024 17:39:40 +0200 Subject: [PATCH 15/22] convert OAuth2 controller into normal controller Rather than implementing the OAuth2 controller as a plugin that injects a controller, just make it a normal controller. This accomplishes the same thing but is simpler. --- cpanfile | 1 - cpanfile.snapshot | 11 ----------- lib/MetaCPAN/Server.pm | 1 - .../Server/Controller/OAuth2.pm} | 17 +---------------- 4 files changed, 1 insertion(+), 29 deletions(-) rename lib/{Catalyst/Plugin/OAuth2/Provider.pm => MetaCPAN/Server/Controller/OAuth2.pm} (91%) diff --git a/cpanfile b/cpanfile index dc9095946..93da34309 100644 --- a/cpanfile +++ b/cpanfile @@ -18,7 +18,6 @@ requires 'Catalyst::Plugin::Session::Store'; requires 'Catalyst::Plugin::Static::Simple'; requires 'Catalyst::View::JSON', '0.37'; requires 'CatalystX::Fastly::Role::Response', '0.06'; -requires 'CatalystX::InjectComponent'; requires 'CatalystX::RoleApplicator'; requires 'CHI', '0.61'; requires 'Config::General', '2.63'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 99d723b1d..63123656c 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -608,17 +608,6 @@ DISTRIBUTIONS Carp 0 ExtUtils::MakeMaker 0 Moose::Role 0 - CatalystX-InjectComponent-0.025 - pathname: R/RO/ROKR/CatalystX-InjectComponent-0.025.tar.gz - provides: - CatalystX::InjectComponent 0.025 - requirements: - Catalyst::Runtime 5.8 - Class::Inspector 0 - Devel::InnerPackage 0 - ExtUtils::MakeMaker 6.30 - Test::Most 0 - parent 0 CatalystX-RoleApplicator-0.005 pathname: H/HD/HDP/CatalystX-RoleApplicator-0.005.tar.gz provides: diff --git a/lib/MetaCPAN/Server.pm b/lib/MetaCPAN/Server.pm index a54486e98..bbc9f8c13 100644 --- a/lib/MetaCPAN/Server.pm +++ b/lib/MetaCPAN/Server.pm @@ -81,7 +81,6 @@ __PACKAGE__->setup( qw( Session::Store::ElasticSearch Session::State::Cookie Authentication - OAuth2::Provider ) ); sub app { diff --git a/lib/Catalyst/Plugin/OAuth2/Provider.pm b/lib/MetaCPAN/Server/Controller/OAuth2.pm similarity index 91% rename from lib/Catalyst/Plugin/OAuth2/Provider.pm rename to lib/MetaCPAN/Server/Controller/OAuth2.pm index a04eb5db6..f044c443a 100644 --- a/lib/Catalyst/Plugin/OAuth2/Provider.pm +++ b/lib/MetaCPAN/Server/Controller/OAuth2.pm @@ -1,19 +1,4 @@ -package Catalyst::Plugin::OAuth2::Provider; -use Moose::Role; -use CatalystX::InjectComponent; - -after 'setup_components' => sub { - my $class = shift; - CatalystX::InjectComponent->inject( - into => $class, - component => 'Catalyst::Plugin::OAuth2::Provider::Controller', - as => 'Controller::OAuth2', - ); -}; - -1; - -package Catalyst::Plugin::OAuth2::Provider::Controller; +package MetaCPAN::Server::Controller::OAuth2; use Moose; BEGIN { extends 'Catalyst::Controller' } From d5c9dc3bde4adda8ce034df2910d7494ae6741f5 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 18 Jun 2024 17:55:02 +0200 Subject: [PATCH 16/22] use Catalyst's request_class_traits instead of CatalystX::RoleApplicator --- cpanfile | 1 - cpanfile.snapshot | 19 ------------------- lib/MetaCPAN/Server.pm | 5 ++--- 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/cpanfile b/cpanfile index 93da34309..b59971136 100644 --- a/cpanfile +++ b/cpanfile @@ -18,7 +18,6 @@ requires 'Catalyst::Plugin::Session::Store'; requires 'Catalyst::Plugin::Static::Simple'; requires 'Catalyst::View::JSON', '0.37'; requires 'CatalystX::Fastly::Role::Response', '0.06'; -requires 'CatalystX::RoleApplicator'; requires 'CHI', '0.61'; requires 'Config::General', '2.63'; requires 'Config::ZOMG', '1.000000'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 63123656c..615f83579 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -608,16 +608,6 @@ DISTRIBUTIONS Carp 0 ExtUtils::MakeMaker 0 Moose::Role 0 - CatalystX-RoleApplicator-0.005 - pathname: H/HD/HDP/CatalystX-RoleApplicator-0.005.tar.gz - provides: - CatalystX::RoleApplicator 0.005 - requirements: - Catalyst::Runtime 5.7 - Class::MOP 0.80 - ExtUtils::MakeMaker 0 - Moose 0.73 - MooseX::RelatedClassRoles 0.003 Class-Accessor-0.51 pathname: K/KA/KASEI/Class-Accessor-0.51.tar.gz provides: @@ -4589,15 +4579,6 @@ DISTRIBUTIONS Moose::Util::MetaRole 0 namespace::autoclean 0.08 perl 5.006 - MooseX-RelatedClassRoles-0.004 - pathname: H/HD/HDP/MooseX-RelatedClassRoles-0.004.tar.gz - provides: - MooseX::RelatedClassRoles 0.004 - requirements: - Class::MOP 0.80 - ExtUtils::MakeMaker 0 - Moose 0.73 - MooseX::Role::Parameterized 0.04 MooseX-Role-Parameterized-1.11 pathname: E/ET/ETHER/MooseX-Role-Parameterized-1.11.tar.gz provides: diff --git a/lib/MetaCPAN/Server.pm b/lib/MetaCPAN/Server.pm index bbc9f8c13..498959cc5 100644 --- a/lib/MetaCPAN/Server.pm +++ b/lib/MetaCPAN/Server.pm @@ -4,7 +4,6 @@ use Moose; ## no critic (Modules::RequireEndWithOne) use Catalyst qw( +MetaCPAN::Role::Fastly::Catalyst ), '-Log=warn,error,fatal'; -use CatalystX::RoleApplicator; use Digest::SHA (); use Log::Log4perl::Catalyst; use Plack::Builder qw( builder enable ); @@ -19,11 +18,11 @@ sub clear_stash { %{ $_[0]->stash } = (); } -__PACKAGE__->apply_request_class_roles( qw( +__PACKAGE__->request_class_traits( [ qw( Catalyst::TraitFor::Request::REST Catalyst::TraitFor::Request::REST::ForBrowsers MetaCPAN::Server::Role::Request -) ); +) ] ); __PACKAGE__->config( encoding => 'UTF-8', default_view => 'JSON', From b538eb5e2daaf23963082a3cdbfc2238a8a240a6 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 18 Jun 2024 18:25:27 +0200 Subject: [PATCH 17/22] run git rev-parse --show-toplevel ourselves Git::Helpers has a bunch of prereqs and provides many functions, when the only thing we need is checkout_root. That is trivial to implement ourselves. In the future, we're likely to not even need the sub anymore. --- cpanfile.snapshot | 103 --------------------------------- lib/MetaCPAN/Role/HasConfig.pm | 6 +- lib/MetaCPAN/Role/Script.pm | 2 +- lib/MetaCPAN/Util.pm | 15 +++++ t/lib/MetaCPAN/TestHelpers.pm | 2 +- t/script/cover.t | 2 +- t/script/river.t | 2 +- 7 files changed, 22 insertions(+), 110 deletions(-) diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 615f83579..ac4fc5ccf 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -160,14 +160,6 @@ DISTRIBUTIONS requirements: B 0 ExtUtils::MakeMaker 0 - Browser-Open-0.04 - pathname: C/CF/CFRANKS/Browser-Open-0.04.tar.gz - provides: - Browser::Open 0.04 - requirements: - ExtUtils::MakeMaker 0 - Test::More 0.92 - parent 0 CGI-Simple-1.281 pathname: M/MA/MANWAR/CGI-Simple-1.281.tar.gz provides: @@ -2414,47 +2406,6 @@ DISTRIBUTIONS perl 5.012 strict 0 warnings 0 - Git-Helpers-1.000001 - pathname: O/OA/OALDERS/Git-Helpers-1.000001.tar.gz - provides: - Git::Helpers 1.000001 - Git::Helpers::CPAN 1.000001 - requirements: - Browser::Open 0 - Capture::Tiny 0 - Carp 0 - ExtUtils::MakeMaker 0 - File::pushd 0 - Getopt::Long 0 - Git::Sub 0 - MetaCPAN::Client 2.029000 - Moo 0 - MooX::Options 0 - Pod::Usage 0 - String::Trim 0 - Sub::Exporter 0 - Term::Choose 1.743 - Try::Tiny 0 - Types::Standard 0 - URI 0 - URI::Heuristic 0 - URI::git 0 - perl v5.12.0 - strict 0 - warnings 0 - Git-Sub-0.163320 - pathname: D/DO/DOLMEN/Git-Sub-0.163320.tar.gz - provides: - Git::Sub 0.163320 - requirements: - Carp 0 - ExtUtils::MakeMaker 0 - File::Which 0 - System::Sub 0.162800 - perl 5.006 - strict 0 - subs 0 - warnings 0 Gravatar-URL-1.07 pathname: M/MS/MSCHWERN/Gravatar-URL-1.07.tar.gz provides: @@ -6586,23 +6537,6 @@ DISTRIBUTIONS perl 5.006 strict 0 warnings 0 - System-Sub-0.162800 - pathname: D/DO/DOLMEN/System-Sub-0.162800.tar.gz - provides: - System::Sub 0.162800 - System::Sub::AutoLoad 0.162800 - requirements: - Carp 0 - ExtUtils::MakeMaker 0 - File::Which 0 - IPC::Run 0 - Scalar::Util 1.11 - Sub::Name 0 - Symbol 0 - constant 0 - perl 5.006 - strict 0 - warnings 0 Task-Weaken-1.06 pathname: E/ET/ETHER/Task-Weaken-1.06.tar.gz provides: @@ -6614,34 +6548,6 @@ DISTRIBUTIONS Scalar::Util 1.14 perl 5.006 strict 0 - Term-Choose-1.765 - pathname: K/KU/KUERBIS/Term-Choose-1.765.tar.gz - provides: - Term::Choose 1.765 - Term::Choose::Constants 1.765 - Term::Choose::LineFold 1.765 - Term::Choose::LineFold::CharWidthAmbiguousWide 1.765 - Term::Choose::LineFold::CharWidthDefault 1.765 - Term::Choose::Linux 1.765 - Term::Choose::Opt::Mouse 1.765 - Term::Choose::Opt::Search 1.765 - Term::Choose::Opt::SkipItems 1.765 - Term::Choose::Screen 1.765 - Term::Choose::ValidateOptions 1.765 - Term::Choose::Win32 1.765 - requirements: - Carp 0 - Exporter 0 - ExtUtils::MakeMaker 0 - File::Spec::Functions 0 - FindBin 0 - Test::Fatal 0 - Test::More 0 - constant 0 - lib 0 - perl 5.010000 - strict 0 - warnings 0 Term-Size-Any-0.002 pathname: F/FE/FERREIRA/Term-Size-Any-0.002.tar.gz provides: @@ -7474,15 +7380,6 @@ DISTRIBUTIONS URI 1.40 URI::Nested 0.10 perl 5.008001 - URI-git-0.02 - pathname: M/MI/MIYAGAWA/URI-git-0.02.tar.gz - provides: - URI::git 0.02 - requirements: - ExtUtils::MakeMaker 6.42 - Filter::Util::Call 0 - Test::More 0 - URI 0 URI-ws-0.03 pathname: P/PL/PLICEASE/URI-ws-0.03.tar.gz provides: diff --git a/lib/MetaCPAN/Role/HasConfig.pm b/lib/MetaCPAN/Role/HasConfig.pm index 7c66d1650..8cf09202a 100644 --- a/lib/MetaCPAN/Role/HasConfig.pm +++ b/lib/MetaCPAN/Role/HasConfig.pm @@ -5,6 +5,7 @@ use Moose::Role; use FindBin (); use Config::ZOMG (); use MetaCPAN::Types::TypeTiny qw( HashRef ); +use MetaCPAN::Util qw( checkout_root ); use Module::Runtime qw( require_module ); # Done like this so can be required by a role @@ -24,13 +25,12 @@ sub _build_config { my $config = $self->_zomg("$FindBin::RealBin/.."); return $config if $config; - require_module('Git::Helpers'); - $config = $self->_zomg( Git::Helpers::checkout_root() ); + $config = $self->_zomg( checkout_root() ); return $config if $config; die "Couldn't find config file in $FindBin::RealBin/.. or " - . Git::Helpers::checkout_root(); + . checkout_root(); } sub _zomg { diff --git a/lib/MetaCPAN/Role/Script.pm b/lib/MetaCPAN/Role/Script.pm index 190ed1e82..389eb2e2b 100644 --- a/lib/MetaCPAN/Role/Script.pm +++ b/lib/MetaCPAN/Role/Script.pm @@ -3,7 +3,7 @@ package MetaCPAN::Role::Script; use Moose::Role; use ElasticSearchX::Model::Document::Types qw(:all); -use Git::Helpers qw( checkout_root ); +use MetaCPAN::Util qw( checkout_root ); use Log::Contextual qw( :log :dlog ); use MetaCPAN::Model (); use MetaCPAN::Types::TypeTiny qw( Bool HashRef Int Path Str ); diff --git a/lib/MetaCPAN/Util.pm b/lib/MetaCPAN/Util.pm index 96d2167dd..962ca4e97 100644 --- a/lib/MetaCPAN/Util.pm +++ b/lib/MetaCPAN/Util.pm @@ -8,6 +8,7 @@ use version; use Digest::SHA qw( sha1_base64 sha1_hex ); use Encode qw( decode_utf8 ); +use IPC::Run3 (); use Ref::Util qw( is_arrayref is_hashref @@ -17,6 +18,7 @@ use Ref::Util qw( ); use Sub::Exporter -setup => { exports => [ qw( + checkout_root author_dir diff_struct digest @@ -31,6 +33,19 @@ use Sub::Exporter -setup => { ) ] }; +sub checkout_root { + IPC::Run3::run3( [qw(git rev-parse --show-toplevel)], + \undef, \my $stdout, \my $stderr ); + if ($?) { + die $stderr; + } + chomp $stdout; + if ( !-d $stdout ) { + die "Failed to find git dir: '$stdout'"; + } + return $stdout; +} + sub digest { my $digest = sha1_base64( join( "\0", grep {defined} @_ ) ); $digest =~ tr/[+\/]/-_/; diff --git a/t/lib/MetaCPAN/TestHelpers.pm b/t/lib/MetaCPAN/TestHelpers.pm index 596c00ba7..c4ec252f1 100644 --- a/t/lib/MetaCPAN/TestHelpers.pm +++ b/t/lib/MetaCPAN/TestHelpers.pm @@ -8,7 +8,7 @@ use Cpanel::JSON::XS; use File::Copy qw( copy ); use File::pushd qw( pushd ); use FindBin; -use Git::Helpers qw( checkout_root ); +use MetaCPAN::Util qw( checkout_root ); use MetaCPAN::Script::Runner; use Path::Tiny qw( path ); use Test::More; diff --git a/t/script/cover.t b/t/script/cover.t index 62bf91073..09ba5fc6a 100644 --- a/t/script/cover.t +++ b/t/script/cover.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use Git::Helpers qw( checkout_root ); +use MetaCPAN::Util qw( checkout_root ); use MetaCPAN::Script::Cover (); use MetaCPAN::Script::Runner (); use Test::More; diff --git a/t/script/river.t b/t/script/river.t index 35d34ab54..faf8d7c46 100644 --- a/t/script/river.t +++ b/t/script/river.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use Git::Helpers qw( checkout_root ); +use MetaCPAN::Util qw( checkout_root ); use MetaCPAN::Script::River (); use MetaCPAN::Script::Runner (); use MetaCPAN::Server::Test qw( app GET test_psgi ); From 1cf0f53c309d872af40fcac789628fc37e2d7425 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Sat, 29 Jun 2024 10:40:36 +0200 Subject: [PATCH 18/22] Remove use of Data::Printer We don't declare a dependency on Data::Printer, but had a module using it. It was only used for logging, but Log::Contextual already has functions for printing data structures which we can use instead. --- lib/MetaCPAN/Script/Snapshot.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/MetaCPAN/Script/Snapshot.pm b/lib/MetaCPAN/Script/Snapshot.pm index ae391fb8f..e021f0b9f 100644 --- a/lib/MetaCPAN/Script/Snapshot.pm +++ b/lib/MetaCPAN/Script/Snapshot.pm @@ -6,9 +6,8 @@ use warnings; use Cpanel::JSON::XS qw( decode_json encode_json ); use DateTime (); use DateTime::Format::ISO8601 (); -use DDP; use HTTP::Tiny (); -use Log::Contextual qw( :log ); +use Log::Contextual qw( :log :dlog ); use MetaCPAN::Types::TypeTiny qw( ArrayRef Bool Str ); use Moose; use Sys::Hostname qw( hostname ); @@ -177,7 +176,7 @@ sub run_list_snaps { foreach my $snapshot ( @{ $data->{snapshots} || [] } ) { log_info { $snapshot->{snapshot} } - log_debug { np($snapshot) } + Dlog_debug {$_} $snapshot; } return $response; @@ -292,7 +291,7 @@ sub _request { try { my $resp_json = decode_json( $response->{content} ); - log_error { 'Error response: ' . np($resp_json) } + Dlog_error {"Error response: $_"} $resp_json; } catch { log_error { 'Error msg: ' . $response->{content} } From 621912f321c917d4f7f81b71014d5e07d9cf9252 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Tue, 18 Jun 2024 18:42:42 +0200 Subject: [PATCH 19/22] use simpler app for fetching in tests in one location The tests had multiple ways to do a simple HTTP request against the app. We don't need that. Removing one of them removes multiple modules and prereqs. --- cpanfile | 2 - cpanfile.snapshot | 274 ---------------------------- t/lib/MetaCPAN/TestApp.pm | 40 ---- t/lib/MetaCPAN/Tests/Release.pm | 8 +- t/lib/MetaCPAN/Tests/Role/HasApp.pm | 16 -- 5 files changed, 4 insertions(+), 336 deletions(-) delete mode 100644 t/lib/MetaCPAN/TestApp.pm delete mode 100644 t/lib/MetaCPAN/Tests/Role/HasApp.pm diff --git a/cpanfile b/cpanfile index b59971136..c1c97ea60 100644 --- a/cpanfile +++ b/cpanfile @@ -149,7 +149,6 @@ requires 'Code::TidyAll::Plugin::UniqueLines'; requires 'CPAN::Faker', '0.011'; requires 'Devel::Confess'; requires 'HTTP::Cookies', '6.10'; -requires 'LWP::ConsoleLogger::Easy', '0.000044'; requires 'MetaCPAN::Client', '2.029000'; requires 'Module::Faker', '== 0.017'; requires 'Module::Faker::Dist', '== 0.017'; @@ -157,7 +156,6 @@ requires 'OrePAN2', '0.48'; requires 'Parallel::ForkManager' => '2.02'; requires 'Perl::Critic', '0.140'; requires 'Perl::Tidy' => '== 20230309'; -requires 'Plack::Test::Agent', '1.5'; requires 'PPI', '1.274'; # Perl::Critic requires 'PPIx::QuoteLike', '0.022'; # Perl::Critic requires 'PPIx::Regexp', '0.085'; # Perl::Critic diff --git a/cpanfile.snapshot b/cpanfile.snapshot index ac4fc5ccf..c7023e265 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -313,17 +313,6 @@ DISTRIBUTIONS perl 5.006 strict 0 warnings 0 - Carp-Assert-More-2.4.0 - pathname: P/PE/PETDANCE/Carp-Assert-More-2.4.0.tar.gz - provides: - Carp::Assert::More 2.004000 - requirements: - Carp 0 - ExtUtils::MakeMaker 0 - Scalar::Util 0 - Test::Exception 0 - Test::More 0.18 - perl 5.010001 Carp-Clan-6.08 pathname: E/ET/ETHER/Carp-Clan-6.08.tar.gz provides: @@ -1131,47 +1120,6 @@ DISTRIBUTIONS perl 5.012 strict 0 warnings 0 - Data-Printer-1.002001 - pathname: G/GA/GARU/Data-Printer-1.002001.tar.gz - provides: - DDP 1.002001 - Data::Printer 1.002001 - Data::Printer::Common undef - Data::Printer::Config undef - Data::Printer::Filter undef - Data::Printer::Filter::ARRAY undef - Data::Printer::Filter::CODE undef - Data::Printer::Filter::ContentType undef - Data::Printer::Filter::DB undef - Data::Printer::Filter::DateTime undef - Data::Printer::Filter::Digest undef - Data::Printer::Filter::FORMAT undef - Data::Printer::Filter::GLOB undef - Data::Printer::Filter::GenericClass undef - Data::Printer::Filter::HASH undef - Data::Printer::Filter::OBJECT undef - Data::Printer::Filter::REF undef - Data::Printer::Filter::Regexp undef - Data::Printer::Filter::SCALAR undef - Data::Printer::Filter::VSTRING undef - Data::Printer::Filter::Web undef - Data::Printer::Object undef - Data::Printer::Profile undef - Data::Printer::Profile::Dumper undef - Data::Printer::Profile::JSON undef - Data::Printer::Theme undef - Data::Printer::Theme::Classic undef - Data::Printer::Theme::Material undef - Data::Printer::Theme::Monokai undef - Data::Printer::Theme::Solarized undef - requirements: - ExtUtils::MakeMaker 0 - Fcntl 0 - File::Spec 0 - File::Temp 0 - Scalar::Util 0 - Test::More 0 - version 0.77 Data-Section-0.200008 pathname: R/RJ/RJBS/Data-Section-0.200008.tar.gz provides: @@ -2423,30 +2371,6 @@ DISTRIBUTIONS URI::Escape 0 parent 0 perl v5.6.0 - HTML-Form-6.11 - pathname: S/SI/SIMBABQUE/HTML-Form-6.11.tar.gz - provides: - HTML::Form 6.11 - HTML::Form::FileInput 6.11 - HTML::Form::IgnoreInput 6.11 - HTML::Form::ImageInput 6.11 - HTML::Form::Input 6.11 - HTML::Form::KeygenInput 6.11 - HTML::Form::ListInput 6.11 - HTML::Form::SubmitInput 6.11 - HTML::Form::TextInput 6.11 - requirements: - Carp 0 - Encode 2 - ExtUtils::MakeMaker 0 - HTML::TokeParser 0 - HTTP::Request 6 - HTTP::Request::Common 6.03 - Test::More 0.96 - URI 1.10 - parent 0 - perl 5.008001 - strict 0 HTML-Parser-3.82 pathname: O/OA/OALDERS/HTML-Parser-3.82.tar.gz provides: @@ -2502,29 +2426,6 @@ DISTRIBUTIONS HTML::Tiny 1.08 requirements: perl 5.006 - HTML-Tree-5.07 - pathname: K/KE/KENTNL/HTML-Tree-5.07.tar.gz - provides: - HTML::AsSubs 5.07 - HTML::Element 5.07 - HTML::Element::traverse 5.07 - HTML::Parse 5.07 - HTML::Tree 5.07 - HTML::TreeBuilder 5.07 - requirements: - Carp 0 - Encode 0 - Exporter 0 - HTML::Entities 0 - HTML::Parser 3.46 - HTML::Tagset 3.02 - Module::Build 0.2808 - Scalar::Util 0 - Test::Fatal 0 - Test::More 0 - base 0 - integer 0 - perl 5.008 HTTP-Body-1.23 pathname: G/GE/GETTY/HTTP-Body-1.23.tar.gz provides: @@ -2541,23 +2442,6 @@ DISTRIBUTIONS File::Temp 0.14 HTTP::Headers 0 IO::File 1.14 - HTTP-CookieMonster-0.11 - pathname: O/OA/OALDERS/HTTP-CookieMonster-0.11.tar.gz - provides: - HTTP::CookieMonster 0.11 - HTTP::CookieMonster::Cookie 0.11 - requirements: - Carp 0 - ExtUtils::MakeMaker 0 - HTTP::Cookies 0 - Moo 1.000003 - Safe::Isa 0 - Scalar::Util 0 - Sub::Exporter 0 - URI::Escape 0 - perl 5.006 - strict 0 - warnings 0 HTTP-Cookies-6.11 pathname: O/OA/OALDERS/HTTP-Cookies-6.11.tar.gz provides: @@ -2878,43 +2762,6 @@ DISTRIBUTIONS ExtUtils::MakeMaker 6.52 Types::Serialiser 0 common::sense 0 - LWP-ConsoleLogger-1.000001 - pathname: O/OA/OALDERS/LWP-ConsoleLogger-1.000001.tar.gz - provides: - LWP::ConsoleLogger 1.000001 - LWP::ConsoleLogger::Easy 1.000001 - LWP::ConsoleLogger::Everywhere 1.000001 - requirements: - Class::Method::Modifiers 0 - Data::Printer 0.36 - DateTime 0 - ExtUtils::MakeMaker 0 - HTML::Restrict 0 - HTTP::Body 0 - HTTP::CookieMonster 0 - HTTP::Request 0 - HTTP::Response 0 - JSON::MaybeXS 1.003005 - List::AllUtils 0 - Log::Dispatch 2.56 - Module::Load::Conditional 0 - Module::Runtime 0 - Moo 0 - MooX::StrictConstructor 0 - Parse::MIME 0 - Ref::Util 0 - String::Trim 0 - Sub::Exporter 0 - Term::Size::Any 0 - Text::SimpleTable::AutoWidth 0.09 - Try::Tiny 0 - Types::Common::Numeric 0 - Types::Standard 0 - URI::QueryParam 0 - XML::Simple 0 - perl 5.016 - strict 0 - warnings 0 LWP-MediaTypes-6.04 pathname: O/OA/OALDERS/LWP-MediaTypes-6.04.tar.gz provides: @@ -2948,19 +2795,6 @@ DISTRIBUTIONS requirements: ExtUtils::MakeMaker 0 Test::More 0 - List-AllUtils-0.19 - pathname: D/DR/DROLSKY/List-AllUtils-0.19.tar.gz - provides: - List::AllUtils 0.19 - requirements: - Exporter 0 - ExtUtils::MakeMaker 0 - List::SomeUtils 0.58 - List::Util 1.56 - List::UtilsBy 0.11 - base 0 - strict 0 - warnings 0 List-Compare-0.55 pathname: J/JK/JKEENAN/List-Compare-0.55.tar.gz provides: @@ -3022,13 +2856,6 @@ DISTRIBUTIONS XSLoader 0 strict 0 warnings 0 - List-UtilsBy-0.12 - pathname: P/PE/PEVANS/List-UtilsBy-0.12.tar.gz - provides: - List::UtilsBy 0.12 - requirements: - Exporter 5.57 - Module::Build 0.4004 Log-Any-1.717 pathname: P/PR/PREACTION/Log-Any-1.717.tar.gz provides: @@ -5405,13 +5232,6 @@ DISTRIBUTIONS List::Util 0 Parse::CPAN::Meta 0 Parse::PMFile 0.37 - Parse-MIME-1.006 - pathname: A/AR/ARISTOTLE/Parse-MIME-1.006.tar.gz - provides: - Parse::MIME 1.006 - requirements: - Exporter 0 - perl 5.006 Parse-PMFile-0.47 pathname: I/IS/ISHIGAKI/Parse-PMFile-0.47.tar.gz provides: @@ -5973,25 +5793,6 @@ DISTRIBUTIONS Digest::SHA 0 Module::Build::Tiny 0.034 Plack 0.9910 - Plack-Test-Agent-1.5 - pathname: O/OA/OALDERS/Plack-Test-Agent-1.5.tar.gz - provides: - Plack::Test::Agent 1.5 - Test::WWW::Mechanize::Bound 1.5 - requirements: - ExtUtils::MakeMaker 0 - HTTP::Cookies 0 - HTTP::Message::PSGI 0 - HTTP::Request::Common 0 - HTTP::Response 0 - Plack::Loader 0 - Plack::Util::Accessor 0 - Test::TCP 0 - Test::WWW::Mechanize 0 - parent 0 - perl 5.008 - strict 0 - warnings 0 Plack-Test-ExternalServer-0.02 pathname: E/ET/ETHER/Plack-Test-ExternalServer-0.02.tar.gz provides: @@ -6443,18 +6244,6 @@ DISTRIBUTIONS perl 5.012 strict 0 warnings 0 - String-Trim-0.005 - pathname: D/DO/DOHERTY/String-Trim-0.005.tar.gz - provides: - String::Trim 0.005 - requirements: - Data::Dumper 0 - Exporter 5.57 - ExtUtils::MakeMaker 6.31 - File::Find 0 - File::Temp 0 - Test::Builder 0.94 - Test::More 0.94 Sub-Exporter-0.991 pathname: R/RJ/RJBS/Sub-Exporter-0.991.tar.gz provides: @@ -6682,14 +6471,6 @@ DISTRIBUTIONS Try::Tiny 0.07 strict 0 warnings 0 - Test-LongString-0.17 - pathname: R/RG/RGARCIA/Test-LongString-0.17.tar.gz - provides: - Test::LongString 0.17 - requirements: - ExtUtils::MakeMaker 0 - Test::Builder 0.12 - Test::Builder::Tester 1.04 Test-MockRandom-1.01 pathname: D/DA/DAGOLDEN/Test-MockRandom-1.01.tar.gz provides: @@ -6821,23 +6602,6 @@ DISTRIBUTIONS Module::Build::Tiny 0.035 parent 0 perl 5.010000 - Test-WWW-Mechanize-1.60 - pathname: P/PE/PETDANCE/Test-WWW-Mechanize-1.60.tar.gz - provides: - Test::WWW::Mechanize 1.60 - requirements: - Carp 0 - Carp::Assert::More 1.16 - ExtUtils::MakeMaker 0 - HTML::Form 0 - HTML::TokeParser 0 - HTTP::Message 6.29 - LWP 6.02 - Test::Builder 0 - Test::LongString 0.15 - WWW::Mechanize 1.68 - parent 0 - perl 5.010 Test-Warn-0.37 pathname: B/BI/BIGJ/Test-Warn-0.37.tar.gz provides: @@ -6888,17 +6652,6 @@ DISTRIBUTIONS ExtUtils::MakeMaker 0 Test::More 0 perl 5.008001 - Text-SimpleTable-AutoWidth-0.09 - pathname: C/CU/CUB/Text-SimpleTable-AutoWidth-0.09.tar.gz - provides: - Text::SimpleTable::AutoWidth 0.09 - requirements: - ExtUtils::MakeMaker 0 - List::Util 0 - Moo 0 - Text::SimpleTable 0 - strict 0 - warnings 0 Text-Template-1.61 pathname: M/MS/MSCHOUT/Text-Template-1.61.tar.gz provides: @@ -7453,33 +7206,6 @@ DISTRIBUTIONS Exporter 0 Module::Build 0.4005 perl 5.008001 - WWW-Mechanize-2.18 - pathname: O/OA/OALDERS/WWW-Mechanize-2.18.tar.gz - provides: - WWW::Mechanize 2.18 - WWW::Mechanize::Image 2.18 - WWW::Mechanize::Link 2.18 - requirements: - Carp 0 - ExtUtils::MakeMaker 0 - Getopt::Long 0 - HTML::Form 6.08 - HTML::HeadParser 0 - HTML::TokeParser 0 - HTML::TreeBuilder 5 - HTTP::Cookies 0 - HTTP::Request 1.30 - HTTP::Request::Common 0 - LWP::UserAgent 0 - Pod::Usage 0 - Scalar::Util 1.14 - Tie::RefHash 0 - URI::URL 0 - URI::file 0 - base 0 - perl 5.008 - strict 0 - warnings 0 WWW-OAuth-1.000 pathname: D/DB/DBOOK/WWW-OAuth-1.000.tar.gz provides: diff --git a/t/lib/MetaCPAN/TestApp.pm b/t/lib/MetaCPAN/TestApp.pm deleted file mode 100644 index 45b06b693..000000000 --- a/t/lib/MetaCPAN/TestApp.pm +++ /dev/null @@ -1,40 +0,0 @@ -package MetaCPAN::TestApp; - -use strict; -use warnings; - -use LWP::ConsoleLogger::Easy qw( debug_ua ); -use MetaCPAN::Server::Test qw( app ); -use Moose; -use Plack::Test::Agent; - -has _test_agent => ( - is => 'ro', - isa => 'Plack::Test::Agent', - handles => ['get'], - lazy => 1, - default => sub { - my $self = shift; - return Plack::Test::Agent->new( - app => app(), - ua => $self->_user_agent, - - # server => 'HTTP::Server::Simple', - ); - }, -); - -# set a server value above if you want to see debugging info -has _user_agent => ( - is => 'ro', - isa => 'LWP::UserAgent', - lazy => 1, - default => sub { - my $ua = LWP::UserAgent->new; - debug_ua($ua); - return $ua; - }, -); - -__PACKAGE__->meta->make_immutable(); -1; diff --git a/t/lib/MetaCPAN/Tests/Release.pm b/t/lib/MetaCPAN/Tests/Release.pm index 7f0442307..d5ed01e99 100644 --- a/t/lib/MetaCPAN/Tests/Release.pm +++ b/t/lib/MetaCPAN/Tests/Release.pm @@ -6,11 +6,10 @@ use version; use HTTP::Request::Common; use List::Util (); -use MetaCPAN::TestApp; use Test::More; use MetaCPAN::Types::TypeTiny qw( ArrayRef HashRef Str ); -with( 'MetaCPAN::Tests::Model', 'MetaCPAN::Tests::Role::HasApp' ); +with('MetaCPAN::Tests::Model'); sub _build_type {'release'} @@ -86,8 +85,9 @@ sub file_content { # I couldn't get the Source model to work outside the app (I got # "No handler available for type 'application/octet-stream'", # strangely), so just do the http request. - return $self->app->get("/source/$self->{author}/$self->{name}/$path") - ->content; + return $self->psgi_app( sub { + shift->( GET "/source/$self->{author}/$self->{name}/$path" )->content; + } ); } sub file_by_path { diff --git a/t/lib/MetaCPAN/Tests/Role/HasApp.pm b/t/lib/MetaCPAN/Tests/Role/HasApp.pm deleted file mode 100644 index ab0644530..000000000 --- a/t/lib/MetaCPAN/Tests/Role/HasApp.pm +++ /dev/null @@ -1,16 +0,0 @@ -package MetaCPAN::Tests::Role::HasApp; - -use strict; -use warnings; - -use MetaCPAN::TestApp; -use Moose::Role; - -has app => ( - is => 'ro', - isa => 'MetaCPAN::TestApp', - lazy => 1, - default => sub { MetaCPAN::TestApp->new }, -); - -1; From da6cdb08a57d8d9607a33e418441361473b25d86 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 14:46:16 +0200 Subject: [PATCH 20/22] test appropriate -t rather than using IO::Interactive IO::Interactive tries to generalize the concept of "interactivity", but we don't actually want the general concept. Color log output should be based on if STDERR is connected to a terminal. And skipping a prompt should be based on STDIN. --- .perlcriticrc | 1 + cpanfile | 1 - cpanfile.snapshot | 8 -------- etc/metacpan.pl | 18 ++++++++++++------ etc/metacpan_interactive.pl | 12 ------------ lib/MetaCPAN/Role/Script.pm | 3 +-- lib/MetaCPAN/Script/Runner.pm | 8 -------- 7 files changed, 14 insertions(+), 37 deletions(-) delete mode 100644 etc/metacpan_interactive.pl diff --git a/.perlcriticrc b/.perlcriticrc index 6e80016cd..e327481e4 100644 --- a/.perlcriticrc +++ b/.perlcriticrc @@ -7,6 +7,7 @@ theme = core [-ControlStructures::ProhibitPostfixControls] [-Documentation::RequirePodLinksIncludeText] [-Documentation::RequirePodSections] +[-InputOutput::ProhibitInteractiveTest] [-Modules::RequireVersionVar] [-RegularExpressions::RequireDotMatchAnything] [-RegularExpressions::RequireExtendedFormatting] diff --git a/cpanfile b/cpanfile index c1c97ea60..8bf018e7f 100644 --- a/cpanfile +++ b/cpanfile @@ -63,7 +63,6 @@ requires 'Gravatar::URL'; requires 'Hash::Merge::Simple'; requires 'HTML::Entities'; requires 'HTTP::Request::Common', '6.36'; -requires 'IO::Interactive'; requires 'IO::Prompt'; requires 'IO::Uncompress::Bunzip2', '2.106'; requires 'IO::Zlib'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index c7023e265..896d9e069 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -2626,14 +2626,6 @@ DISTRIBUTIONS Exporter 5.57 ExtUtils::MakeMaker 0 perl 5.008 - IO-Interactive-1.025 - pathname: B/BD/BDFOY/IO-Interactive-1.025.tar.gz - provides: - IO::Interactive 1.025 - requirements: - ExtUtils::MakeMaker 6.64 - File::Spec::Functions 0 - perl 5.008 IO-Prompt-0.997004 pathname: D/DC/DCONWAY/IO-Prompt-0.997004.tar.gz provides: diff --git a/etc/metacpan.pl b/etc/metacpan.pl index 67512ff91..12c2af5f7 100644 --- a/etc/metacpan.pl +++ b/etc/metacpan.pl @@ -15,9 +15,15 @@ # can be overridden using the layout key # defining logger in metacpan_local.pl will # override and not append to this configuration - logger => [{ - class => 'Log::Log4perl::Appender::File', - filename => $FindBin::RealBin . '/../var/log/metacpan.log', - syswrite => 1, - }] -} \ No newline at end of file + logger => [ + { + class => 'Log::Log4perl::Appender::File', + filename => $FindBin::RealBin . '/../var/log/metacpan.log', + syswrite => 1, + }, + (-t *STDERR ? ({ + class => 'Log::Log4perl::Appender::ScreenColoredLevels', + stdout => 0, + }) : ()), + ], +} diff --git a/etc/metacpan_interactive.pl b/etc/metacpan_interactive.pl deleted file mode 100644 index 520df00b4..000000000 --- a/etc/metacpan_interactive.pl +++ /dev/null @@ -1,12 +0,0 @@ -use FindBin; -{ - level => 'info', - logger => [{ - class => 'Log::Log4perl::Appender::ScreenColoredLevels', - stdout => 0, - }, { - class => 'Log::Log4perl::Appender::File', - filename => $FindBin::RealBin . '/../var/log/metacpan.log', - syswrite => 1, - }] -} \ No newline at end of file diff --git a/lib/MetaCPAN/Role/Script.pm b/lib/MetaCPAN/Role/Script.pm index 389eb2e2b..dc6c918dc 100644 --- a/lib/MetaCPAN/Role/Script.pm +++ b/lib/MetaCPAN/Role/Script.pm @@ -9,7 +9,6 @@ use MetaCPAN::Model (); use MetaCPAN::Types::TypeTiny qw( Bool HashRef Int Path Str ); use Mojo::Server (); use Term::ANSIColor qw( colored ); -use IO::Interactive qw( is_interactive ); use IO::Prompt qw( prompt ); use File::Path (); @@ -392,7 +391,7 @@ sub are_you_sure { my ( $self, $msg ) = @_; my $iconfirmed = 0; - if (is_interactive) { + if ( -t *STDOUT ) { my $answer = prompt colored( ['bold red'], "*** Warning ***: $msg" ) . "\n" . 'Are you sure you want to do this (type "YES" to confirm) ? '; diff --git a/lib/MetaCPAN/Script/Runner.pm b/lib/MetaCPAN/Script/Runner.pm index 4e15aca49..99dbfba14 100644 --- a/lib/MetaCPAN/Script/Runner.pm +++ b/lib/MetaCPAN/Script/Runner.pm @@ -6,7 +6,6 @@ use warnings; use Config::ZOMG (); use File::Path (); use Hash::Merge::Simple qw(merge); -use IO::Interactive qw(is_interactive); use Module::Pluggable search_path => ['MetaCPAN::Script']; use Module::Runtime (); use Try::Tiny qw( catch try ); @@ -88,13 +87,6 @@ sub build_config { )->load; $config = merge $config, $tconf; } - elsif ( is_interactive() ) { - my $iconf = Config::ZOMG->new( - name => 'metacpan', - file => 'etc/metacpan_interactive.pl' - )->load; - $config = merge $config, $iconf; - } return $config; } From 79ed530b341a7fa22d31cb8c6078c9a4ede99c6c Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 14:54:28 +0200 Subject: [PATCH 21/22] IO::Prompt -> IO::Prompt::Tiny We don't need any of IO::Prompt's extra features or its weird behaviors and prereqs. --- cpanfile | 2 +- cpanfile.snapshot | 30 +++++++++--------------------- lib/MetaCPAN/Role/Script.pm | 2 +- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/cpanfile b/cpanfile index 8bf018e7f..ab37491dc 100644 --- a/cpanfile +++ b/cpanfile @@ -63,7 +63,7 @@ requires 'Gravatar::URL'; requires 'Hash::Merge::Simple'; requires 'HTML::Entities'; requires 'HTTP::Request::Common', '6.36'; -requires 'IO::Prompt'; +requires 'IO::Prompt::Tiny'; requires 'IO::Uncompress::Bunzip2', '2.106'; requires 'IO::Zlib'; requires 'IPC::Run3', '0.048'; diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 896d9e069..616076bc1 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -2626,17 +2626,17 @@ DISTRIBUTIONS Exporter 5.57 ExtUtils::MakeMaker 0 perl 5.008 - IO-Prompt-0.997004 - pathname: D/DC/DCONWAY/IO-Prompt-0.997004.tar.gz + IO-Prompt-Tiny-0.003 + pathname: D/DA/DAGOLDEN/IO-Prompt-Tiny-0.003.tar.gz provides: - IO::Prompt 0.997004 - IO::Prompt::ReturnVal 0.997004 + IO::Prompt::Tiny 0.003 requirements: - ExtUtils::MakeMaker 0 - IO::Handle 0 - Term::ReadKey 0 - Test::More 0 - Want 0 + Carp 0 + Exporter 0 + ExtUtils::MakeMaker 6.17 + perl 5.006 + strict 0 + warnings 0 IO-Socket-SSL-2.086 pathname: S/SU/SULLR/IO-Socket-SSL-2.086.tar.gz provides: @@ -6347,12 +6347,6 @@ DISTRIBUTIONS Exporter 0 ExtUtils::CBuilder 0 ExtUtils::MakeMaker 0 - TermReadKey-2.38 - pathname: J/JS/JSTOWE/TermReadKey-2.38.tar.gz - provides: - Term::ReadKey 2.38 - requirements: - ExtUtils::MakeMaker 6.58 Test-Abortable-0.003 pathname: R/RJ/RJBS/Test-Abortable-0.003.tar.gz provides: @@ -7232,12 +7226,6 @@ DISTRIBUTIONS Fcntl 0 URI 1.10 perl 5.008001 - Want-0.29 - pathname: R/RO/ROBIN/Want-0.29.tar.gz - provides: - Want 0.29 - requirements: - ExtUtils::MakeMaker 0 XML-NamespaceSupport-1.12 pathname: P/PE/PERIGRIN/XML-NamespaceSupport-1.12.tar.gz provides: diff --git a/lib/MetaCPAN/Role/Script.pm b/lib/MetaCPAN/Role/Script.pm index dc6c918dc..f7cbb60f8 100644 --- a/lib/MetaCPAN/Role/Script.pm +++ b/lib/MetaCPAN/Role/Script.pm @@ -9,7 +9,7 @@ use MetaCPAN::Model (); use MetaCPAN::Types::TypeTiny qw( Bool HashRef Int Path Str ); use Mojo::Server (); use Term::ANSIColor qw( colored ); -use IO::Prompt qw( prompt ); +use IO::Prompt::Tiny qw( prompt ); use File::Path (); use Carp (); From e0b3afcdc5ab7043faff4e290d0c1fa4e7227658 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 19 Jun 2024 15:09:52 +0200 Subject: [PATCH 22/22] use XML::XPath for parsing 00whois.xml XML::Simple is not recommended because it is hard to use correctly. We can use XML::XPath instead, and the code is actually simpler. --- cpanfile | 2 +- cpanfile.snapshot | 92 +++++++++++++---------------------- lib/MetaCPAN/Script/Author.pm | 21 +++----- 3 files changed, 41 insertions(+), 74 deletions(-) diff --git a/cpanfile b/cpanfile index ab37491dc..c05f4d27a 100644 --- a/cpanfile +++ b/cpanfile @@ -139,7 +139,7 @@ requires 'Types::URI'; requires 'Twitter::API', '1.0006'; requires 'URI', '5.10'; requires 'version', '0.9929'; -requires 'XML::Simple'; +requires 'XML::XPath'; requires 'YAML::XS', '0.83'; # Mojolicious::Plugin::OpenAPI YAML loading # test requirements diff --git a/cpanfile.snapshot b/cpanfile.snapshot index 616076bc1..90109c0b1 100644 --- a/cpanfile.snapshot +++ b/cpanfile.snapshot @@ -7226,17 +7226,6 @@ DISTRIBUTIONS Fcntl 0 URI 1.10 perl 5.008001 - XML-NamespaceSupport-1.12 - pathname: P/PE/PERIGRIN/XML-NamespaceSupport-1.12.tar.gz - provides: - XML::NamespaceSupport 1.12 - requirements: - ExtUtils::MakeMaker 6.17 - constant 0 - perl 5.006 - strict 0 - vars 0 - warnings 0 XML-Parser-2.47 pathname: T/TO/TODDR/XML-Parser-2.47.tar.gz provides: @@ -7251,54 +7240,39 @@ DISTRIBUTIONS ExtUtils::MakeMaker 0 LWP::UserAgent 0 perl 5.004050 - XML-SAX-1.02 - pathname: G/GR/GRANTM/XML-SAX-1.02.tar.gz - provides: - XML::SAX 1.02 - XML::SAX::DocumentLocator undef - XML::SAX::ParserFactory 1.02 - XML::SAX::PurePerl 1.02 - XML::SAX::PurePerl::DebugHandler undef - XML::SAX::PurePerl::Exception undef - XML::SAX::PurePerl::Productions undef - XML::SAX::PurePerl::Reader undef - XML::SAX::PurePerl::Reader::Stream undef - XML::SAX::PurePerl::Reader::String undef - XML::SAX::PurePerl::Reader::URI undef - requirements: - ExtUtils::MakeMaker 0 - File::Temp 0 - XML::NamespaceSupport 0.03 - XML::SAX::Base 1.05 - XML-SAX-Base-1.09 - pathname: G/GR/GRANTM/XML-SAX-Base-1.09.tar.gz - provides: - XML::SAX::Base 1.09 - XML::SAX::Base::NoHandler 1.09 - XML::SAX::Exception 1.09 - requirements: - ExtUtils::MakeMaker 0 - perl 5.008 - XML-SAX-Expat-0.51 - pathname: B/BJ/BJOERN/XML-SAX-Expat-0.51.tar.gz - provides: - XML::SAX::Expat 0.51 - requirements: - ExtUtils::MakeMaker 0 - XML::NamespaceSupport 0.03 - XML::Parser 2.27 - XML::SAX 0.03 - XML::SAX::Base 1.00 - XML-Simple-2.25 - pathname: G/GR/GRANTM/XML-Simple-2.25.tar.gz - provides: - XML::Simple 2.25 - requirements: - ExtUtils::MakeMaker 0 - XML::NamespaceSupport 1.04 - XML::SAX 0.15 - XML::SAX::Expat 0 - perl 5.008 + XML-XPath-1.48 + pathname: M/MA/MANWAR/XML-XPath-1.48.tar.gz + provides: + XML::XPath 1.48 + XML::XPath::Boolean 1.48 + XML::XPath::Builder 1.48 + XML::XPath::Expr 1.48 + XML::XPath::Function 1.48 + XML::XPath::Literal 1.48 + XML::XPath::LocationPath 1.48 + XML::XPath::Node 1.48 + XML::XPath::Node::Attribute 1.48 + XML::XPath::Node::AttributeImpl 1.48 + XML::XPath::Node::Comment 1.48 + XML::XPath::Node::Element 1.48 + XML::XPath::Node::Namespace 1.48 + XML::XPath::Node::PI 1.48 + XML::XPath::Node::Text 1.48 + XML::XPath::NodeSet 1.48 + XML::XPath::Number 1.48 + XML::XPath::Parser 1.48 + XML::XPath::PerlSAX 1.48 + XML::XPath::Root 1.48 + XML::XPath::Step 1.48 + XML::XPath::Variable 1.48 + XML::XPath::XMLParser 1.48 + requirements: + ExtUtils::MakeMaker 0 + Path::Tiny 0.076 + Scalar::Util 1.45 + Test::More 0 + XML::Parser 2.23 + perl 5.010001 XString-0.005 pathname: A/AT/ATOOMIC/XString-0.005.tar.gz provides: diff --git a/lib/MetaCPAN/Script/Author.pm b/lib/MetaCPAN/Script/Author.pm index 0c996dc37..5a093cabe 100644 --- a/lib/MetaCPAN/Script/Author.pm +++ b/lib/MetaCPAN/Script/Author.pm @@ -13,7 +13,7 @@ use Cpanel::JSON::XS qw( decode_json ); use Log::Contextual qw( :log :dlog ); use MetaCPAN::Document::Author (); use URI (); -use XML::Simple qw( XMLin ); +use XML::XPath (); use MetaCPAN::Types::TypeTiny qw( Str ); use MetaCPAN::Util qw(diff_struct); @@ -87,23 +87,16 @@ has whois_data => ( sub _build_whois_data { my $self = shift; - my $data = XMLin( - $self->author_fh, - ForceArray => 1, - SuppressEmpty => '', - NoAttr => 1, - KeyAttr => [], - ); my $whois_data = {}; - for my $author ( @{ $data->{cpanid} } ) { + my $xp = XML::XPath->new( filename => $self->author_fh ); + + for my $author ( $xp->find('/cpan-whois/cpanid')->get_nodelist ) { my $data = { - map { - my $content = $author->{$_}; - @$content == 1 - && !ref $content->[0] ? ( $_ => $content->[0] ) : (); - } keys %$author + map +( $_->getLocalName, $_->string_value ), + grep $_->isa('XML::XPath::Node::Element'), + $author->getChildNodes }; my $pauseid = $data->{id};