aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-07-29 12:59:34 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-09-17 17:08:14 +0200
commit5172d8d70e9bc0ed8ea2808128eb42596513f4bb (patch)
tree13afc2cb4c4ecc4c7d7acaadeb805604bc777655
parentd93d46e4f9e11cb6e11e54fff71298e231d09bc9 (diff)
downloadbugzilla-triage-5172d8d70e9bc0ed8ea2808128eb42596513f4bb.tar.gz
First attempt to attach backtraces instead of pasting them into comments
-rw-r--r--lib/rhbzpage.js51
1 files changed, 44 insertions, 7 deletions
diff --git a/lib/rhbzpage.js b/lib/rhbzpage.js
index 6ee4553..28fba16 100644
--- a/lib/rhbzpage.js
+++ b/lib/rhbzpage.js
@@ -229,6 +229,34 @@ RHBugzillaPage.prototype.centralCommandDispatch = function(cmdLabel, cmdParams)
}
};
+RHBugzillaPage.prototype.addAttachment = function addAttachment(data) {
+ var msg = new xrpc.XMLRPCMessage("bugzilla.addAttachment");
+ var that = this;
+
+ msg.addParameter(this.bugNo);
+ msg.addParameter({
+ description: "Interesting part of the thread backtrace where crash happened.",
+ filename: "parsed-backtrace.txt",
+ contenttype: "text/plain",
+ data: this.win.btoa(data),
+ nomail: true
+ });
+ msg.addParameter(this.login);
+ msg.addParameter(this.password);
+
+ Request({
+ url: this.constantData.XMLRPCData[this.hostname].url,
+ onComplete: function() {
+ if (this.response.status == 200) {
+ that.XMLRPCcallback.call(that);
+ }
+ },
+ content: msg.xml(),
+ contentType: "text/xml"
+ }).post();
+ this.reqCounter++;
+};
+
/* Bugzilla functions. */
/**
@@ -273,7 +301,9 @@ RHBugzillaPage.prototype.pasteBacktraceInComments = function() {
+ x[1];
console.log("attURL = " + attURL);
console.log("this.btSnippet = " + this.btSnippet);
- if (!this.btSnippet) {
+ console.log("btparsed = " + this.idContainsWord("cf_devel_whiteboard", 'btparsed'))
+ if ((!this.btSnippet) &&
+ (!this.idContainsWord("cf_devel_whiteboard", 'btparsed'))) {
var that = this;
Request({
url: attURL,
@@ -281,13 +311,19 @@ RHBugzillaPage.prototype.pasteBacktraceInComments = function() {
if (this.response.status == 200) {
that.btSnippet = that.parseBacktrace(this.response.text);
if (that.btSnippet) {
- that.addStuffToTextBox("comment", that.btSnippet);
- that.addStuffToTextBox("status_whiteboard",
- "btparsed");
+ // FIXME add a button
+ // we have to create a new acttion addAttachment
+ // with handling in this.centralCommandDispatch
+ //
+ // that.addAttachment.call(that.btSnippet,that);
+ // that.addStuffToTextBox("status_whiteboard",
+ // "btparsed");
+ // this.reqCounter++;
}
}
}
}).get();
+
}
}, this);
}
@@ -704,9 +740,10 @@ RHBugzillaPage.prototype.getBugzillaName = function getBugzillaName(URLhostname)
* + responseHeaders
* + responseText
*/
-RHBugzillaPage.prototype.fixingMIMECallBack = function fixingMIMECallBack() {
+RHBugzillaPage.prototype.XMLRPCcallback = function XMLRPCcallback() {
var that = this;
- if (--this.reqCounter <= 0) {
+ this.reqCounter--;
+ if (this.reqCounter <= 0) {
timer.setTimeout(function () {
that.win.location.reload(true);
}, 1000);
@@ -760,7 +797,7 @@ RHBugzillaPage.prototype.fixAttachById = function(id, type, email) {
url: this.constantData.XMLRPCData[this.hostname].url,
onComplete: function() {
if (this.response.status == 200) {
- that.fixingMIMECallBack.call(that);
+ that.XMLRPCcallback.call(that);
}
},
content: msg.xml(),