Bug 36865 - path to committers.py in commit-queue rejection message is wrong
Summary: path to committers.py in commit-queue rejection message is wrong
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-30 17:27 PDT by Eric Seidel (no email)
Modified: 2010-03-31 03:46 PDT (History)
3 users (show)

See Also:


Attachments
Patch (6.81 KB, patch)
2010-03-31 01:18 PDT, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2010-03-30 17:27:44 PDT
path to committers.py in commit-queue rejection message is wrong

Right now it's hardcoded in CommitterValidator (inside bugzilla.py)

        committer_list = "WebKitTools/Scripts/webkitpy/committers.py"

I havne't yet found the magic for computing the __file__ dynamically.

You can get the __file__ from a module object, but we import just the class and not the module.

You can get the module name (string) from classname.__module__ or
instance.__class__.__module__

But I don't yet know how to get to the actual module object.

If we moved towards a model where we used:
import committers

statements instead of:

from committers import CommitterList

then we could easily just grab "committers.__file__" and be done. :)
Comment 1 Chris Jerdonek 2010-03-30 17:39:24 PDT
(In reply to comment #0)
> If we moved towards a model where we used:
> import committers
> 
> statements instead of:
> 
> from committers import CommitterList
> 
> then we could easily just grab "committers.__file__" and be done. :)

Why wouldn't you want to do "import committers" if you need it?

Also, have you tried

from committers import __file__?

(Not sure if that would work.)
Comment 2 Chris Jerdonek 2010-03-30 17:40:17 PDT
(In reply to comment #1)
> from committers import __file__?
> 
> (Not sure if that would work.)

Or better is probably--

from committers import __file__ as _committers_file
Comment 3 Chris Jerdonek 2010-03-30 23:34:23 PDT
(In reply to comment #2)
> Or better is probably--
> 
> from committers import __file__ as _committers_file

Yes, this works.  But since it can return the .pyc file if it exists, you probably want to normalize the extension to .py.
Comment 4 Eric Seidel (no email) 2010-03-31 01:18:40 PDT
Created attachment 52140 [details]
Patch
Comment 5 Eric Seidel (no email) 2010-03-31 01:19:04 PDT
Comment on attachment 52140 [details]
Patch

I am completely covered in Yak hair.
Comment 6 Adam Barth 2010-03-31 01:40:00 PDT
Comment on attachment 52140 [details]
Patch

This code is really wrong, but ok.

/WebKitTools/svn/WebKitTools/Scripts/webkitpy
Comment 7 WebKit Commit Bot 2010-03-31 03:46:05 PDT
Comment on attachment 52140 [details]
Patch

Clearing flags on attachment: 52140

Committed r56835: <http://trac.webkit.org/changeset/56835>
Comment 8 WebKit Commit Bot 2010-03-31 03:46:11 PDT
All reviewed patches have been landed.  Closing bug.