<?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>172958</bug_id>
          
          <creation_ts>2017-06-05 22:00:08 -0700</creation_ts>
          <short_desc>check-webkit-style: validate &apos;specification&apos; values in features.json</short_desc>
          <delta_ts>2017-06-06 10:23:04 -0700</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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=172942</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>ddkilzer</cc>
    
    <cc>jond</cc>
    
    <cc>lforschler</cc>
    
    <cc>saam</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1315898</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2017-06-05 22:00:08 -0700</bug_when>
    <thetext>We should validate features.json changes so that we don&apos;t break webkit.org/status on Keynote Day in the future.

Breaking change:
http://trac.webkit.org/r217805 

Fix:
https://trac.webkit.org/r217819

See the more exhaustive checks that JSONCSSPropertiesChecker() does in jsonchecker.py.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1315899</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2017-06-05 22:00:59 -0700</bug_when>
    <thetext>All assumptions that the JS makes on the web page about the data structure should be validated by check-webkit-style.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1316032</commentid>
    <comment_count>2</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2017-06-06 09:42:20 -0700</bug_when>
    <thetext>The assumption that was missed in Bug 172942 was that there is a top-level &apos;specification&apos; object for each &apos;specification&apos; value in every &apos;feature&apos;.

I think we should start with that instead of trying list them all exhaustively.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1316050</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2017-06-06 10:01:35 -0700</bug_when>
    <thetext>(In reply to David Kilzer (:ddkilzer) from comment #2)
&gt; The assumption that was missed in Bug 172942 was that there is a top-level
&gt; &apos;specification&apos; object for each &apos;specification&apos; value in every &apos;feature&apos;.

So jsonchecker.py has a check for this exact thing.  I wonder why it didn&apos;t run?

&lt;https://trac.webkit.org/browser/webkit/trunk/Tools/Scripts/webkitpy/style/checkers/jsonchecker.py#L107&gt;

    if &apos;specification&apos; in feature:
        if feature[&apos;specification&apos;] not in specification_name_set:
            self._handle_style_error(0, &apos;json/syntax&apos;, 5, &apos;The feature &quot;%s&quot; has a specification field but no specification of that name exists.&apos; % feature_name)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1316057</commentid>
    <comment_count>4</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2017-06-06 10:23:04 -0700</bug_when>
    <thetext>(In reply to David Kilzer (:ddkilzer) from comment #3)
&gt; So jsonchecker.py has a check for this exact thing.  I wonder why it didn&apos;t
&gt; run?

Runs locally when I specify the file:

$ ./Tools/Scripts/check-webkit-style Source/JavaScriptCore/features.json 
ERROR: Source/JavaScriptCore/features.json:0:  The features should be sorted alphabetically by name, &quot;Block Scoping&quot; appears after &quot;async/await&quot;.  [json/syntax] [5]
ERROR: Source/JavaScriptCore/features.json:0:  The feature &quot;Object rest/spread&quot; has a specification field but no specification of that name exists.  [json/syntax] [5]
Total errors found: 2 in 1 files

And if I back up to the revision before and then reapply the patch locally:

$ git checkout b678b94bdcb57fd1d1ef831097147147910c6b60^
Note: checking out &apos;b678b94bdcb57fd1d1ef831097147147910c6b60^&apos;.
[...]

$ git diff b678b94bdcb57fd1d1ef831097147147910c6b60^..b678b94bdcb57fd1d1ef831097147147910c6b60 | patch -p1
patching file Source/JavaScriptCore/ChangeLog
patching file Source/JavaScriptCore/features.json

$ ./Tools/Scripts/check-webkit-style 
ERROR: Source/JavaScriptCore/features.json:0:  The features should be sorted alphabetically by name, &quot;Block Scoping&quot; appears after &quot;async/await&quot;.  [json/syntax] [5]
ERROR: Source/JavaScriptCore/features.json:0:  The feature &quot;Object rest/spread&quot; has a specification field but no specification of that name exists.  [json/syntax] [5]
Total errors found: 2 in 2 files

So it seems like check-webkit-patch wasn&apos;t run because the patch was landed directly instead of going through the usual process of being posted to Bug 172942 and having check-webkit-style process it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>