<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <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#c5">Comment # 5</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:jmarcell&#64;apple.com" title="Jason Marcell &lt;jmarcell&#64;apple.com&gt;"> <span class="fn">Jason Marcell</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=153624#c2">comment #2</a>)
<span class="quote">&gt; Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=270165&amp;action=diff" name="attach_270165" title="Patch">attachment 270165</a> <a href="attachment.cgi?id=270165&amp;action=edit" title="Patch">[details]</a></span>
&gt; Patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=270165&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=270165&amp;action=review</a>
&gt; 
&gt; &gt; Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:69
&gt; &gt; +            return (!commit.containsBranchLocation || commit.branchName === branchName || (commit.branchName instanceof Array &amp;&amp; commit.branchName.includes(branchName))) &amp;&amp; filter(commit);
&gt; 
&gt; This does not seem like the correct approach. In particular, its weird that
&gt; branchName could be either a String object or an Array object.</span >

I addressed this in the latest patch. I refactored 'branchName' to be 'branches', changed the type of the variable to be an array, and updated the code that interacts with it accordingly.

<span class="quote">&gt; 
&gt; &gt; Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:172
&gt; &gt; +        var gitBranches = doc.evaluate(&quot;./branches&quot;, commitElement, null, XPathResult.STRING_TYPE).stringValue;
&gt; &gt; +        if (gitBranches) {
&gt; &gt; +            result.containsBranchLocation = true;
&gt; &gt; +            result.branchName = gitBranches.split(&quot;, &quot;);
&gt; &gt; +        }
&gt; 
&gt; We need a test case for a multi-branch commit.</span >

I added a test case and corresponding assertions for a multi-branch commit.

<span class="quote">&gt; 
&gt; &gt; Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/tests.js:60
&gt; &gt; +    strictEqual(commits.length, 6, &quot;should have 6 commits&quot;);
&gt; 
&gt; It's weird that there are six commits because on first glance this test only
&gt; parses a single commit. I know that five of these commits are hardcoded in
&gt; class MockTrac. Can we extract the hardcoded recorded commits from MockTrac
&gt; into some kind of constant, maybe MockTrac.EXAMPLE_TRAC_COMMITS, such that
&gt; MockTrac has no recorded commits by default? Unit tests that want to make
&gt; use of this set of mock commits could then set MockTrac.recordedCommits =
&gt; MockTrac.EXAMPLE_TRAC_COMMITS. And we would not make use of this set of
&gt; commits for this test.</span >

I did this in the latest patch as well.</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>