aboutsummaryrefslogtreecommitdiffstats
path: root/data/rhbzpage.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2011-02-20 01:21:39 +0100
committerMatěj Cepl <mcepl@redhat.com>2011-02-20 01:21:39 +0100
commit2abc7e13fe87f92feceafaf348f553cf8b6c9b9e (patch)
tree6956d68273a6e15b4abf5c8bcb2437ad851eae1c /data/rhbzpage.js
parent71df561fef80abf523548727d77dba2ef8ab7b93 (diff)
downloadbugzilla-triage-2abc7e13fe87f92feceafaf348f553cf8b6c9b9e.tar.gz
Fix fill-in magic.
* changed regexp for parsing driver line, just PCI ID is relevant. * all magic is now in data * eliminated most unnecessary console.logs ... either changed to console.error or just removed.
Diffstat (limited to 'data/rhbzpage.js')
-rw-r--r--data/rhbzpage.js168
1 files changed, 30 insertions, 138 deletions
diff --git a/data/rhbzpage.js b/data/rhbzpage.js
index a374f4e..061f9ed 100644
--- a/data/rhbzpage.js
+++ b/data/rhbzpage.js
@@ -21,8 +21,8 @@ var RHITColor = new Color(102, 0, 102); // RGB 102, 0, 102; HSL 300, 0, 20
var logAnalyzeLogic = {
"AnalyzeInterestingLine": {
- "re": "^\\s*\\[?[ 0-9.]*\\]?\\s*\\(--\\) "+
- "([A-Za-z]+)\\([0-9]?\\): Chipset: (.*)$",
+ "re": "^\\[[ .0-9]+\\]\\s*\\(--\\) PCI:\\*\\([0-9:]+\\)\\s*" +
+ "([0-9a-f:]+).*$",
"func": chipsetMagic
},
"AnalyzeXorgLogBacktrace": {
@@ -55,8 +55,9 @@ function RHOnMessageHandler(msg) {
case "FixAttachmentMIMECallback":
XMLRPCcallback();
break;
+ case "AnalyzeInterestingLine":
case "AnalyzeXorgLogBacktrace":
- analyzeXorgLogBacktrace(msg.data);
+ findInterestingLine(msg.data, msg.cmd);
break;
case "queryUpstream":
queryUpstreamCallback(msg.data);
@@ -144,8 +145,7 @@ function RHcentralCommandDispatch(cmdLabel, cmdParams) {
markBugTriaged();
break;
case "chipMagic":
- var splitArr = cmdParams.split("\t");
- fillInWhiteBoard(splitArr[0], splitArr[1]);
+ fillInWhiteBoard(cmdParams);
break;
// If we don't have it here, call superclass method
default:
@@ -168,10 +168,8 @@ function addAttachmentCallback(resp) {
function addAttachment(data, callback, param) {
var params = [];
- console.log("addAttachment : constantData.passwordState.passAvailable = " +
- constantData.passwordState.passAvailable);
if (!constantData.passwordState.passAvailable) {
- console.log("addAttachment : No password, no XML-RPC calls; sorry");
+ console.error("addAttachment : No password, no XML-RPC calls; sorry");
return null;
}
@@ -196,7 +194,7 @@ function addAttachment(data, callback, param) {
/* === Bugzilla functions === */
/**
- *
+ *
*/
function pasteBacktraceInComments(atts) {
/*
@@ -230,7 +228,7 @@ function pasteBacktraceInComments(atts) {
if (!(isTriaged() || idContainsWord("status_whiteboard",
'btparsed') || (atts.length > 0))) {
- var btAttachments = attachments
+ var btAttachments = atts
.filter(function(att) {
return (/File: backtrace/.test(att[0]));
});
@@ -357,8 +355,6 @@ function addCheckShowLink(oldAtt, snippet) {
*/
function markBadAttachments(atts) {
var badMIMEArray = [ "application/octet-stream", "text/x-log", "undefined" ];
- console.log("markBadAttachments : constantData.passwordState.toSource() = " +
- constantData.passwordState.toSource());
if (!constantData.passwordState.passAvailable) {
console.log("markBadAttachments : No password, no XML-RPC calls; sorry");
return null;
@@ -548,77 +544,16 @@ function addCheckXorgLogLink(attList) {
* @param driverStr String with the driver name
* @return None
*/
-function fillInWhiteBoard(iLine, driverStr) {
- var ATIgetID = new RegExp("^.*\\(ChipID = 0x([0-9a-fA-F]+)\\).*$");
-
- function groupIDs(manStr, cardStrID) {
- var outStr = filterByRegexp(constantData.chipIDsGroupings,
- manStr + "," + cardStrID);
- if (outStr.length === 0) {
- outStr = "UNGROUPED_" + manStr + "/" + cardStrID;
- }
- return outStr;
- }
-
- /**
- * Given PCI IDs for manufacturer and card ID return chipset string
- *
- * @param manufacturerNo String with manufacturer PCI ID
- * @param cardNo String with card PCI ID
- * @return Array with chip string and optinoal variants
- */
- function checkChipStringFromID(manufacturerNo, cardNo) {
- var soughtID = (manufacturerNo + "," + cardNo).toUpperCase();
- var outList = constantData.PCI_ID_Array[soughtID];
- if (outList) {
- return outList;
- } else {
- return "";
- }
- }
-
+function fillInWhiteBoard(PCIidArr) {
var outStr = "";
var cardIDStr = "";
var cardIDArr = [];
+ var PCIid = PCIidArr[0] + "," + PCIidArr[1];
- chipSwitchboard: if (driverStr === "RADEON") {
- var cardID = iLine.replace(ATIgetID, "$1");
- cardIDArr = checkChipStringFromID("1002", cardID);
- if (cardIDArr.length > 0) {
- cardIDStr = cardIDArr[0];
- if (cardIDArr[1]) {
- optionStr = cardIDArr[1];
- outStr = groupIDs(driverStr, cardIDStr) + "/" + optionStr;
- } else {
- outStr = groupIDs(driverStr, cardIDStr);
- optionStr = "";
- }
- } else {
- outStr = "**** FULLSTRING: " + iLine;
- }
- } else {
- // Intel Corporation, NVIDIA
- cardIDArr = this.manuChipStrs.filter(function(el) {
- return new RegExp(el[0], "i").test(iLine);
- });
- if (cardIDArr && (cardIDArr.length > 0)) {
- cardIDArr = cardIDArr[0];
- } else {
- outStr = iLine;
- break chipSwitchboard;
- }
- // cardIDArr [0] = RE, [1] = ("RADEON","INTEL","NOUVEAU"), [2] = manu
- // PCIID
- iLine = iLine.replace(new RegExp(cardIDArr[0], "i")).trim();
- // nVidia developers opted-out from grouping
- if (driverStr === "INTEL") {
- outStr = groupIDs(cardIDArr[1], iLine);
- } else {
- outStr = iLine;
- }
- }
- addStuffToTextBox("status_whiteboard", ("card_" + outStr).trim());
- document.getElementById("chipMagic_btn").style.display = "none";
+ var cardName = constantData.chipNames[PCIid][0].toUpperCase();
+ var titleElem = document.getElementById('short_desc_nonedit_display');
+ titleElem.textContent = '[' + cardName + ']\u00A0' + titleElem.textContent;
+ document.getElementById("fillin_btn").style.display = "none";
}
/**
@@ -626,63 +561,30 @@ function fillInWhiteBoard(iLine, driverStr) {
* the whiteboard itself, just adds button to do so,paramList so that slow
* XMLHttpRequest is done in advance.
*
+ * @param log array of XorgLogAttList
* @return None
- * FIXME CURRENTLY BROKEN AND COMMENTED OUT
*/
-function fillInChipMagic(XorgLogAttList, XorgLogAttListIndex) {
- var ChipsetRE = new RegExp("^\\s*\\[?[ 0-9.]*\\]?\\s*\\(--\\) "+
- "([A-Za-z]+)\\([0-9]?\\): Chipset: (.*)$");
- var XorgLogURL = "";
- var XorgLogAttID = "";
- var XorgLogFound = false;
- var attURL = "", interestingLine = "";
- var interestingArray = [];
-
- if (XorgLogAttList.length === 0) {
- return;
- }
-
- XorgLogAttID = XorgLogAttList[XorgLogAttListIndex][1];
- attURL = "https://bugzilla.redhat.com/attachment.cgi?id="+XorgLogAttID;
+function fillInChipMagic(XlogID) {
+ analyzeXorgLog(XlogID, "AnalyzeInterestingLine");
+}
+function chipsetMagic (interestingLineArr) {
// parse Xorg.0.log
- Request({
- url: attURL,
- onComplete: function (response) {
- if (response.status == 200) {
- var interestingLineArr = response.text.split("\n").
- filter(function (v) {
- return ChipsetRE.test(v);
- });
- if (interestingLineArr.length >0) {
- // TODO we are parsing only the first found line; is it alright?
- interestingArray = ChipsetRE.exec(interestingLineArr[0]);
- interestingLine = interestingArray[2].
- replace(/[\s"]+/g," ").trim();
- // that.packages["rh-xorg"].chipMagic.chipMagic = interestingLine+"\t"+interestingArray[1]
- // .toUpperCase();
- console.log("interestingLineArr = " + interestingLineArr.toSource());
- createNewButton("status_whiteboard", true, {
- "name": "Fill In",
- "chipMagic": true
- });
- }
- }
+ var RE = new RegExp(logAnalyzeLogic['AnalyzeInterestingLine'].re);
+ if (interestingLineArr.length >0) {
+ var interestingArray = RE.exec(interestingLineArr[0]);
+ if (interestingArray.length > 1) {
+ var interestingPCIID = interestingArray[1].trim().split(":");
+ createNewButton("short_desc_nonedit_display", false, {
+ "name": "Fill In",
+ "chipMagic": interestingPCIID,
+ });
}
- }).get();
- this.XorgLogAttListIndex++;
-}
-
-function analyzeXorgLog(attachID) {
- postMessage(new Message("GetURL", {
- url: "https://bugzilla.redhat.com/attachment.cgi?id=" + attachID,
- backMessage: "AnalyzeXorgLogBacktrace"
- }));
+ }
}
function analyzeXorg(results) {
var innerString = "";
- // results.sort(); FIXME should I uncomment it?
results = removeDuplicates(results);
// Remove headers
if (results.length >= 1) {
@@ -920,19 +822,12 @@ function parseBacktrace (ret) {
function RHBZinit() {
// inheritance ... call superobject's constructor
- console.log("We are in RHBZinit");
var AbrtRE = new RegExp("^\\s*\\[abrt\\]");
- var btSnippet = "";
+ var btSnippet = "";
var signaturesCounter = 0;
var chipMagicInterestingLine = "";
- var maintCCAddr = null;
- if (constantData.CCmaintainer) {
- maintCCAddr = filterByRegexp(constantData.CCmaintainer,
- getComponent());
- }
-
// getBadAttachments
var XorgLogAttList = [];
var XorgLogAttListIndex = 0;
@@ -975,16 +870,13 @@ function RHBZinit() {
(XorgLogAttList[0] !== undefined) &&
(maintCCAddr === "xgl-maint@redhat.com")) {
// Add find chip magic button
- console.log("Adding a chip magic button!");
var whiteboard_string = document.getElementById("status_whiteboard").value;
- console.log("Whiteboard string = " + whiteboard_string);
if (!/card_/.test(whiteboard_string)) {
fillInChipMagic(XorgLogAttList[0][1]);
}
}
// we should make visible whether maintCCAddr is in CCList
- console.log("maintCCAddr = " + maintCCAddr);
if (maintCCAddr && isInList(maintCCAddr, getCCList())) {
var ccEditBoxElem = document.getElementById("cc_edit_area_showhide");
ccEditBoxElem.style.color = "navy";