[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 05/10] Flight restriction: Make report_blessingscond use implicit $maxflight



We have $maxflight in Osstest::Executive now, set appropriately.

Use that in report_blessingscond and all its callers including
report_find_push_age_info and hence in mg-all-branch-statuses and
sg-report-flight and sg-report-job-history.

No functional change.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest/Executive.pm   |   21 ++++++++++-----------
 mg-all-branch-statuses |    2 +-
 sg-report-flight       |    4 ++--
 sg-report-job-history  |    2 +-
 4 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/Osstest/Executive.pm b/Osstest/Executive.pm
index 05a7268..a1bc0ad 100644
--- a/Osstest/Executive.pm
+++ b/Osstest/Executive.pm
@@ -277,20 +277,19 @@ sub report_altcolour ($) {
     return "bgcolor=\"#".(qw(d0d0d0 ffffff))[$bool]."\"";
 }
 
-sub report_blessingscond ($$) {
-    my ($blessings, $maxflight) = @_;
+sub report_blessingscond ($) {
+    my ($blessings) = @_;
+    my $flightcond= restrictflight_cond();
     my $blessingscond= '('.join(' OR ', map {
        die if m/[^-_.0-9a-z]/;
        "blessing='$_'"
                                } @$blessings).')';
-    if (defined $maxflight) {
-       $blessingscond= "( flight <= $maxflight AND $blessingscond )";
-    }
+    return "( $flightcond AND $blessingscond )";
     return $blessingscond;
 }
 
-sub report__find_test ($$$$$$$$) {
-    my ($blessings, $maxflight, $branches, $tree,
+sub report__find_test ($$$$$$$) {
+    my ($blessings, $branches, $tree,
        $revision, $selection, $extracond, $sortlimit) = @_;
     # Reports information about a flight which tried to test $revision
     # of $tree.  ($revision may be undef);
@@ -332,7 +331,7 @@ END
 END
     }
 
-    my $blessingscond = report_blessingscond($blessings,$maxflight);
+    my $blessingscond = report_blessingscond($blessings);
     $querytext .= <<END;
          AND $blessingscond
 END
@@ -354,8 +353,8 @@ END
     return $row;
 }
 
-sub report_find_push_age_info ($$$$$$) {
-    my ($blessings, $maxflight, $branches, $tree,
+sub report_find_push_age_info ($$$$$) {
+    my ($blessings, $branches, $tree,
        $basis_revision, $tip_revision) = @_;
     # Reports information about tests of $tree.
     # (Subject to @$blessings, $maxflight, @$branches)
@@ -377,7 +376,7 @@ sub report_find_push_age_info ($$$$$$) {
 
     my $findtest = sub {
        my ($revision,$selection,$extracond,$sortlimit) = @_;
-       report__find_test($blessings,$maxflight,$branches,$tree,
+       report__find_test($blessings,$branches,$tree,
                         $revision,$selection,$extracond,$sortlimit);
     };
 
diff --git a/mg-all-branch-statuses b/mg-all-branch-statuses
index 8b86e3b..bba7216 100755
--- a/mg-all-branch-statuses
+++ b/mg-all-branch-statuses
@@ -53,7 +53,7 @@ gather_info()
        my ($branch,$tree,$basis,$tip) = @ARGV;
        print DEBUG "branch=$branch tree=$tree basis=$basis tip=$tip\n";
        my $info = report_find_push_age_info([qw(real adhoc play)],
-                                             undef, [($branch)],
+                                             [($branch)],
                                              $tree, $basis, $tip);
        print DEBUG Dumper $info;
        my $onevar = sub {
diff --git a/sg-report-flight b/sg-report-flight
index bdfbfb6..78c91da 100755
--- a/sg-report-flight
+++ b/sg-report-flight
@@ -128,7 +128,7 @@ our $cw= 79;
 our $tl= 20;
 our $htmlleaf= "info.html";
 
-our $blessingscond= report_blessingscond(\@blessings, $maxflight);
+our $blessingscond= report_blessingscond(\@blessings);
 
 sub displayflightnum ($) {
     my ($flight) = @_;
@@ -523,7 +523,7 @@ sub print_pushgate_summary () {
     my $tree = $thistree[0];
 
     my $info = report_find_push_age_info(
-       [ $blessings[0] ], $maxflight, [ $branch ],
+       [ $blessings[0] ], [ $branch ],
        $tree, $specver{that}{$tree}, $specver{this}{$tree}
        );
     bodyprint "\n";
diff --git a/sg-report-job-history b/sg-report-job-history
index ec2776b..e8cf50f 100755
--- a/sg-report-job-history
+++ b/sg-report-job-history
@@ -119,7 +119,7 @@ sub processjobbranch ($$) {
     my @rev_grid_cols;
     my @test_rows;
 
-    my $blessingscond= report_blessingscond(\@blessings, $maxflight);
+    my $blessingscond= report_blessingscond(\@blessings);
     my $cond = "job = ? AND $blessingscond";
     my (@params) = ($j);
     if (defined $bra) {
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.