diff --git a/scripts/releng/CompilerSummaryGenerator.java b/scripts/releng/CompilerSummaryGenerator.java index 12a00f5682b..9828a4f86fe 100644 --- a/scripts/releng/CompilerSummaryGenerator.java +++ b/scripts/releng/CompilerSummaryGenerator.java @@ -51,32 +51,31 @@ void parseCompileLog(Path file, Map compilerLog) throws IOException, SAXException, ParserConfigurationException { Document aDocument = XmlProcessorFactoryRelEng.parseDocumentIgnoringDOCTYPE(file); int warnings = 0; - int accessWarnings = 0; int infos = 0; + int tasks = 0; // Get summary of problems NodeList problemList = aDocument.getElementsByTagName("problem"); for (Element problem : elements(problemList)) { String severity = problem.getAttribute("severity"); switch (severity) { - case "WARNING" -> { - // this is a warning need to check the id - String value = problem.getAttribute("id"); - switch (value) { - case "ForbiddenReference", "DiscouragedReference" -> accessWarnings++; - default -> warnings++; - } - } + case "WARNING" -> warnings++; case "INFO" -> infos++; // this is an info warning } } - if (warnings == 0 && accessWarnings == 0 && infos == 0) { + NodeList tasksList = aDocument.getElementsByTagName("tasks"); + for (Element element : elements(tasksList)) { + String count = element.getAttribute("tasks"); + tasks += Integer.parseInt(count); + } + + if (warnings == 0 && infos == 0 && tasks == 0) { return; } String path = compileLogsDirectory.relativize(file).toString().replace(File.separatorChar, '/'); JSON.Object issues = JSON.Object.create(); addIfNonZero(issues, "warnings", warnings); - addIfNonZero(issues, "access", accessWarnings); addIfNonZero(issues, "infos", infos); + addIfNonZero(issues, "tasks", tasks); if (compilerLog.putIfAbsent(path, issues) != null) { throw new IllegalStateException("Plugin already set: " + path + "\n" + compilerLog.get(path)); } diff --git a/sites/eclipse/build/reports.html b/sites/eclipse/build/reports.html index 4aff75d9a8b..90f10540a47 100644 --- a/sites/eclipse/build/reports.html +++ b/sites/eclipse/build/reports.html @@ -54,18 +54,18 @@

Unit Test Results

-

Plugins containing compile warnings or infos

+

Compile issues

- The table below shows the plugins in which warnings were encountered. + The table below shows the plugins in which warnings, infos or open tasks were encountered. Click on the jar file's row to view its detailed report.

- - - + + + @@ -139,16 +139,16 @@

Plugins containing compile warnings or infos

row.classList.add('collapsible-table-main-row') insertLeanCell(row, false).innerHTML = shortName addLinkCell(row, `${shortName}--warnings`, issues.warnings) - addLinkCell(row, `${shortName}--access_warnings`, issues.access) addLinkCell(row, `${shortName}--infos`, issues.infos) + addLinkCell(row, `${shortName}--tasks`, issues.tasks) // Details row (collapsed by default) const detailsRow = compilerIssues.insertRow() detailsRow.classList.add('collapsible-table-details-row') const content = '' - + (issues.warnings > 0 ? getDetailsContent(logFile, shortName, 'warnings') : '') - + (issues.access > 0 ? getDetailsContent(logFile, shortName, 'access_warnings') : '') - + (issues.infos > 0 ? getDetailsContent(logFile, shortName, 'infos') : '') + + (issues.warnings > 0 ? getDetailsContent(logFile, shortName, 'warning') : '') + + (issues.infos > 0 ? getDetailsContent(logFile, shortName, 'info') : '') + + (issues.tasks > 0 ? getDetailsContent(logFile, shortName, 'task') : '') detailsRow.innerHTML = ` ` @@ -160,7 +160,7 @@

Plugins containing compile warnings or infos

} function getDetailsContent(logFile, shortName, issueType) { - return appendCopyLinkButton(`

${issueType.toUpperCase().replace('_', ' ')} in org.eclipse.${shortName}

`) + ` + return appendCopyLinkButton(`

${issueType.toUpperCase()}S in org.eclipse.${shortName}

`) + `
` } @@ -174,43 +174,42 @@

Plugins containing compile warnings or infos

function generateCompileLog(compileLogXML, logFile, issueType) { let content = '' - for (const fileProblems of compileLogXML.getElementsByTagName('problems')) { - const source = fileProblems.parentNode + const elementType = issueType == 'task' ? 'task' : 'problem' + const expectedSeverity = issueType.toUpperCase() + for (const fileIssues of compileLogXML.getElementsByTagName(`${elementType}s`)) { + const source = fileIssues.parentNode const sourceFileName = computeRelativeFilePath(source, logFile) - const warnings = parseInt(fileProblems.getAttribute('warnings')) - const infos = parseInt(fileProblems.getAttribute('infos')) - let counter = 0 - let elements = '' - let severity; - for (problem of fileProblems.getElementsByTagName('problem')) { - severity = problem.getAttribute('severity') - const problemID = problem.getAttribute('id') - const line = parseInt(problem.getAttribute('line')) - const message = escapeHTML(problem.querySelector('message').getAttribute('value')) - const contextValue = problem.querySelector('source_context').getAttribute('value') - const sourceStart = parseInt(problem.querySelector('source_context').getAttribute('sourceStart')) - const sourceEnd = parseInt(problem.querySelector('source_context').getAttribute('sourceEnd')) + 1 - const sourceCodeBefore = escapeHTML(contextValue.substring(0, sourceStart)) - const sourceCode = escapeHTML(contextValue.substring(sourceStart, sourceEnd)) - const sourceCodeAfter = escapeHTML(contextValue.substring(sourceEnd, contextValue.length)) - if (isMatchingIssue(issueType, severity, problemID)) { - elements += ` - - - - ` - } - } - if (counter > 0) { + const itemCount = parseInt(fileIssues.getAttribute(`${issueType}s`)) + if (itemCount > 0) { content += ` -
${sourceFileName}: ${counter} ${severity.toLowerCase()}${counter > 1 ? 's' : ''}
+
${sourceFileName}: ${itemCount} ${issueType}${itemCount > 1 ? 's' : ''}
Compile Logs (Jar Files)General WarningsAccess WarningsInfosWarningsInfosTasks
${content}
- ${++counter}. ${message} - ${createCodeEditorBlock(line, `${sourceCodeBefore}${applyCodeMarker(severity.toLowerCase(), sourceCode)}${sourceCodeAfter}`)} -
- ${elements} -
` + let counter = 0 + for (issue of fileIssues.getElementsByTagName(elementType)) { + if (elementType != 'problem' || expectedSeverity == issue.getAttribute('severity')) { + const message = escapeHTML(issue.querySelector('message').getAttribute('value')) + content += ` + + + ${++counter}. ${message} + ` + const sourceContext = issue.querySelector('source_context') + if (sourceContext) { + const contextValue = sourceContext.getAttribute('value') + const sourceStart = parseInt(sourceContext.getAttribute('sourceStart')) + const sourceEnd = parseInt(sourceContext.getAttribute('sourceEnd')) + 1 + + const sourceCodeBefore = escapeHTML(contextValue.substring(0, sourceStart)) + const sourceCode = escapeHTML(contextValue.substring(sourceStart, sourceEnd)) + const sourceCodeAfter = escapeHTML(contextValue.substring(sourceEnd, contextValue.length)) + const line = parseInt(issue.getAttribute('line')) + content += `${createCodeEditorBlock(line, `${sourceCodeBefore}${applyCodeMarker(issueType, sourceCode)}${sourceCodeAfter}`)}` + } + content += ' ' + } + } + content += '' } } return content @@ -242,17 +241,6 @@
${sourceFileName}: ${counter} ${severity.toLowerCase()} return filePath.substring(pluginNameIndex + pluginName.length + 1, filePath.length) } - const apiWarningIDs = new Set(['ForbiddenReference', 'DiscouragedReference']) - - function isMatchingIssue(expectedType, severity, problemId) { - switch (expectedType) { - case "warnings": return severity == 'WARNING' && !apiWarningIDs.has(problemId) - case "access_warnings": return severity == 'WARNING' && apiWarningIDs.has(problemId) - case "infos": return severity == 'INFO' - default: throw new Error(`Unexpected type: ${expectedType}`) - } - } - function insertLeanCell(row, center) { const cell = row.insertCell() cell.style = `padding-bottom:1px; padding-top:1px; ${center ? 'text-align:center' : ''}` diff --git a/sites/eclipse/page.css b/sites/eclipse/page.css index a51484d2f7f..9a250694e0f 100644 --- a/sites/eclipse/page.css +++ b/sites/eclipse/page.css @@ -5,6 +5,7 @@ --marker-error: red; --marker-warning: orange; --marker-info: dodgerblue; + --marker-task: dodgerblue; } .breadcrumbs-default-margin {