RESOLVED FIXED Bug 92913
Add Perf EWS IRC bot
https://bugs.webkit.org/show_bug.cgi?id=92913
Summary Add Perf EWS IRC bot
Ryosuke Niwa
Reported 2012-08-01 15:12:35 PDT
Per Adam's suggestion, I'm going to add an experimental perf EWS IRC bot before integrating it into Bugzilla.
Attachments
work in progress (660 bytes, patch)
2012-08-01 17:43 PDT, Ryosuke Niwa
no flags
Added the forgotten perfalizer.py (6.80 KB, patch)
2012-08-01 17:44 PDT, Ryosuke Niwa
no flags
work in progress 3 (11.70 KB, patch)
2012-08-06 20:21 PDT, Ryosuke Niwa
no flags
work in progress 4 (12.11 KB, patch)
2012-08-07 18:26 PDT, Ryosuke Niwa
no flags
work in progress 5 (14.24 KB, patch)
2012-08-07 18:47 PDT, Ryosuke Niwa
no flags
Adds the initial implementation of perfalizer (13.22 KB, patch)
2012-08-07 19:25 PDT, Ryosuke Niwa
no flags
Added some tests per Dirk's comment (30.65 KB, patch)
2012-08-08 16:53 PDT, Ryosuke Niwa
dpranke: review+
Ryosuke Niwa
Comment 1 2012-08-01 17:43:34 PDT
Created attachment 155934 [details] work in progress
Ryosuke Niwa
Comment 2 2012-08-01 17:44:38 PDT
Created attachment 155935 [details] Added the forgotten perfalizer.py
Ryosuke Niwa
Comment 3 2012-08-06 20:21:13 PDT
Created attachment 156847 [details] work in progress 3
Ryosuke Niwa
Comment 4 2012-08-07 18:26:08 PDT
Created attachment 157075 [details] work in progress 4
Ryosuke Niwa
Comment 5 2012-08-07 18:47:58 PDT
Created attachment 157081 [details] work in progress 5
Ryosuke Niwa
Comment 6 2012-08-07 19:25:20 PDT
Created attachment 157087 [details] Adds the initial implementation of perfalizer
Ryosuke Niwa
Comment 7 2012-08-07 19:25:55 PDT
Unfortunately, there isn't much we can test here because it uses a lot of methods that themselves cannot be tested.
Dirk Pranke
Comment 8 2012-08-07 21:56:13 PDT
Comment on attachment 157087 [details] Adds the initial implementation of perfalizer View in context: https://bugs.webkit.org/attachment.cgi?id=157087&action=review Disclaimer: I don't really know the IRCbot code at all, so some of these questions might be a bit off-base. Also, I'd want to give a bit more thought to if/how we can test this. I understand the comment about this being untestable, but python's static checking is pretty weak. We might want to consider at least putting in something that runs lint-webkitpy over this to catch more errors. > Tools/Scripts/webkitpy/common/system/filesystem.py:80 > + You should probably add a routine to filesystem_mock as well ... > Tools/Scripts/webkitpy/tool/commands/perfalizer.py:49 > + def _copy_build_product_without_patch(self, postfix): 'postfix' isn't a great name here; at the least it should probably be "suffix", but even better would be something like "directory_suffix" or "build_dir_suffix" > Tools/Scripts/webkitpy/tool/commands/perfalizer.py:52 > + self._build_path = filesystem.dirname(self._port._build_path()) It's a bit confusing that self._build_path != self._port._build_path() ; maybe pick a different name for the former? This is especially true since you end up adding the configuration dirs back on down below. > Tools/Scripts/webkitpy/tool/commands/perfalizer.py:58 > + filesystem.join(self._build_path_without_patch, configuration)) I wonder if something like rsync -a --delete would be much of a win here over rm + cp. I suppose it depends on how often you'll be building ... > Tools/Scripts/webkitpy/tool/commands/perfalizer.py:64 > + if not self._patch.committer() and not self._patch.attacher().can_commit: Should we have a comment here about why we need a committer here? > Tools/Scripts/webkitpy/tool/commands/perfalizer.py:135 > + self.run_webkit_patch(command) are this and the functions below used anywhere and/or needed? They seem unrelated and possibly just copy&paste from a different command?
Ryosuke Niwa
Comment 9 2012-08-07 22:04:52 PDT
Comment on attachment 157087 [details] Adds the initial implementation of perfalizer View in context: https://bugs.webkit.org/attachment.cgi?id=157087&action=review >> Tools/Scripts/webkitpy/common/system/filesystem.py:80 >> + > > You should probably add a routine to filesystem_mock as well ... Possibly but filesystem_mock doesn't seem to have methods not used in tests so we can probably wait 'til we need one in tests. >> Tools/Scripts/webkitpy/tool/commands/perfalizer.py:52 >> + self._build_path = filesystem.dirname(self._port._build_path()) > > It's a bit confusing that self._build_path != self._port._build_path() ; maybe pick a different name for the former? This is especially true since you end up adding the configuration dirs back on down below. Oh oops, yeah, I should have named it self._build_directory. >> Tools/Scripts/webkitpy/tool/commands/perfalizer.py:58 >> + filesystem.join(self._build_path_without_patch, configuration)) > > I wonder if something like rsync -a --delete would be much of a win here over rm + cp. I suppose it depends on how often you'll be building ... Maybe but copytree is so much slower that the time spent in rmtree doesn't really matter. >> Tools/Scripts/webkitpy/tool/commands/perfalizer.py:64 >> + if not self._patch.committer() and not self._patch.attacher().can_commit: > > Should we have a comment here about why we need a committer here? What kind of comment are we going to add? >> Tools/Scripts/webkitpy/tool/commands/perfalizer.py:135 >> + self.run_webkit_patch(command) > > are this and the functions below used anywhere and/or needed? They seem unrelated and possibly just copy&paste from a different command? Yes. Otherwise PatchAnalysisTask is going to blow up.
Dirk Pranke
Comment 10 2012-08-07 22:39:05 PDT
(In reply to comment #9) > (From update of attachment 157087 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=157087&action=review > > >> Tools/Scripts/webkitpy/common/system/filesystem.py:80 > >> + > > > > You should probably add a routine to filesystem_mock as well ... > > Possibly but filesystem_mock doesn't seem to have methods not used in tests so we can probably wait 'til we need one in tests. > Sure. > >> Tools/Scripts/webkitpy/tool/commands/perfalizer.py:64 > >> + if not self._patch.committer() and not self._patch.attacher().can_commit: > > > > Should we have a comment here about why we need a committer here? > > What kind of comment are we going to add? > Why do you need to be a committer (or does the patch need to be uploaded by a committer)? It's not obvious ...
Ryosuke Niwa
Comment 11 2012-08-07 22:46:57 PDT
Comment on attachment 157087 [details] Adds the initial implementation of perfalizer View in context: https://bugs.webkit.org/attachment.cgi?id=157087&action=review >>>> Tools/Scripts/webkitpy/tool/commands/perfalizer.py:64 >>>> + if not self._patch.committer() and not self._patch.attacher().can_commit: >>> >>> Should we have a comment here about why we need a committer here? >> >> What kind of comment are we going to add? > > Why do you need to be a committer (or does the patch need to be uploaded by a committer)? It's not obvious ... Oh, that's merely because I don't trust those patches to be ran on my Mac mini at the moment. I'm not sure if adding a comment like "rniwa doesn't trust patches submitted by non-committers" is any more helpful than the code itself given that nobody else is going to run this thing (surely, we can't have two IRC bots named perfalizer).
Dirk Pranke
Comment 12 2012-08-08 14:45:29 PDT
(In reply to comment #11) > (From update of attachment 157087 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=157087&action=review > > >>>> Tools/Scripts/webkitpy/tool/commands/perfalizer.py:64 > >>>> + if not self._patch.committer() and not self._patch.attacher().can_commit: > >>> > >>> Should we have a comment here about why we need a committer here? > >> > >> What kind of comment are we going to add? > > > > Why do you need to be a committer (or does the patch need to be uploaded by a committer)? It's not obvious ... > > Oh, that's merely because I don't trust those patches to be ran on my Mac mini at the moment. > I'm not sure if adding a comment like "rniwa doesn't trust patches submitted by non-committers" is any more helpful than the code itself given that nobody else is going to run this thing > (surely, we can't have two IRC bots named perfalizer). I see, I thought this was some sort of security thing (I think we have this check on the other EWS bots, for example). At any rate, as far as testing goes, can you put in some tests that at least stub out the executive enough to make sure the code executes *at all* (i.e., getting covered, even if we're not testing correctness)?
Ryosuke Niwa
Comment 13 2012-08-08 16:53:32 PDT
Created attachment 157334 [details] Added some tests per Dirk's comment
Dirk Pranke
Comment 14 2012-08-08 16:55:22 PDT
Comment on attachment 157334 [details] Added some tests per Dirk's comment thanks! coverage makes me happier ...
Ryosuke Niwa
Comment 15 2012-08-08 17:19:29 PDT
Note You need to log in before you can comment on or make changes to this bug.