Bug 57250 - check-webkit-style confused by two ChangeLog entries in a row from same user
Summary: check-webkit-style confused by two ChangeLog entries in a row from same user
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-28 11:03 PDT by Jeff Miller
Modified: 2011-03-29 19:01 PDT (History)
6 users (show)

See Also:


Attachments
Patch (15.86 KB, patch)
2011-03-29 01:03 PDT, David Levin
no flags Details | Formatted Diff | Diff
Patch (16.12 KB, patch)
2011-03-29 01:26 PDT, David Levin
no flags Details | Formatted Diff | Diff
Patch (16.18 KB, patch)
2011-03-29 09:10 PDT, David Levin
no flags Details | Formatted Diff | Diff
Patch (16.47 KB, patch)
2011-03-29 11:53 PDT, David Levin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Miller 2011-03-28 11:03:53 PDT
Earlier today, in r82114, I checked in a rubber-stamped change to WebKitLibraries without a bug number in WebKitLibraries/ChangeLog.  Then, I uploaded a patch for <https://bugs.webkit.org/show_bug.cgi?id=57195> at 2011-03-28 10:45 PST which also included a change to WebKitLibraries (with a bug number in the ChangeLog).  However, check-webkit-style failed on WebKitLibraries/ChangeLog for the patch with:

WebKitLibraries/ChangeLog:15:  ChangeLog entry has no bug number  [changelog/bugnumber] [5]

I think it's confused by my earlier rubber-stamped ChangeLog entry.
Comment 1 David Levin 2011-03-28 11:33:09 PDT
Bummer I specifically got this added to the tests that went in with that change.
Comment 2 Jeff Miller 2011-03-28 13:08:48 PDT
I'm also seeing this with my patch for https://bugs.webkit.org/show_bug.cgi?id=57262
Comment 3 Patrick R. Gansterer 2011-03-28 13:16:19 PDT
Hmmm, I don't see the reason for the false positive at the moment. I need to test this on my "WebKit machine". :-(
Unfortunally I don't have time to look at this before tomorrow. I'll take care of this issue.
Comment 4 David Levin 2011-03-28 17:35:32 PDT
I know what is going wrong with one of them:
1. The diff came out "funny" due to the entries in succession. When the checker logs the error for line 15 (for the following entry which has no bug number). the error filter allows the error to go through because this line is in the diff.

2. For bug 57262, the checker was correct that the ChangeLog entry starting at line 13 had no bug number but line 13 was not part of the patch for the error filter should have removed this.

We can fix these by limiting the lines given to the main check function to be just the added lines. (Of course, we'll have to adjust the lines where the errors are reported if this approach is taken.)
Comment 5 David Levin 2011-03-28 18:08:25 PDT
(In reply to comment #4)
> 2. For bug 57262, the checker was correct that the ChangeLog entry starting at line 13 had no bug number but line 13 was not part of the patch for the error filter should have removed this.

Ah. 

For this one it is the same problem as #1. Even though the patch doesn't show line 13 as being part of the patch, the patch is applied locally and when the diff is done locally, then the line 1 is not part of the diff but line 13 is.
Comment 6 David Levin 2011-03-29 01:03:51 PDT
Created attachment 87279 [details]
Patch
Comment 7 Patrick R. Gansterer 2011-03-29 01:20:42 PDT
Comment on attachment 87279 [details]
Patch

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

LGTM

> Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py:-43
> -

Hmmm, my style checker wanted this empty line before def.

> Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py:79
> +                          '        Example bug'
> +                          '\n'

\n into the same line

> Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py:106
>      def test_no_error(self):

Maybe you can add an empty one too
Comment 8 Eric Seidel (no email) 2011-03-29 01:24:19 PDT
Comment on attachment 87279 [details]
Patch

We ahve code for fixing up ChagneLog diffs somewehre.  Seems check-webkit-style would only want to scan the current ChangeLog and ignore the rest of hte diff.  (I haven't really looked at your patch, mabye that's what it does)
Comment 9 David Levin 2011-03-29 01:26:44 PDT
Created attachment 87281 [details]
Patch
Comment 10 David Levin 2011-03-29 01:31:37 PDT
(In reply to comment #8)
> (From update of attachment 87279 [details])
> We ahve code for fixing up ChagneLog diffs somewehre.  Seems check-webkit-style would only want to scan the current ChangeLog and ignore the rest of hte diff.  (I haven't really looked at your patch, mabye that's what it does)

Yes basically it does only look at the current ChangeLog.

(In reply to comment #7)
> (From update of attachment 87279 [details])
> > Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py:-43
> > -
> 
> Hmmm, my style checker wanted this empty line before def.

It still does. It doesn't complain about my patch because the error gets filtered out (due to it being a deleted line) -- tricky case.

Thanks for noticing.

Addressed the other two comments also.
Comment 11 Patrick R. Gansterer 2011-03-29 01:33:28 PDT
Comment on attachment 87281 [details]
Patch

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

> Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py:89
> +                          '2011-01-01  Patrick Gansterer  <paroga@paroga.com>\n'
> +                          '\n        Example bug'
> +                          '\n        http://trac.webkit.org/changeset/12345\n')

The other lines have the \n only at the end

> Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py:111
> +        self.assert_no_error([],
> +                             '2011-01-01  Patrick Gansterer  <paroga@paroga.com>\n'
> +                             '\n'
> +                             '        Example bug\n'
> +                             '        http://bugs.webkit.org/show_bug.cgi?id=12345\n')

Thx, maybe we can add and "invalid" entry with emty range too.
Comment 12 David Levin 2011-03-29 09:10:50 PDT
Created attachment 87342 [details]
Patch
Comment 13 David Levin 2011-03-29 09:12:47 PDT
(In reply to comment #11)
> (From update of attachment 87281 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=87281&action=review
> 
> > Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py:89
> > +                          '2011-01-01  Patrick Gansterer  <paroga@paroga.com (:paroga) (c)>\n'
> > +                          '\n        Example bug'
> > +                          '\n        http://trac.webkit.org/changeset/12345\n')
> 
> The other lines have the \n only at the end

Fixed.

> 
> > Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py:111
> > +        self.assert_no_error([],
> > +                             '2011-01-01  Patrick Gansterer  <paroga@paroga.com (:paroga) (c)>\n'
> > +                             '\n'
> > +                             '        Example bug\n'
> > +                             '        http://bugs.webkit.org/show_bug.cgi?id=12345\n')
> 
> Thx, maybe we can add and "invalid" entry with emty range too.

I don't understand because I think the lines which start with
  self.assert_error(2, range(2, 5), 'changelog/bugnumber'
already do this.
Comment 14 Patrick R. Gansterer 2011-03-29 11:31:45 PDT
(In reply to comment #13)
> I don't understand because I think the lines which start with
>   self.assert_error(2, range(2, 5), 'changelog/bugnumber'
> already do this.

I mean sth like the following:

+        self.assert_no_error([],
+                             '2011-01-01  Patrick Gansterer  <paroga@paroga.com>\n'
+                             '\n'
+                             '        Example ChangeLog entry out of range\n'
+                             '        http://example.com/\n')
Comment 15 David Levin 2011-03-29 11:53:28 PDT
Created attachment 87381 [details]
Patch
Comment 16 David Levin 2011-03-29 11:53:55 PDT
(In reply to comment #14)
> (In reply to comment #13)
> > I don't understand because I think the lines which start with
> >   self.assert_error(2, range(2, 5), 'changelog/bugnumber'
> > already do this.
> 
> I mean sth like the following:

ok. done.
Comment 17 Shinichiro Hamaji 2011-03-29 18:23:24 PDT
Comment on attachment 87381 [details]
Patch

Looks good.
Comment 18 WebKit Commit Bot 2011-03-29 19:01:21 PDT
Comment on attachment 87381 [details]
Patch

Clearing flags on attachment: 87381

Committed r82382: <http://trac.webkit.org/changeset/82382>
Comment 19 WebKit Commit Bot 2011-03-29 19:01:25 PDT
All reviewed patches have been landed.  Closing bug.