Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 42ad15583c7ebcb230a0ad4c400e274727dfd1a4
      
https://github.com/WebKit/WebKit/commit/42ad15583c7ebcb230a0ad4c400e274727dfd1a4
  Author: Ryan Haddad <[email protected]>
  Date:   2026-09-10 (Thu, 10 Sep 2026)

  Changed paths:
    M Tools/WebKitBot/src/CommandParser.mjs
    M Tools/WebKitBot/src/WebKitBot.mjs
    M Tools/WebKitBot/tests/WebKitBot.test.mjs

  Log Message:
  -----------
  [WebKitBot] revert mis-parses a commit identifier followed by sentence 
punctuation
https://bugs.webkit.org/show_bug.cgi?id=322685
rdar://186002314

Reviewed by Aakash Jain.

The regex used to extract the revision matched any non-colon / non-whitespace 
character after
the `@`, so a sentence-ending period got swallowed into the branch name. When 
that was passed
in verbatim to `git-webkit revert`, it wasn't able to resolve this non-existent 
`main.` branch
and errored out.

Strip trailing sentence punctuation from each candidate before matching, 
anchored to the end
of the token so branch names that legitimately contain periods (e.g. 
"[email protected]")
are untouched. A git ref can't end in "." per `git check-ref-format`, so this 
is always safe.
Also strip a leading "(" or "[" left unbalanced by that strip, so an identifier 
wrapped in
parentheses or brackets (e.g. "(319904@main)" or "(319904@main).") still parses.

Also add a friendly error message for the "Could not find" case revert.py now 
produces (bug 322744),
including the detail it appends (e.g. "Latest identifier on this branch is N") 
-- previously
this fell through to the generic handler, which dumps raw stderr into a Slack 
code block.

* Tools/WebKitBot/src/CommandParser.mjs:
(extractRevision): Strip trailing `.;!?)]` and unbalanced leading `(`/`[` from 
each candidate
before matching.
* Tools/WebKitBot/src/WebKitBot.mjs:
(WebKitBot.prototype.revertCommand): Add a `Could not find "X"` stderr matcher 
that posts
a short message instead of falling through to the raw stderr dump.
* Tools/WebKitBot/tests/WebKitBot.test.mjs: Added coverage for the reported 
regression,
an unpunctuated identifier, a branch name containing periods, a bare SVN 
revision with
a trailing period, and an identifier wrapped in parentheses (with and without 
trailing
punctuation).

Canonical link: https://commits.webkit.org/320834@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to