From 6ff87ce90fe368ac51d2a3732d3611205b0219f6 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Mon, 11 Jan 2016 10:10:21 -0500 Subject: [PATCH] [REBUILD] Fix cached dist builds breaking travis statuses 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) --- lib/ModulesPerl6/DbBuilder/Dist/Source/GitHub.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/ModulesPerl6/DbBuilder/Dist/Source/GitHub.pm b/lib/ModulesPerl6/DbBuilder/Dist/Source/GitHub.pm index e45bb32..b40b67d 100644 --- a/lib/ModulesPerl6/DbBuilder/Dist/Source/GitHub.pm +++ b/lib/ModulesPerl6/DbBuilder/Dist/Source/GitHub.pm @@ -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.'; @@ -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;