Permalink
Browse files

Various updates to bugmon:

	* Check if requested branch is valid
	* Remove update flag if bug cannot be processed
	* Workaround for new bzapi issue
  • Loading branch information...
choller committed Dec 12, 2012
1 parent 079508d commit 92c4c69fed98531ca9b31258cc99eb5787c09652
Showing with 36 additions and 14 deletions.
  1. +36 −14 bugmon.py
View
@@ -175,7 +175,7 @@ def __init__(self, apiroot, username, password, repoBase, options):
def fetchBug(self, bug_id):
bug = self.bz.get_bug(bug_id)
- if len(bug.depends_on) > 0:
+ if bug.depends_on != None and len(bug.depends_on) > 0:
if isinstance(bug.depends_on[0], str):
bug.depends_on = [ int("".join(bug.depends_on)) ]
@@ -314,6 +314,7 @@ def processCommand(self, bugnum):
bugVerifyRequested = False
bugBisectRequested = False
bugBisectFixRequested = False
+ bugFailureMsg = None
bugUpdated = False
closeBug = False
@@ -364,6 +365,8 @@ def processCommand(self, bugnum):
if (cmd == "verify-branch"):
branches = param.split(';');
for branch in branches:
+ if not branch in ['mozilla-aurora', 'mozilla-beta', 'mozilla-release', 'mozilla-esr17']:
+ continue
print "Branch " + branch
branchResult = self.reproduceBug(bug, branch)
if (branchResult.status == BugMonitorResult.statusCodes.REPRODUCED_TIP):
@@ -396,19 +399,33 @@ def processCommand(self, bugnum):
if bugUpdateRequested:
if bug.status != "RESOLVED" and bug.status != "VERIFIED":
if result == None:
- result = self.reproduceBug(bug)
- if (result.status == BugMonitorResult.statusCodes.REPRODUCED_TIP):
- if bugConfirmRequested:
- print "Marking bug " + str(bugnum) + " as confirmed on tip..."
+ try:
+ result = self.reproduceBug(bug)
+ except BugException as b:
+ bugFailureMsg = "Cannot process bug: " + str(b)
+ except Exception as e:
+ bugFailureMsg = "Cannot process bug: Unknown exception (check manually)"
+ print "Caught exception: " + str(e)
+ print traceback.format_exc()
+
+ if result != None:
+ if (result.status == BugMonitorResult.statusCodes.REPRODUCED_TIP or result.status == BugMonitorResult.statusCodes.REPRODUCED_SWITCHED):
+ bugReproduced = True
+ if bugConfirmRequested:
+ print "Marking bug " + str(bugnum) + " as confirmed on tip..."
+ # Add a comment
+ comments.append("JSBugMon: This bug has been automatically confirmed to be still valid (reproduced on revision " + result.tipRev + ").")
+
+ elif (result.status == BugMonitorResult.statusCodes.REPRODUCED_FIXED):
+ print "Marking bug " + str(bugnum) + " as non-reproducing on tip..."
# Add a comment
- comments.append("JSBugMon: This bug has been automatically confirmed to be still valid (reproduced on revision " + result.tipRev + ").")
-
- elif (result.status == BugMonitorResult.statusCodes.REPRODUCED_FIXED):
- print "Marking bug " + str(bugnum) + " as non-reproducing on tip..."
- # Add a comment
- comments.append("JSBugMon: The testcase found in this bug no longer reproduces (tried revision " + result.tipRev + ").")
- if bugCloseRequested:
- closeBug = True
+ comments.append("JSBugMon: The testcase found in this bug no longer reproduces (tried revision " + result.tipRev + ").")
+ if bugCloseRequested:
+ closeBug = True
+
+ elif (result.status == BugMonitorResult.statusCodes.FAILED):
+ bugFailureMsg = "Cannot process bug: Unable to reproduce bug on original revision."
+
if bugBisectRequested and bug.status != "RESOLVED" and bug.status != "VERIFIED":
if result == None:
@@ -454,6 +471,11 @@ def processCommand(self, bugnum):
wbOpts.remove('bisectfix')
comments.extend(bisectFixComments)
+ if bugFailureMsg != None and bugUpdateRequested:
+ whiteBoardModified = True
+ wbOpts.remove('update')
+ comments.append(bugFailureMsg)
+
if whiteBoardModified:
wbParts = filter(lambda x: len(x) > 0, map(str.rstrip, map(str.lstrip, re.split('\[jsbugmon:[^\]]+\]', bug.whiteboard))))
wbParts.append("[jsbugmon:" + ",".join(wbOpts) + "]")
@@ -507,7 +529,7 @@ def bisectBug(self, bugnum, reproductionResult, bisectForFix=False):
if bisectForFix:
revFlag = '-s'
- cmd = [ 'python', '/home/decoder/LangFuzz/fuzzing/autobisect-js/autoBisect.py', '-R', os.path.join(self.repoBase, reproductionResult.branchName), '-a', reproductionResult.arch, '-c', reproductionResult.ctype, revFlag, reproductionResult.origRev, '-p', " ".join(reproductionResult.testFlags) + " " + reproductionResult.testPath, '-i', 'crashes', '--timeout=10' ]
+ cmd = [ 'python', '/srv/repos/fuzzing/autobisect-js/autoBisect.py', '-R', os.path.join(self.repoBase, reproductionResult.branchName), '-a', reproductionResult.arch, '-c', reproductionResult.ctype, revFlag, reproductionResult.origRev, '-p', " ".join(reproductionResult.testFlags) + " " + reproductionResult.testPath, '-i', 'crashes', '--timeout=10' ]
outLines = subprocess.check_output(cmd).split("\n");
retLines = []
found = False

0 comments on commit 92c4c69

Please sign in to comment.