status == 'MERGED') { echo 2; exit; } // Check that the patch we are testing is the latest (current) patchset in series if ($content[0]->current_revision != $git_commit_id) { echo 3; exit; } // Now check to see if anyone has rejected this. // We don't want to reject the patch if auto test has failed as we are re-testing now // but we do want to reject patch if the parent has failed auto test. if (!empty($first_commit) && empty($content[0]->labels->{'Verified'}->rejected) && empty($content[0]->labels->{'Code-Review'}->rejected)) { echo 0; } else if (empty($content[0]->labels->{'Verified'}->rejected) && empty($content[0]->labels->{'Code-Review'}->rejected) && empty($content[0]->labels->{'Automated-Tests'}->rejected)) { echo 0; } else { echo 1; } ?>