RESOLVED FIXED Bug 221861
[results.webkit.org] Distinguish hash and revision
https://bugs.webkit.org/show_bug.cgi?id=221861
Summary [results.webkit.org] Distinguish hash and revision
Jonathan Bedard
Reported 2021-02-12 16:52:08 PST
Right now, both hash and revision are treated as an id. We should distinguish the two in the json the results database returns.
Attachments
Patch (2.95 KB, patch)
2021-02-12 16:54 PST, Jonathan Bedard
no flags
Patch (2.76 KB, patch)
2021-02-15 10:00 PST, Jonathan Bedard
no flags
Patch (3.06 KB, patch)
2021-02-15 10:45 PST, Jonathan Bedard
no flags
Radar WebKit Bug Importer
Comment 1 2021-02-12 16:52:40 PST
Jonathan Bedard
Comment 2 2021-02-12 16:54:08 PST
Aakash Jain
Comment 3 2021-02-15 09:18:04 PST
Comment on attachment 420196 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420196&action=review > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/commit.py:-48 > - def __init__(self, repository_id, branch, id, timestamp=None, order=None, committer=None, message=None): can we keep it one line for readability. > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/commit.py:55 > + ): We should probably have a check at the beginning of this method which limits passing only one of (id, revision, identifier). I believe passing multiple ones isn't expected. > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/commit.py:76 > + self.revision = self.revision if self.revision else self.id Better to keep it explicit multi-line if else. When written that way, I don't see a reason to do: self.revision = self.revision > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/commit.py:78 > + self.hash = self.hash if self.hash else self.id Ditto. > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/commit.py:84 > + raise ValueError(f"'{self.revision}' is an revision") This error message doesn't look like an error, more like an information. Can be improved to look like an error and actually indicate what's the error here.
Jonathan Bedard
Comment 4 2021-02-15 09:49:57 PST
Comment on attachment 420196 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420196&action=review >> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/commit.py:55 >> + ): > > We should probably have a check at the beginning of this method which limits passing only one of (id, revision, identifier). I believe passing multiple ones isn't expected. We will be passing multiple ones, as an example, https://commits.webkit.org/234094@main would be: id=234094@main hash= ee0111014bf107a0958f023114778b75eddc8a4d revision=272858
Jonathan Bedard
Comment 5 2021-02-15 10:00:08 PST
Aakash Jain
Comment 6 2021-02-15 10:08:09 PST
Comment on attachment 420324 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=420324&action=review > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/commit.py:70 > + if re.match(r'[0-9]+$', self.id): Might be good to make this re a variable, like RE_SVN_REVISION > Tools/Scripts/libraries/resultsdbpy/resultsdbpy/controller/commit.py:73 > + elif re.match(r'[a-fA-F0-9]+$', self.id): Might be good to make this re a variable, like RE_GIT_HASH
Jonathan Bedard
Comment 7 2021-02-15 10:45:46 PST
EWS
Comment 8 2021-02-15 11:58:40 PST
Committed r272872: <https://commits.webkit.org/r272872> All reviewed patches have been landed. Closing bug and clearing flags on attachment 420333 [details].
Note You need to log in before you can comment on or make changes to this bug.