Bug 1801780 - Include more information about blocklist in about:support. r=jrmuizel

We used to provide links to the bug numbers but this was broken
somewhere along the way. Now it is provided the failure IDs from which
it can attempt to extract a bug number, as well as always display any
failure ID and message whenever possible.

Differential Revision: https://phabricator.services.mozilla.com/D162734
This commit is contained in:
Andrew Osmond 2022-11-22 16:00:15 +00:00
parent 8b8b4e414f
commit d664f47e78
3 changed files with 49 additions and 31 deletions

View File

@ -210,15 +210,15 @@ void FeatureState::ForEachStatusChange(
aCallback("default", mDefault.mStatus, mDefault.MessageOrNull(),
mDefault.FailureId());
if (mUser.IsInitialized()) {
aCallback("user", mUser.mStatus, mUser.Message(), mDefault.FailureId());
aCallback("user", mUser.mStatus, mUser.Message(), mUser.FailureId());
}
if (mEnvironment.IsInitialized()) {
aCallback("env", mEnvironment.mStatus, mEnvironment.Message(),
mDefault.FailureId());
mEnvironment.FailureId());
}
if (mRuntime.IsInitialized()) {
aCallback("runtime", mRuntime.mStatus, mRuntime.Message(),
mDefault.FailureId());
mRuntime.FailureId());
}
}

View File

@ -801,39 +801,55 @@ var snapshotFormatters = {
for (let feature of featureLog.features) {
let trs = [];
for (let entry of feature.log) {
let contents;
if (!entry.hasOwnProperty("message")) {
// This is a default entry.
contents = entry.status + " by " + entry.type;
} else if (entry.message.length && entry.message[0] == "#") {
let bugNumber;
if (entry.hasOwnProperty("failureId")) {
// This is a failure ID. See nsIGfxInfo.idl.
let m = /#BLOCKLIST_FEATURE_FAILURE_BUG_(\d+)/.exec(entry.message);
let m = /BUG_(\d+)/.exec(entry.failureId);
if (m) {
let bugSpan = $.new("span");
let bugHref = $.new("a");
bugHref.href =
"https://bugzilla.mozilla.org/show_bug.cgi?id=" + m[1];
bugHref.setAttribute("data-l10n-name", "bug-link");
bugSpan.append(bugHref);
document.l10n.setAttributes(bugSpan, "support-blocklisted-bug", {
bugNumber: m[1],
});
contents = [bugSpan];
} else {
let unknownFailure = $.new("span");
document.l10n.setAttributes(unknownFailure, "unknown-failure", {
failureCode: entry.message.substr(1),
});
contents = [unknownFailure];
bugNumber = m[1];
}
} else {
contents =
entry.status + " by " + entry.type + ": " + entry.message;
}
trs.push($.new("tr", [$.new("td", contents)]));
let failureIdSpan = $.new("span", "");
if (bugNumber) {
let bugHref = $.new("a");
bugHref.href =
"https://bugzilla.mozilla.org/show_bug.cgi?id=" + bugNumber;
bugHref.setAttribute("data-l10n-name", "bug-link");
failureIdSpan.append(bugHref);
document.l10n.setAttributes(
failureIdSpan,
"support-blocklisted-bug",
{
bugNumber,
}
);
} else if (
entry.hasOwnProperty("failureId") &&
entry.failureId.length
) {
document.l10n.setAttributes(failureIdSpan, "unknown-failure", {
failureCode: entry.failureId,
});
}
let messageSpan = $.new("span", "");
if (entry.hasOwnProperty("message") && entry.message.length) {
messageSpan.innerText = entry.message;
}
let typeCol = $.new("td", entry.type);
let statusCol = $.new("td", entry.status);
let messageCol = $.new("td", "");
let failureIdCol = $.new("td", "");
typeCol.style.width = "10%";
statusCol.style.width = "10%";
messageCol.style.width = "30%";
messageCol.appendChild(messageSpan);
failureIdCol.style.width = "50%";
failureIdCol.appendChild(failureIdSpan);
trs.push($.new("tr", [typeCol, statusCol, messageCol, failureIdCol]));
}
addRow("decisions", "#" + feature.name, [$.new("table", trs)]);
}

View File

@ -1746,6 +1746,8 @@ bool GfxInfoBase::BuildFeatureStateLog(JSContext* aCx,
if (!SetJSPropertyString(aCx, obj, "type", aType) ||
!SetJSPropertyString(aCx, obj, "status",
FeatureStatusToString(aStatus)) ||
(!aFailureId.IsEmpty() &&
!SetJSPropertyString(aCx, obj, "failureId", aFailureId.get())) ||
(aMessage && !SetJSPropertyString(aCx, obj, "message", aMessage))) {
return;
}