Bug 174876 - prepare-ChangeLog should not list added layout tests in PAL ChangeLog
Summary: prepare-ChangeLog should not list added layout tests in PAL ChangeLog
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-07-26 14:51 PDT by Daniel Bates
Modified: 2017-07-28 16:43 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.02 KB, patch)
2017-07-26 15:03 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch (1.94 KB, patch)
2017-07-26 21:53 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews126 for ios-simulator-wk2 (982.66 KB, application/zip)
2017-07-26 23:23 PDT, Build Bot
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2017-07-26 14:51:27 PDT
When a change contains a WebCore change, one or more added layout tests, and a PAL change then prepare-ChangeLog will list the added layout tests in both the WebCore and PAL ChangeLog files. Although platform functionality in PAL may be directly exercised in a layout test I do not get the impression that a layout test can always be used to exercise PAL functionality or at least exercise all edge cases easily. Unit tests seem more appropriate for abstractions in PAL. Therefore, prepare-ChangeLog should not list added layout tests in the PAL ChangeLog.
Comment 1 Daniel Bates 2017-07-26 15:03:45 PDT
Created attachment 316488 [details]
Patch
Comment 2 Darin Adler 2017-07-26 15:36:57 PDT
Comment on attachment 316488 [details]
Patch

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

> Tools/Scripts/prepare-ChangeLog:691
> +        if (unixPath($prefix) =~ m|WebCore(?!/PAL)| || unixPath(`pwd`) =~ m|WebCore(?!/PAL)| || @$requiresTests) {

I don’t think this fix need to be so specific to PAL.
Comment 3 Daniel Bates 2017-07-26 17:10:38 PDT
(In reply to Darin Adler from comment #2)
> Comment on attachment 316488 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=316488&action=review
> 
> > Tools/Scripts/prepare-ChangeLog:691
> > +        if (unixPath($prefix) =~ m|WebCore(?!/PAL)| || unixPath(`pwd`) =~ m|WebCore(?!/PAL)| || @$requiresTests) {
> 
> I don’t think this fix need to be so specific to PAL.

I am unclear how to avoid making this fix specific to PAL for the second disjunct without breaking the prepare-ChangeLog feature implemented by the second disjunct when the current working directory is some non-PAL subdirectory of Source/WebCore. If we do not need to support this feature then I can remove the second disjunct and write the first disjunct as "unixPath($prefix) =~ m|WebCore/$|" (without double quotes). The purpose of the second disjunct is to always (*) emit "No new tests (OOPS!)." in the WebCore ChangeLog entry whenever a person runs prepare-ChangeLog inside Source/WebCore or a subdirectory of it. I suspect the rationality (**) behind this behavior is to support the workflow of some people that want to generate a ChangeLog and/or patch from a subdirectory of their checkout either because they have unrelated changes in another part of their checkout or as a performance optimization to avoid stat'ing their entire checkout. For people with this workflow prepare-ChangeLog wants to hint to them that they either must by hand remove the "No new tests (OOPS!)." line and list the added tests or provide a reason for the omission of tests OR run prepare-ChangeLog from the top-level WebKit checkout directory so that prepare-ChangeLog can find any added tests. Do we need to support this feature? If so, do we consider the feature meaningful if its limited to when the current working directory is Source/WebCore and not a subdirectory of it? Do you have any insight/suggestions on how to fix up the second disjunct without being specific to PAL or enumerating all other (or most) subdirectories of Source/WebCore?

(*) We will always emit this line because @addedRegressionTests will always be empty since we only add an item to this list if prepare-ChangeLog saw an added file to LayoutTests. And prepare-ChangeLog only sees files that are in the current working directory or subdirectories of it.

(**) This code has existed since prepare-ChangeLog was added by Maciej Stachowiak in <https://trac.webkit.org/changeset/9406>. Maybe he still recalls the reason he added this code. CC'ed Maciej.
Comment 4 Daniel Bates 2017-07-26 17:12:43 PDT
(In reply to Daniel Bates from comment #3)
> For people with this workflow prepare-ChangeLog wants to hint to them ...

This should read:

For people with this workflow and run prepare-ChangeLog from Source/WebCore or a subdirectory of it prepare-ChangeLog wants to hint to them ...
Comment 5 Darin Adler 2017-07-26 20:42:34 PDT
Comment on attachment 316488 [details]
Patch

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

>>> Tools/Scripts/prepare-ChangeLog:691
>>> +        if (unixPath($prefix) =~ m|WebCore(?!/PAL)| || unixPath(`pwd`) =~ m|WebCore(?!/PAL)| || @$requiresTests) {
>> 
>> I don’t think this fix need to be so specific to PAL.
> 
> I am unclear how to avoid making this fix specific to PAL for the second disjunct without breaking the prepare-ChangeLog feature implemented by the second disjunct when the current working directory is some non-PAL subdirectory of Source/WebCore. If we do not need to support this feature then I can remove the second disjunct and write the first disjunct as "unixPath($prefix) =~ m|WebCore/$|" (without double quotes). The purpose of the second disjunct is to always (*) emit "No new tests (OOPS!)." in the WebCore ChangeLog entry whenever a person runs prepare-ChangeLog inside Source/WebCore or a subdirectory of it. I suspect the rationality (**) behind this behavior is to support the workflow of some people that want to generate a ChangeLog and/or patch from a subdirectory of their checkout either because they have unrelated changes in another part of their checkout or as a performance optimization to avoid stat'ing their entire checkout. For people with this workflow prepare-ChangeLog wants to hint to them that they either must by hand remove the "No new tests (OOPS!)." line and list the added tests or provide a reason for the omission of tests OR run prepare-ChangeLog from the top-level WebKit checkout directory so that prepare-ChangeLog can find any added tests. Do we need to support this feature? If so, do we consider the feature meaningful if its limited to when the current working directory is Source/WebCore and not a subdirectory of it? Do you have any insight/suggestions on how to fix up the second disjunct without being specific to PAL or enumerating all other (or most) subdirectories of Source/WebCore?
> 
> (*) We will always emit this line because @addedRegressionTests will always be empty since we only add an item to this list if prepare-ChangeLog saw an added file to LayoutTests. And prepare-ChangeLog only sees files that are in the current working directory or subdirectories of it.
> 
> (**) This code has existed since prepare-ChangeLog was added by Maciej Stachowiak in <https://trac.webkit.org/changeset/9406>. Maybe he still recalls the reason he added this code. CC'ed Maciej.

Yes, I want you to do what you mentioned in the first sentence.

    if (unixPath($prefix) =~ m|/WebCore/$| || @$requiresTests) {

The same bug affects WebCore/platform/gtk/po/ChangeLog and your fix would not help in that case, but mine would.

Can you give an example of what you think this breaks about subdirectories? Just give me a specific example. No need for rationale or philosophy. In what case is the behavior different? Steps to reproduce. I tried and could not reproduce any difference in behavior.
Comment 6 Daniel Bates 2017-07-26 21:43:54 PDT
(In reply to Darin Adler from comment #5)
> Can you give an example of what you think this breaks about subdirectories?
> Just give me a specific example. No need for rationale or philosophy. In
> what case is the behavior different? Steps to reproduce. I tried and could
> not reproduce any difference in behavior.

Never mind. I misread the code in findChangeLogs() and for some reason I thought $prefix was the full path to a modified file.
Comment 7 Daniel Bates 2017-07-26 21:53:10 PDT
Created attachment 316520 [details]
Patch
Comment 8 Build Bot 2017-07-26 23:23:51 PDT Comment hidden (obsolete)
Comment 9 Build Bot 2017-07-26 23:23:52 PDT Comment hidden (obsolete)
Comment 10 Daniel Bates 2017-07-27 17:19:08 PDT
(In reply to Build Bot from comment #8)
> Comment on attachment 316520 [details]
> Patch
> 
> Attachment 316520 [details] did not pass ios-sim-ews (ios-simulator-wk2):
> Output: http://webkit-queues.webkit.org/results/4194715
> 
> New failing tests:
> fast/selectors/nth-last-child-of-selector-list-ending-with-never-matching-
> selectors.html

Clearly this failure is unrelated to this patch as this patch does not touch the engine.
Comment 11 Daniel Bates 2017-07-28 15:31:41 PDT
Comment on attachment 316520 [details]
Patch

Clearing flags on attachment: 316520

Committed r220032: <http://trac.webkit.org/changeset/220032>
Comment 12 Daniel Bates 2017-07-28 15:31:42 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Radar WebKit Bug Importer 2017-07-28 16:43:55 PDT
<rdar://problem/33601796>