Skip to content

Commit

Permalink
[REBUILD] Fix cached dist builds breaking travis statuses
Browse files Browse the repository at this point in the history
The check for whether .travis.yml file exists happens only when dist has new commits. Lacking those, the site thinks .travis.yml file was removed and the dist is not setup on travis, so it tosses the cached travis status too. (Closes #50)
  • Loading branch information
zoffixznet committed Jan 11, 2016
1 parent 49b29cc commit 6ff87ce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/ModulesPerl6/DbBuilder/Dist/Source/GitHub.pm
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ sub load {
} // 0;

# no new commits and we have cached results that will do just fine
return $dist
if $dist->{date_updated} eq $date_updated and not $ENV{FULL_REBUILD};
if ( $dist->{date_updated} eq $date_updated and not $ENV{FULL_REBUILD} ) {
$dist->{_builder}{has_travis} = 1 # reinstate cached travis status
unless $dist->{travis_status} eq 'not set up';
return;
}
$dist->{date_updated} = $date_updated;

log info => 'Dist has new commits. Fetching more info.';
Expand All @@ -102,7 +105,6 @@ sub load {
delete $dist->{koalatee};
$self->_set_readme( map $_->{path}, grep $_->{type} eq 'blob', @$tree );
$self->_set_tests( map $_->{path}, grep $_->{type} eq 'tree', @$tree );

$dist->{_builder}{has_travis} = grep $_->{path} eq '.travis.yml', @$tree;

return $dist;
Expand Down

0 comments on commit 6ff87ce

Please sign in to comment.