- Reduce the live database set of the primary CPAN Testers servers
- Mostly-static data that does not need deep querying should be removed from the database
- Allow individuals to run CPAN Testers databases (schema, backend, api) for their own internal use
- Must have an easy way to run a single node that contains a database, backend, and API
- Must have an easy way to configure a tester to submit to the internal node
- Must have a web app to show the status of the local testing infrastructure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Mojolicious/Plugin/Yancy.pm b/lib/Mojolicious/Plugin/Yancy.pm | |
index 7ed3e54..6ae923e 100644 | |
--- a/lib/Mojolicious/Plugin/Yancy.pm | |
+++ b/lib/Mojolicious/Plugin/Yancy.pm | |
@@ -892,6 +892,10 @@ sub _helper_validate { | |
for my $prop_name ( keys %{ $schema->{properties} } ) { | |
my $prop = $schema->{properties}{ $prop_name }; | |
+ # These blocks fix problems with validation only. If the | |
+ # problem is the database understanding the value, it must be |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MyApp::Controller::ModifiedBy; | |
use Mojo::Base 'Yancy::Controller::Yancy'; | |
sub _add_modified_by { | |
my ( $c ) = @_; | |
$c->req->param( modified_by => $c->current_uid ); | |
if ( my $item = $c->req->json ) { | |
$item->{ modified_by } = $c->current_uid; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Foo; | |
use overload '%{}' => sub { | |
my ( $package ) = caller; | |
if ( !$package->isa( __PACKAGE__ ) ) { | |
require Carp; | |
Carp::cluck( "Use a method instead!" ); | |
} | |
return $_[0]; | |
}; | |
sub new { return bless { foo => 'bar' }, __PACKAGE__ } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v5.28; | |
use warnings; | |
use experimental qw( signatures postderef ); | |
use version; | |
use Data::Printer; | |
use MetaCPAN::Client; | |
my $mcpan = MetaCPAN::Client->new; |
- Clone the deploy repository
- git clone https://github.com/cpan-testers/cpantesters-deploy
- cd cpantesters-deploy
- Start the development infrastructure in Docker
docker-compose start
- Web is deployed to http://127.0.0.1:3000
- API is deployed to http://127.0.0.1:4000
- Fetch some reports from the public API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Perl greets you simply | |
- print "Hello, World\n"; | |
- Change to Hello, Perl | |
Perl advances when you ask it to | |
- say "Hello, World\n"; | |
- use feature "say"; | |
- Remove newline | |
Perl advances in jumps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vack() { | |
# Takes a keyword as an argument, acks current directory, opens a vim session | |
# with a tab for each file with a match found, and puts the keyword in the @/ | |
# register, so that you can `n` through matches. | |
my_search=$(ack -l "$1") | |
if [[ -z $my_search ]] | |
then | |
echo "No results found for $1" | |
else | |
args=(--cmd "let @/=\"$1\"" -p ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Local::Plugin::MyPlugin; | |
use Mojo::Base 'Mojolicious::Plugin'; | |
sub cached_thing { | |
state $cache = 'expensive'; | |
return $cache; | |
} | |
sub register { | |
my ( $self, $app, $conf ) = @_; | |
$app->helper( myplugin => sub { $self } ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
use Time::HiRes qw( time ); | |
plugin Minion => { | |
SQLite => 'sqlite:' . app->home->child('minion.db'), | |
}; | |
app->minion->add_task( |