Bug 237581 - prepare-ChangeLog does not include Swift functions which contain local vars
Summary: prepare-ChangeLog does not include Swift functions which contain local vars
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on: 242735
Blocks:
  Show dependency treegraph
 
Reported: 2022-03-07 21:29 PST by mmokary
Modified: 2022-07-18 12:28 PDT (History)
6 users (show)

See Also:


Attachments
Ignore nested function and var matches (4.32 KB, patch)
2022-03-07 22:30 PST, mmokary
ddkilzer: review+
ddkilzer: commit-queue-
Details | Formatted Diff | Diff
Patch for landing sans ChangeLog (4.30 KB, patch)
2022-07-13 18:07 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mmokary 2022-03-07 21:29:08 PST
prepare-ChangeLog does not include Swift functions which contain local vars

Once the parser matches a variable or function it loses reference to any current function it was tracking. So when a function defines a local var, the var is matched and the containing function is lost.

For example:

1 class SomeClass {
2     func aClassMethod() {
3         var local: Local
4     }
5 }

Changes to aClassMethod will never cause (SomeClass.aClassMethod) in the ChangeLog because the range of [3, 3, local] is recorded instead.
Comment 1 Radar WebKit Bug Importer 2022-03-07 21:33:17 PST
<rdar://problem/89948275>
Comment 2 mmokary 2022-03-07 22:30:49 PST
Created attachment 454073 [details]
Ignore nested function and var matches
Comment 3 David Kilzer (:ddkilzer) 2022-07-13 16:07:47 PDT
Comment on attachment 454073 [details]
Ignore nested function and var matches

r=me
Comment 4 David Kilzer (:ddkilzer) 2022-07-13 17:54:12 PDT
OH.  This patch is old enough that it still includes a ChangeLog file, but it's not supposed to include that anymore.
Comment 5 David Kilzer (:ddkilzer) 2022-07-13 18:07:23 PDT
Created attachment 460877 [details]
Patch for landing sans ChangeLog
Comment 6 David Kilzer (:ddkilzer) 2022-07-13 18:16:32 PDT
Comment on attachment 460877 [details]
Patch for landing sans ChangeLog

I seem to have broke the commit queue script with this patch.  :|
Comment 7 David Kilzer (:ddkilzer) 2022-07-13 20:13:41 PDT
Tracking a fix for the commit queue:

Bug 242735 Submitted: Commit queue fails to land patch with changes to prepare-ChangeLog script
Comment 8 David Kilzer (:ddkilzer) 2022-07-16 09:45:45 PDT
Waiting for the commit queue bot(s) to be updated/restarted to pick up the fix from Bug 242735 before this patch can land.
Comment 9 David Kilzer (:ddkilzer) 2022-07-18 11:14:45 PDT
(In reply to David Kilzer (:ddkilzer) from comment #8)
> Waiting for the commit queue bot(s) to be updated/restarted to pick up the
> fix from Bug 242735 before this patch can land.

UGH.  Still getting the same error message as before:

>   File "/var/buildbot/OpenSource/Tools/CISupport/ews-build/steps.py", line 4919, in _files
>     match = re.search(self.RE_CHANGELOG, line)
>   File "/usr/lib64/python3.6/re.py", line 182, in search
>     return _compile(pattern, flags).search(string)
builtins.TypeError: cannot use a string pattern on a bytes-like object

I'm not sure how to fix that.
Comment 10 EWS 2022-07-18 12:28:06 PDT
Committed 252573@main (8e82c35b8f05): <https://commits.webkit.org/252573@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 460877 [details].