Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hyperlinks to build log #2408

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion buildLogAnalyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@ def makeHTMLSummaryPage(self):

def makeHTMLLogFile(self, pkg):
"""docstring for makeHTMLFile"""
linePartsUrl = re.compile(
r"(?P<full_path>(?:.*/"
+ self.release
+ r"/)?(?P<file>src/[^:(]+)[:(](?P<line>\d+)\)?):"
)
iarspider marked this conversation as resolved.
Show resolved Hide resolved

if not pkg.name() in self.tagList:
return
Expand Down Expand Up @@ -410,6 +415,21 @@ def makeHTMLLogFile(self, pkg):
) # do this first to not escape it again in the next subs
newLine = newLine.replace("<", "&lt;").replace(">", "&gt;")
if lineNo in pkg.errLines.keys():
m = linePartsUrl.match(newLine.strip())
if m:
url = (
"https://github.com/cms-sw/cmssw/blob/"
+ self.release
+ m.group("file")
+ "#L"
+ m.group("line")
)

newLine = newLine.replace(
m.group("full_path"),
'<a href="' + url + '">' + m.group("full_path") + "</a>",
1,
)
newLine = (
"<span class="
+ self.styleClass[pkg.errLines[lineNo]]
Expand Down Expand Up @@ -770,7 +790,7 @@ def main(argv=None):
pkgList = os.getenv("CMSSW_BASE", None)
if pkgList:
pkgList += "/src/PackageList.cmssw"
rel = os.getenv("CMSSW_VERSION", None)
rel = os.getenv("CMSSW_VERSION", "master")
igWarning = []
if argv is None:
argv = sys.argv
Expand Down
Loading