<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:dbates@webkit.org" title="Daniel Bates <dbates@webkit.org>"> <span class="fn">Daniel Bates</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - Add code to parse the git branches out of the Trac RSS feed"
href="https://bugs.webkit.org/show_bug.cgi?id=153624">bug 153624</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Attachment #270165 Flags</td>
<td>review?
</td>
<td>review-
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Add code to parse the git branches out of the Trac RSS feed"
href="https://bugs.webkit.org/show_bug.cgi?id=153624#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Add code to parse the git branches out of the Trac RSS feed"
href="https://bugs.webkit.org/show_bug.cgi?id=153624">bug 153624</a>
from <span class="vcard"><a class="email" href="mailto:dbates@webkit.org" title="Daniel Bates <dbates@webkit.org>"> <span class="fn">Daniel Bates</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=270165&action=diff" name="attach_270165" title="Patch">attachment 270165</a> <a href="attachment.cgi?id=270165&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=270165&action=review">https://bugs.webkit.org/attachment.cgi?id=270165&action=review</a>
<span class="quote">> Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:69
> + return (!commit.containsBranchLocation || commit.branchName === branchName || (commit.branchName instanceof Array && commit.branchName.includes(branchName))) && filter(commit);</span >
This does not seem like the correct approach. In particular, its weird that branchName could be either a String object or an Array object.
<span class="quote">> Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:172
> + var gitBranches = doc.evaluate("./branches", commitElement, null, XPathResult.STRING_TYPE).stringValue;
> + if (gitBranches) {
> + result.containsBranchLocation = true;
> + result.branchName = gitBranches.split(", ");
> + }</span >
We need a test case for a multi-branch commit.
<span class="quote">> Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js:60
> + strictEqual(commits.length, 6, "should have 6 commits");</span >
It's weird that there are six commits because on first glance this test only parses a single commit. I know that five of these commits are hardcoded in class MockTrac. Can we extract the hardcoded recorded commits from MockTrac into some kind of constant, maybe MockTrac.EXAMPLE_TRAC_COMMITS, such that MockTrac has no recorded commits by default? Unit tests that want to make use of this set of mock commits could then set MockTrac.recordedCommits = MockTrac.EXAMPLE_TRAC_COMMITS. And we would not make use of this set of commits for this test.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>