bug 437143: try servers need to support building from a mercurial repository with a patch. r=rhelmer, patch=vlad,me
git-svn-id: svn://10.0.0.236/trunk@253025 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
232c642b23
commit
217d33d991
@ -466,6 +466,17 @@ firefox_sendchange_hg_linux_steps = [
|
||||
s(MozillaDownloadMozconfig, mastersrc="mozconfig-linux",
|
||||
patchDir="patches/"),
|
||||
|
||||
s(MozillaPatchDownload, patchDir="patches/",
|
||||
haltOnFailure=False,
|
||||
flunkOnFailure=True,
|
||||
workdir="mozilla",
|
||||
isOptional=True),
|
||||
|
||||
s(MozillaCustomPatch, workdir="mozilla",
|
||||
haltOnFailure=True,
|
||||
flunkOnFailure=True,
|
||||
isOptional=True),
|
||||
|
||||
s(ShellCommand, name="mozconfig contents",
|
||||
command=["cat", ".mozconfig"],
|
||||
workdir="mozilla"),
|
||||
@ -546,6 +557,17 @@ firefox_sendchange_hg_mac_steps = [
|
||||
s(MozillaDownloadMozconfig, mastersrc="mozconfig-mac",
|
||||
patchDir="patches/"),
|
||||
|
||||
s(MozillaPatchDownload, patchDir="patches/",
|
||||
haltOnFailure=True,
|
||||
flunkOnFailure=True,
|
||||
workdir="mozilla",
|
||||
isOptional=True),
|
||||
|
||||
s(MozillaCustomPatch, workdir="mozilla",
|
||||
haltOnFailure=True,
|
||||
flunkOnFailure=True,
|
||||
isOptional=True),
|
||||
|
||||
s(ShellCommand, name="mozconfig contents",
|
||||
command=["cat", ".mozconfig"],
|
||||
workdir="mozilla"),
|
||||
@ -629,6 +651,17 @@ firefox_sendchange_hg_win32_steps = [
|
||||
s(MozillaDownloadMozconfig, mastersrc="mozconfig-win32",
|
||||
patchDir="patches/"),
|
||||
|
||||
s(MozillaPatchDownload, patchDir="patches/",
|
||||
haltOnFailure=True,
|
||||
flunkOnFailure=True,
|
||||
workdir="mozilla",
|
||||
isOptional=True),
|
||||
|
||||
s(MozillaCustomPatch, workdir="mozilla",
|
||||
haltOnFailure=True,
|
||||
flunkOnFailure=True,
|
||||
isOptional=True),
|
||||
|
||||
s(ShellCommand, name="mozconfig contents",
|
||||
command=["cat", ".mozconfig"],
|
||||
workdir="mozilla",
|
||||
|
||||
@ -1,161 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Try server patch downloader script.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Mozilla Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2007
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Ben Hearsum <bhearsum@mozilla.com>
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
# Description:
|
||||
# TODO
|
||||
#
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use File::Spec::Functions;
|
||||
|
||||
use MozBuild::Util qw(RunShellCommand MkdirWithPath);
|
||||
|
||||
# for readability
|
||||
my $ST_INODE = 1;
|
||||
|
||||
# where to retrieve files from -- make sure this has a trailing slash
|
||||
my $PATCHURL = "https://build.mozilla.org/patches/";
|
||||
# where the patches go
|
||||
my $PATCHDIR = "patches/";
|
||||
# where to log errors
|
||||
my $LOGFILE = "downloader.log";
|
||||
|
||||
my $PYTHON_PATH = "/tools/python/bin/python";
|
||||
my $BUILDBOT_PATH = "/tools/buildbot/bin/buildbot";
|
||||
my $MASTER_HOST = "localhost:9982";
|
||||
my $PATCH_BRANCH = "PATCH_TRY";
|
||||
my $HG_BRANCH = "HG_TRY";
|
||||
# if multiple patches are being this controls the delay between them
|
||||
# this value should be more than the treeStableTimer on the Scheduler
|
||||
my $DELAY = 5;
|
||||
|
||||
|
||||
# set up the patch directory
|
||||
if (-e $PATCHDIR) {
|
||||
if (! -d $PATCHDIR) {
|
||||
print STDERR "Patch directory is a file\n";
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (! MkdirWithPath(dir => $PATCHDIR)) {
|
||||
print STDERR "Could not create patch directory\n";
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
RunShellCommand(command => "wget",
|
||||
args => ['--no-check-certificate', '-q', '-r', '-l1',
|
||||
'-np', '-nd', '-Rindex.html*,.1',
|
||||
'-P', $PATCHDIR, $PATCHURL],
|
||||
logfile => $LOGFILE,
|
||||
appendLogfile => 1,
|
||||
redirectStderr => 1);
|
||||
|
||||
# set-up the logfile
|
||||
open(LOGFILE, ">>$LOGFILE") ||
|
||||
die("Could not open logfile\nFailure message: $!\n");
|
||||
|
||||
opendir(DIR, $PATCHDIR) ||
|
||||
die("Could not read patch directory\nFailure message: $!\n");
|
||||
my @files = grep { /^[\w.-]+\.info$/ } readdir(DIR);
|
||||
closedir(DIR) || die("Could not close directory\nFailure message: $!\n");
|
||||
|
||||
if (0 == scalar(@files)) {
|
||||
print LOGFILE scalar(localtime()) . " - No Patches, exiting...\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
# any changes left still need a sendchange generated
|
||||
foreach my $file (@files) {
|
||||
my (%info, $key, $value, $rv);
|
||||
my $infoFilename = catfile($PATCHDIR, $file);
|
||||
|
||||
open(INFOFILE, $infoFilename) ||
|
||||
die("Could not open info file: $file\nFailure message: $!\n");
|
||||
while (<INFOFILE>) {
|
||||
if ($_ !~ /^\s*$/) {
|
||||
($key, $value) = split(/: ?/, $_, 2);
|
||||
chomp($value);
|
||||
$info{$key} = $value;
|
||||
}
|
||||
}
|
||||
close(INFOFILE) ||
|
||||
die("Could not close info file: $file\nFailure message: $!\n");
|
||||
|
||||
if (! exists $info{'processed'} || ! scalar($info{'processed'})) {
|
||||
if ($info{'type'} eq "patch") {
|
||||
$rv = RunShellCommand(
|
||||
command => $PYTHON_PATH,
|
||||
args => [$BUILDBOT_PATH, "sendchange",
|
||||
"--username", $info{'submitter'},
|
||||
"--master", $MASTER_HOST,
|
||||
"--branch", $PATCH_BRANCH,
|
||||
"--comments", "$info{'description'}",
|
||||
"mozconfig: $info{'mozconfig'}",
|
||||
"identifier: $info{'identifier'}",
|
||||
"branch: $info{'branch'}",
|
||||
"patchLevel: $info{'patchLevel'}",
|
||||
"patchFile: $info{'patchFile'}"],
|
||||
logfile => "/tmp/mine"
|
||||
);
|
||||
}
|
||||
elsif ($info{'type'} eq "hg") {
|
||||
$rv = RunShellCommand(
|
||||
command => $PYTHON_PATH,
|
||||
args => [$BUILDBOT_PATH, "sendchange",
|
||||
"--username", $info{'submitter'},
|
||||
"--master", $MASTER_HOST,
|
||||
"--branch", $HG_BRANCH,
|
||||
"--comments", "$info{'description'}",
|
||||
"mozconfig: $info{'mozconfig'}",
|
||||
"identifier: $info{'identifier'}",
|
||||
"mozillaRepoPath: $info{'mozillaRepoPath'}",
|
||||
"tamarinRepoPath: $info{'tamarinRepoPath'}"]
|
||||
);
|
||||
}
|
||||
else {
|
||||
print LOGFILE "Bad info file\n";
|
||||
}
|
||||
|
||||
if (0 == $rv->{'exitValue'} && -1 == index($rv->{'output'}, "NOT")) {
|
||||
# sendchange succeeded
|
||||
open(INFO, ">>$infoFilename") ||
|
||||
die("Could not open info file: $file\nFailure message: $!\n");
|
||||
print INFO "\nprocessed: 1\n";
|
||||
close(INFO) ||
|
||||
die("Coould not close info file: $file\nFailure message: $!\n");
|
||||
sleep($DELAY);
|
||||
}
|
||||
else {
|
||||
# sendchange failed
|
||||
print LOGFILE "Could not send change: $file\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
close(LOGFILE) || die("Could not close logfile\nFailure message: $!\n");
|
||||
@ -28,6 +28,7 @@ from time import localtime, strftime
|
||||
import re
|
||||
|
||||
from twisted.python import log
|
||||
from twisted.internet import reactor
|
||||
|
||||
from buildbot.steps.shell import ShellCommand
|
||||
from buildbot.steps.source import Mercurial
|
||||
@ -175,7 +176,7 @@ class MozillaPatchDownload(FileDownload):
|
||||
|
||||
haltOnFailure = True
|
||||
|
||||
def __init__(self, patchDir=".", **kwargs):
|
||||
def __init__(self, isOptional=False, patchDir=".", **kwargs):
|
||||
"""arguments:
|
||||
@type patchDir: string
|
||||
@param patchDir: The directory on the master that holds the patches
|
||||
@ -185,9 +186,11 @@ class MozillaPatchDownload(FileDownload):
|
||||
Defaults to '.'
|
||||
'workdir' is assumed to be 'build' and should be passed if it is
|
||||
anything else.
|
||||
'isOptional' is assumed to be False; if the patch is optional, pass True.
|
||||
"""
|
||||
|
||||
self.patchDir = patchDir
|
||||
self.isOptional = isOptional
|
||||
# mastersrc and slavedest get overridden in start()
|
||||
if not 'workdir' in kwargs:
|
||||
kwargs['workdir'] = "build"
|
||||
@ -197,10 +200,13 @@ class MozillaPatchDownload(FileDownload):
|
||||
changes = self.step_status.build.getChanges()
|
||||
|
||||
if len(changes) < 1:
|
||||
return
|
||||
return SKIPPED
|
||||
|
||||
args = parseSendchangeArguments(changes[0].files)
|
||||
|
||||
if not 'patchFile' in args and self.isOptional:
|
||||
return SKIPPED
|
||||
|
||||
self.mastersrc = "%s/%s" % (self.patchDir, args['patchFile'])
|
||||
self.slavedest = "%s" % (args['patchFile'])
|
||||
|
||||
@ -208,6 +214,7 @@ class MozillaPatchDownload(FileDownload):
|
||||
FileDownload.start(self)
|
||||
|
||||
|
||||
|
||||
class MozillaUploadTryBuild(ShellCommand):
|
||||
warnOnFailure = True
|
||||
|
||||
@ -317,8 +324,13 @@ class MozillaCustomPatch(ShellCommand):
|
||||
"""
|
||||
'workdir' is assumed to be 'build' and should be passed if it is
|
||||
anything else.
|
||||
'isOptional' is assumed to be False; if the patch is optional, pass True.
|
||||
"""
|
||||
|
||||
if 'isOptional' in kwargs:
|
||||
self.optional = kwargs['isOptional']
|
||||
else:
|
||||
self.optional = False
|
||||
if not 'workdir' in kwargs:
|
||||
kwargs['workdir'] = "build"
|
||||
ShellCommand.__init__(self, **kwargs)
|
||||
@ -329,14 +341,17 @@ class MozillaCustomPatch(ShellCommand):
|
||||
log.msg("No changes, not doing anything")
|
||||
self.step_status.setColor("yellow")
|
||||
self.step_status.setText(["Skipped patch step:", "no patch"])
|
||||
self.finished(WARNINGS)
|
||||
return
|
||||
self.finished(SKIPPED)
|
||||
return SKIPPED
|
||||
|
||||
if len(changes) > 1:
|
||||
log.msg("Ignoring all but the first change...")
|
||||
|
||||
args = parseSendchangeArguments(changes[0].files)
|
||||
|
||||
if not 'patchFile' in args and self.optional:
|
||||
return SKIPPED
|
||||
|
||||
self.setCommand(["patch", "-f", "-p%d" % int(args['patchLevel']), "-i",
|
||||
args['patchFile']])
|
||||
ShellCommand.start(self)
|
||||
|
||||
@ -38,16 +38,16 @@ use MozBuild::Util qw(RunShellCommand MkdirWithPath);
|
||||
my $ST_INODE = 1;
|
||||
|
||||
# where to retrieve files from -- make sure this has a trailing slash
|
||||
my $PATCHURL = "http://localhost/patches/";
|
||||
my $PATCHURL = "https://build.mozilla.org/patches/";
|
||||
# where the patches go
|
||||
my $PATCHDIR = ".";
|
||||
my $PATCHDIR = "patches/";
|
||||
# where to log errors
|
||||
my $LOGFILE = "downloader.log";
|
||||
|
||||
my $PYTHON_PATH = "/usr/bin/python";
|
||||
my $BUILDBOT_PATH = "/usr/bin/buildbot";
|
||||
my $MASTER_HOST = "localhost:9989";
|
||||
my $PATCH_BRANCH = "PATCH_TRY";
|
||||
my $PYTHON_PATH = "/tools/python/bin/python";
|
||||
my $BUILDBOT_PATH = "/tools/buildbot/bin/buildbot";
|
||||
my $MASTER_HOST = "localhost:9982";
|
||||
my $CVS_BRANCH = "PATCH_TRY";
|
||||
my $HG_BRANCH = "HG_TRY";
|
||||
# if multiple patches are being this controls the delay between them
|
||||
# this value should be more than the treeStableTimer on the Scheduler
|
||||
@ -108,39 +108,45 @@ foreach my $file (@files) {
|
||||
die("Could not close info file: $file\nFailure message: $!\n");
|
||||
|
||||
if (! exists $info{'processed'} || ! scalar($info{'processed'})) {
|
||||
my $args = [$BUILDBOT_PATH, "sendchange",
|
||||
"--username", $info{'submitter'},
|
||||
"--master", $MASTER_HOST,
|
||||
"--comments", "$info{'description'}"];
|
||||
|
||||
my $required = [];
|
||||
my $optional = [];
|
||||
|
||||
if ($info{'type'} eq "patch") {
|
||||
$rv = RunShellCommand(
|
||||
command => $PYTHON_PATH,
|
||||
args => [$BUILDBOT_PATH, "sendchange",
|
||||
"--username", $info{'submitter'},
|
||||
"--master", $MASTER_HOST,
|
||||
"--branch", $PATCH_BRANCH,
|
||||
"--comments", "$info{'description'}",
|
||||
"mozconfig: $info{'mozconfig'}",
|
||||
"identifier: $info{'identifier'}",
|
||||
"branch: $info{'branch'}",
|
||||
"patchLevel: $info{'patchLevel'}",
|
||||
"patchFile: $info{'patchFile'}"]
|
||||
);
|
||||
}
|
||||
elsif ($info{'type'} eq "hg") {
|
||||
$rv = RunShellCommand(
|
||||
command => $PYTHON_PATH,
|
||||
args => [$BUILDBOT_PATH, "sendchange",
|
||||
"--username", $info{'submitter'},
|
||||
"--master", $MASTER_HOST,
|
||||
"--branch", $HG_BRANCH,
|
||||
"--comments", "$info{'description'}",
|
||||
"mozconfig: $info{'mozconfig'}",
|
||||
"identifier: $info{'identifier'}",
|
||||
"mozillaRepoPath: $info{'mozillaRepoPath'}",
|
||||
"tamarinRepoPath: $info{'tamarinRepoPath'}"]
|
||||
);
|
||||
}
|
||||
else {
|
||||
print LOGFILE "Bad info file\n";
|
||||
}
|
||||
|
||||
push @$args, "--branch", $CVS_BRANCH;
|
||||
push @$required, "mozconfig", "identifier", "branch", "patchLevel", "patchFile";
|
||||
}
|
||||
elsif ($info{'type'} eq "hg") {
|
||||
push @$args, "--branch", $HG_BRANCH;
|
||||
push @$required, "mozconfig", "identifier", "mozillaRepoPath";
|
||||
push @$optional, "tamarinRepoPath", "patchLevel", "patchFile";
|
||||
}
|
||||
else {
|
||||
print LOGFILE "Bad info file\n";
|
||||
die;
|
||||
}
|
||||
|
||||
foreach my $arg (@$required) {
|
||||
if (!exists($info{$arg})) {
|
||||
print LOGFILE "Missing arg '$arg' in info file\n";
|
||||
die;
|
||||
}
|
||||
push @$args, "$arg: $info{$arg}";
|
||||
}
|
||||
|
||||
foreach my $arg (@$optional) {
|
||||
if (exists($info{$arg})) {
|
||||
push @$args, "$arg: $info{$arg}";
|
||||
}
|
||||
}
|
||||
|
||||
$rv = RunShellCommand(command => $PYTHON_PATH,
|
||||
args => $args);
|
||||
|
||||
if (0 == $rv->{'exitValue'} && -1 == index($rv->{'output'}, "NOT")) {
|
||||
# sendchange succeeded
|
||||
open(INFO, ">>$infoFilename") ||
|
||||
|
||||
@ -38,13 +38,11 @@ my $MAINTENANCE_MODE = 0;
|
||||
# 10*1024*1024 is 10MB
|
||||
my $SIZE_LIMIT = 10*1024*1024;
|
||||
# the URL to the buildbot insntallation the patches will eventually go to
|
||||
my $BUILDBOT_URL = 'http://tinderbox.mozilla.org/MozillaTry/';
|
||||
my $BUILDBOT_URL = 'http://tinderbox.mozilla.org/showbuilds.cgi?tree=MozillaTry';
|
||||
# the URL to the sendchange.cgi script
|
||||
my $SENDCHANGE_URL = 'http://localhost/cgi-bin/sendchange.cgi';
|
||||
my $SENDCHANGE_URL = 'https://build.mozilla.org/sendchange.cgi';
|
||||
# the default path to the mozilla-central hg repository
|
||||
my $MOZILLA_REPO_PATH = 'http://hg.mozilla.org/mozilla-central';
|
||||
# the default path to the tamarin-central hg repository
|
||||
my $TAMARIN_REPO_PATH = 'http://hg.mozilla.org/tamarin-central';
|
||||
# the URL to the try server documentation
|
||||
my $DOCUMENTATION_URL = 'http://wiki.mozilla.org/Build:TryServer';
|
||||
|
||||
@ -79,7 +77,6 @@ sub WritePage
|
||||
my $description = "";
|
||||
my $type = "patch";
|
||||
my $mozillaRepoPath = $MOZILLA_REPO_PATH;
|
||||
my $tamarinRepoPath = $TAMARIN_REPO_PATH;
|
||||
my @err;
|
||||
if (exists $args{'patchLevel'} && $args{'patchLevel'} !~ /^\s*$/) {
|
||||
$patchLevel = $args{'patchLevel'};
|
||||
@ -100,10 +97,6 @@ sub WritePage
|
||||
$args{'mozillaRepoPath'} !~ /^\s*$/) {
|
||||
$mozillaRepoPath = $args{'mozillaRepoPath'};
|
||||
}
|
||||
if (exists $args{'tamarinRepoPath'} &&
|
||||
$args{'tamarinRepoPath'} ne "") {
|
||||
$tamarinRepoPath = $args{'tamarinRepoPath'};
|
||||
}
|
||||
if (exists $args{'err'}) {
|
||||
@err = @{$args{'err'}};
|
||||
}
|
||||
@ -132,7 +125,7 @@ sub WritePage
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#types {
|
||||
#header {
|
||||
width: 75%;
|
||||
margin: 20px auto;
|
||||
border: 3px solid #AAA;
|
||||
@ -150,7 +143,7 @@ sub WritePage
|
||||
color: red;
|
||||
}
|
||||
|
||||
table {
|
||||
#mainTable {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
width: 80%;
|
||||
@ -193,64 +186,54 @@ sub WritePage
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
#patchfield {
|
||||
.important {
|
||||
font-weight: bold;
|
||||
font-size: 140%;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function disable(id) {
|
||||
var element = document.getElementById(id);
|
||||
element.disabled = "disabled";
|
||||
element.style.backgroundColor = "#D4D0C8";
|
||||
}
|
||||
function verify(form) {
|
||||
var baseType = null;
|
||||
|
||||
function enable(id) {
|
||||
var element = document.getElementById(id);
|
||||
element.disabled = "";
|
||||
element.style.backgroundColor = "white";
|
||||
}
|
||||
for (var i = 0; i < form.baseType.length; i++) {
|
||||
if (form.baseType[i].checked) {
|
||||
baseType = form.baseType[i].value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function show(id, displayType) {
|
||||
var element = document.getElementById(id);
|
||||
element.style.display = displayType;
|
||||
}
|
||||
alert("base type: " + baseType);
|
||||
|
||||
function hide(id) {
|
||||
var element = document.getElementById(id);
|
||||
element.style.display = "none";
|
||||
}
|
||||
if (baseType == "mozillacentral" || baseType == "cvstrunk" || form['mozilla-repo'].value == "$MOZILLA_REPO_PATH") {
|
||||
if (form.patchFile.value == "") {
|
||||
alert ("Patch file is required!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function use_patchFile() {
|
||||
hide("hgTable");
|
||||
show("patchTable", "table");
|
||||
document.getElementById("patch").checked = "checked";
|
||||
}
|
||||
if (baseType == "mozillacentral") {
|
||||
form["mozilla-repo"].value = "$MOZILLA_REPO_PATH";
|
||||
}
|
||||
|
||||
function use_hg() {
|
||||
hide("patchTable");
|
||||
show("hgTable", "table");
|
||||
document.getElementById("hg").checked = "checked";
|
||||
if (baseType == "mozillacentral" || baseType == "customhg") {
|
||||
form["type"].value = "hg";
|
||||
} else {
|
||||
form["type"].value = "patch";
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="
|
||||
__END_OF_HTML__
|
||||
if ($type eq "patch") {
|
||||
print 'use_patchFile(); ';
|
||||
} elsif ($type eq "hg") {
|
||||
print 'use_hg();'
|
||||
}
|
||||
# close the onload quotes and body tag
|
||||
print '">';
|
||||
print <<__END_OF_HTML__;
|
||||
<body>
|
||||
<form action="$SENDCHANGE_URL"
|
||||
method="post" enctype="multipart/form-data">
|
||||
method="post" enctype="multipart/form-data"
|
||||
onsubmit="return verify(this);">
|
||||
<div id="main">
|
||||
|
||||
<div id="types">
|
||||
<div id="header">
|
||||
__END_OF_HTML__
|
||||
if ($MAINTENANCE_MODE) {
|
||||
print ' <h2 style="text-align:center;">';
|
||||
@ -264,22 +247,30 @@ __END_OF_HTML__
|
||||
href="$DOCUMENTATION_URL">wiki page</a>. For build status, check the <a
|
||||
href="$BUILDBOT_URL">tinderbox</a>. Test builds are deleted after 30 days.</p>
|
||||
<p>Note: Uploaded patches must be less than 10240kB in size.</p>
|
||||
<ul id="testType">
|
||||
<li>
|
||||
<input id="patch" name="type" value="patch" onclick="use_patchFile();"
|
||||
type="radio">
|
||||
<label for="patch">Upload a Patch</label>
|
||||
</li>
|
||||
<li>
|
||||
<input id="hg" name="type" value="hg" onclick="use_hg();" type="radio">
|
||||
<label for="hg">Test a Mercurial Repository</label>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<table id="patchTable">
|
||||
<table id="mainTable">
|
||||
<tr>
|
||||
<td class="lbl" id="patchfield"><label for="patchFile">Patch:</label></td>
|
||||
<td class="lbl important">Source:</td>
|
||||
<td class="field">
|
||||
<table id="sourceTable">
|
||||
<tr>
|
||||
<td valign="top"><input name="baseType" value="mozillacentral" type="radio" checked></td>
|
||||
<td><label for="mozillacentral"><a href="http://hg.mozilla.org/mozilla-central/">mozilla-central</a> Mercurial repository (patch required)</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><input name="baseType" value="customhg" type="radio"></td>
|
||||
<td><label for="customhg">Use another Mercurial repository: <input id="mozilla-repo" name="mozilla-repo" value="http://hg.mozilla.org/mozilla-central" type="text" size="45"></label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><input name="baseType" value="cvstrunk" type="radio"></td>
|
||||
<td><label for="cvs">CVS Trunk (patch required)</label></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="lbl important"><label for="patchFile">Patch:</label></td>
|
||||
<td class="field">
|
||||
<input id="patchFile" name="patchFile" type="file">
|
||||
</td>
|
||||
@ -307,30 +298,6 @@ __END_OF_HTML__
|
||||
<input id="branch" name="branch" type="text" value="$branch">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="hgTable">
|
||||
<tr>
|
||||
<td class="lbl">
|
||||
<label for="mozilla-repo">Mozilla repository:</label>
|
||||
</td>
|
||||
<td class="field">
|
||||
<input id="mozilla-repo" name="mozilla-repo" value="$mozillaRepoPath"
|
||||
type="text">(required)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="lbl">
|
||||
<label for="tamarin-repo">Tamarin repository:</label>
|
||||
</td>
|
||||
<td class="field">
|
||||
<input id="tamarin-repo" name="tamarin-repo" value="$tamarinRepoPath"
|
||||
type="text">(required)
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="allTable">
|
||||
<tr>
|
||||
<td class="lbl">
|
||||
<label for="identifier">Custom Identifier String</label><span id="identifierTooltip"
|
||||
@ -361,6 +328,8 @@ __END_OF_HTML__
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<input type="hidden" id="typeInput" name="type" value="patch">
|
||||
|
||||
<p id="errors" class="alert">
|
||||
__END_OF_HTML__
|
||||
foreach my $e (@err) {
|
||||
|
||||
@ -44,7 +44,7 @@ require 'sendchange-ui.pm';
|
||||
use vars qw($SIZE_LIMIT);
|
||||
|
||||
# where patches and info files will go after being submitted
|
||||
my $PATCH_DIR = '/buildbot/patches';
|
||||
my $PATCH_DIR = '/var/www/html/build/patches';
|
||||
# regexes for validation
|
||||
my $ALLOWED_TEXT_REGEX = '^[\w\s,.]+$';
|
||||
my $ALLOWED_FILENAME_REGEX = '^([\w-]|\.[\w-])+$';
|
||||
@ -59,12 +59,12 @@ sub Process
|
||||
my $key = int(rand(1000));
|
||||
# get the parameters
|
||||
my $name = $ENV{'REMOTE_USER'};
|
||||
my $baseType = param('baseType');
|
||||
my $type = param('type');
|
||||
my $patchFile = param('patchFile');
|
||||
my $patchLevel = param('patchLevel');
|
||||
my $branch = param('branch');
|
||||
my $mozillaRepoPath = param('mozilla-repo');
|
||||
my $tamarinRepoPath = param('tamarin-repo');
|
||||
my $identifier = param('identifier');
|
||||
my $description = param('description');
|
||||
my $mozconfig = param('mozconfig');
|
||||
@ -100,7 +100,7 @@ sub Process
|
||||
}
|
||||
|
||||
# Using a patchFile
|
||||
if ($type eq "patch") {
|
||||
if ($type eq "patch" || $baseType eq "mozillacentral") {
|
||||
if ($branch eq "" || $branch eq "trunk") {
|
||||
$branch = "HEAD";
|
||||
}
|
||||
@ -144,7 +144,6 @@ sub Process
|
||||
description => $description,
|
||||
type => $type,
|
||||
mozillaRepoPath => $mozillaRepoPath,
|
||||
tamarinRepoPath => $tamarinRepoPath,
|
||||
err => \@err);
|
||||
return;
|
||||
}
|
||||
@ -156,16 +155,13 @@ sub Process
|
||||
if (! close(PATCH)) {
|
||||
push(@err, "Server error - Could not close patchfile.");
|
||||
}
|
||||
} elsif ($type eq "hg") {
|
||||
}
|
||||
if ($type eq "hg") {
|
||||
# TODO: is this a valid way to test if there's a repo there?
|
||||
if (!get($mozillaRepoPath)) {
|
||||
push(@err, 'Mozilla repository path is not valid');
|
||||
}
|
||||
|
||||
if (!get($tamarinRepoPath)) {
|
||||
push(@err, 'Tamarin repository path is not valid');
|
||||
}
|
||||
|
||||
if (scalar(@err) > 0) {
|
||||
WritePage(patchLevel => $patchLevel,
|
||||
branch => $branch,
|
||||
@ -173,26 +169,13 @@ sub Process
|
||||
description => $description,
|
||||
type => $type,
|
||||
mozillaRepoPath => $mozillaRepoPath,
|
||||
tamarinRepoPath => $tamarinRepoPath,
|
||||
err => \@err);
|
||||
return;
|
||||
}
|
||||
|
||||
# generate the infofile name
|
||||
$infoFile = "$time-$key-hg.info";
|
||||
} else {
|
||||
push(@err, 'Please test a patch or a Mercurial repository.');
|
||||
WritePage(patchLevel => $patchLevel,
|
||||
branch => $branch,
|
||||
identifier => $identifier,
|
||||
description => $description,
|
||||
type => $type,
|
||||
mozillaRepoPath => $mozillaRepoPath,
|
||||
tamarinRepoPath => $tamarinRepoPath,
|
||||
err => \@err);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
my $mozconfigHandle = upload('mozconfig');
|
||||
if (! -z $mozconfigHandle) {
|
||||
@ -206,7 +189,6 @@ sub Process
|
||||
description => $description,
|
||||
type => $type,
|
||||
mozillaRepoPath => $mozillaRepoPath,
|
||||
tamarinRepoPath => $tamarinRepoPath,
|
||||
err => \@err);
|
||||
return;
|
||||
}
|
||||
@ -221,7 +203,6 @@ sub Process
|
||||
description => $description,
|
||||
type => $type,
|
||||
mozillaRepoPath => $mozillaRepoPath,
|
||||
tamarinRepoPath => $tamarinRepoPath,
|
||||
err => \@err);
|
||||
return;
|
||||
}
|
||||
@ -238,31 +219,19 @@ sub Process
|
||||
description => $description,
|
||||
type => $type,
|
||||
mozillaRepoPath => $mozillaRepoPath,
|
||||
tamarinRepoPath => $tamarinRepoPath,
|
||||
err => \@err);
|
||||
return;
|
||||
}
|
||||
|
||||
print INFO "submitter: $name\n";
|
||||
print INFO "type: $type\n";
|
||||
if ($type eq "patch") {
|
||||
if ($type eq "patch" || $baseType eq 'mozillacentral') {
|
||||
print INFO "patchFile: $patchFile\n";
|
||||
print INFO "patchLevel: $patchLevel\n";
|
||||
print INFO "branch: $branch\n";
|
||||
} elsif ($type eq "hg") {
|
||||
}
|
||||
if ($type eq "hg") {
|
||||
print INFO "mozillaRepoPath: $mozillaRepoPath\n";
|
||||
print INFO "tamarinRepoPath: $tamarinRepoPath\n";
|
||||
} else {
|
||||
push(@err, 'Please test a patch or a Mercurial repository.');
|
||||
WritePage(patchLevel => $patchLevel,
|
||||
branch => $branch,
|
||||
identifier => $identifier,
|
||||
description => $description,
|
||||
type => $type,
|
||||
mozillaRepoPath => $mozillaRepoPath,
|
||||
tamarinRepoPath => $tamarinRepoPath,
|
||||
err => \@err);
|
||||
return;
|
||||
}
|
||||
print INFO "identifier: $identifier\n";
|
||||
print INFO "mozconfig: $mozconfig\n";
|
||||
@ -276,7 +245,6 @@ sub Process
|
||||
description => $description,
|
||||
type => $type,
|
||||
mozillaRepoPath => $mozillaRepoPath,
|
||||
tamarinRepoPath => $tamarinRepoPath,
|
||||
err => \@err);
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user