<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>207026</bug_id>
          
          <creation_ts>2020-01-30 18:59:46 -0800</creation_ts>
          <short_desc>[ews] add build step to set custom build summary</short_desc>
          <delta_ts>2020-01-31 10:06:20 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>207027</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Aakash Jain">aakash_jain</reporter>
          <assigned_to name="Aakash Jain">aakash_jain</assigned_to>
          <cc>aakash_jain</cc>
    
    <cc>ap</cc>
    
    <cc>jbedard</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1613258</commentid>
    <comment_count>0</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2020-01-30 18:59:46 -0800</bug_when>
    <thetext>[ews] add build step to set custom build summary based on a property which any previous step can set. 

Currently in order to set custom build summary we are using self.build.buildFinished(build_summary, result) method, but this method also finishes the build immediately whenever it&apos;s called. So if a step uses buildFinished(), no further build step can be run.

For example: Layout-test set custom build summary (e.g.: &apos;Passed layout tests&apos;, &apos;Found 1 pre-existing test failure: xyz&apos;). In case commit-queue (or any factory) run layout-test step, layout-test will call self.build.buildFinished() and commit-queue (or that factory) would not be able to execute any subsequent build-step.

The fix is to avoid calling buildFinished() inside the regular build-steps, instead set a property in those build-steps, and at the end run a specific build-step (e.g.: SetBuildSummary) which would set the build summary based on that property.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1613259</commentid>
    <comment_count>1</comment_count>
      <attachid>389325</attachid>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2020-01-30 19:01:32 -0800</bug_when>
    <thetext>Created attachment 389325
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1613264</commentid>
    <comment_count>2</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2020-01-30 19:24:30 -0800</bug_when>
    <thetext>Sample runs:
https://ews-build.webkit-uat.org/#/builders/8/builds/102
https://ews-build.webkit-uat.org/#/builders/8/builds/103</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1613412</commentid>
    <comment_count>3</comment_count>
      <attachid>389325</attachid>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2020-01-31 09:27:51 -0800</bug_when>
    <thetext>Comment on attachment 389325
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=389325&amp;action=review

&gt; Tools/BuildSlaveSupport/ews-build/steps.py:2021
&gt; +        self.build.buildFinished([build_summary], self.build.results)

What is self.build.results?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1613419</commentid>
    <comment_count>4</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2020-01-31 09:35:48 -0800</bug_when>
    <thetext>(In reply to Jonathan Bedard from comment #3)
&gt; What is self.build.results?
results is a variable inside Build class https://github.com/buildbot/buildbot/blob/master/master/buildbot/process/build.py#L77

It stores the current result based on the steps which have executed. 

This I am trying SetBuildSummary to set the same overall build status which Buildbot would have set otherwise, based on the status of previously executed steps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1613425</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Bedard">jbedard</who>
    <bug_when>2020-01-31 09:40:21 -0800</bug_when>
    <thetext>(In reply to Aakash Jain from comment #4)
&gt; (In reply to Jonathan Bedard from comment #3)
&gt; &gt; What is self.build.results?
&gt; results is a variable inside Build class
&gt; https://github.com/buildbot/buildbot/blob/master/master/buildbot/process/
&gt; build.py#L77
&gt; 
&gt; It stores the current result based on the steps which have executed. 
&gt; 
&gt; This I am trying SetBuildSummary to set the same overall build status which
&gt; Buildbot would have set otherwise, based on the status of previously
&gt; executed steps.

Can we contrive an example where Python 2 fails, but python 3 does not? I think this is right, but that&apos;s the only case we haven&apos;t tested.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1613428</commentid>
    <comment_count>6</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2020-01-31 09:44:22 -0800</bug_when>
    <thetext>(In reply to Jonathan Bedard from comment #5)
&gt; Can we contrive an example where Python 2 fails, but python 3 does not? I think this is right, but that&apos;s the only case we haven&apos;t tested.
Will provide that in https://bugs.webkit.org/show_bug.cgi?id=207027</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1613455</commentid>
    <comment_count>7</comment_count>
      <attachid>389325</attachid>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2020-01-31 10:05:10 -0800</bug_when>
    <thetext>Comment on attachment 389325
Patch

Clearing flags on attachment: 389325

Committed r255506: &lt;https://trac.webkit.org/changeset/255506&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1613456</commentid>
    <comment_count>8</comment_count>
    <who name="Aakash Jain">aakash_jain</who>
    <bug_when>2020-01-31 10:05:14 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1613457</commentid>
    <comment_count>9</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-01-31 10:06:20 -0800</bug_when>
    <thetext>&lt;rdar://problem/59065405&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>389325</attachid>
            <date>2020-01-30 19:01:32 -0800</date>
            <delta_ts>2020-01-31 10:05:10 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-207026-20200130220131.patch</filename>
            <type>text/plain</type>
            <size>1842</size>
            <attacher name="Aakash Jain">aakash_jain</attacher>
            
              <data encoding="base64">SW5kZXg6IFRvb2xzL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBUb29scy9DaGFuZ2VMb2cJKHJl
dmlzaW9uIDI1NTQ4MikKKysrIFRvb2xzL0NoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwz
ICsxLDE1IEBACisyMDIwLTAxLTMwICBBYWthc2ggSmFpbiAgPGFha2FzaF9qYWluQGFwcGxlLmNv
bT4KKworICAgICAgICBbZXdzXSBhZGQgYnVpbGQgc3RlcCB0byBzZXQgY3VzdG9tIGJ1aWxkIHN1
bW1hcnkKKyAgICAgICAgaHR0cHM6Ly9idWdzLndlYmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTIw
NzAyNgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgICog
QnVpbGRTbGF2ZVN1cHBvcnQvZXdzLWJ1aWxkL3N0ZXBzLnB5OgorICAgICAgICAoU2V0QnVpbGRT
dW1tYXJ5LmRvU3RlcElmKTogUnVuIHRoaXMgc3RlcCBvbmx5IGlmIGJ1aWxkX3N1bW1hcnkgcHJv
cGVydHkgaXMgc2V0LgorICAgICAgICAoU2V0QnVpbGRTdW1tYXJ5LmhpZGVTdGVwSWYpOiBIaWRl
IHRoaXMgc3RlcCBpZiBpdCBpcyBub3QgZXhlY3V0ZWQuCisgICAgICAgIChTZXRCdWlsZFN1bW1h
cnkuc3RhcnQpOgorCiAyMDIwLTAxLTM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