Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Redesign dist source-url META checker
The current check gives only 1 hour window of opportunity to notice any issues
with the source-url in META file, as the checker does not run on dists without
fresh commits.

Perform the check on all dists regardless whether we have new commits, but do
not do the check if the source-url matches the repo we fetched the META file
from; since this already guarantees the source-url is correct. This will give
us even better reduction of HTTP requests than doing the checks for dists
with fresh commits only and any issues will stay in the build log until fixed.
  • Loading branch information
zoffixznet committed Oct 26, 2016
1 parent 8f32095 commit 9fa5ea3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/ModulesPerl6/DbBuilder/Dist/PostProcessor/METAChecker.pm
Expand Up @@ -10,7 +10,14 @@ use experimental 'postderef';
sub process {
my $self = shift;
my $dist = $self->_dist;
return unless $dist->{_builder}{is_fresh};

my $repo_url = 'https://github.com/'
. join '/', grep length, @{ $dist->{_builder} }{qw/repo_user repo/};

if ( $repo_url eq $dist->{url} ) {
log info => "dist source URL is same as META repo URL ($repo_url)";
return;
}

my $code = Mojo::UserAgent->new( max_redirects => 5 )
->get( $dist->{url} )->res->code;
Expand Down

0 comments on commit 9fa5ea3

Please sign in to comment.