Closed Bug 802932 Opened 12 years ago Closed 11 years ago

Refactor some pieces of try_parser.py

Categories

(Release Engineering :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: sfink, Assigned: sfink)

Details

Attachments

(2 files)

It is totally a judgement call whether the original or the new version is better, but I find the logic in the new version to be easier to follow. I don't think this changes any behavior, though it does strip out some redundant computations (which was really just a nesting level problem.)
Attachment #672653 - Flags: review?(bhearsum)
Another refactoring. I prefer to do the parsing up-front in one place.
Attachment #672654 - Flags: review?(bhearsum)
Comment on attachment 672654 [details] [diff] [review]
Handle the 'none' value at the outer scope

Review of attachment 672654 [details] [diff] [review]:
-----------------------------------------------------------------

This patch looks good to me, feel free to land it on default anytime.
Attachment #672654 - Flags: review?(bhearsum) → review+
Comment on attachment 672653 [details] [diff] [review]
Refactor some pieces of try_parser.py

Review of attachment 672653 [details] [diff] [review]:
-----------------------------------------------------------------

I think this all looks okay, modulo the one thing noted below. You can fix that upon landing without asking for another review if you want.

::: try_parser.py
@@ +53,5 @@
> +    if user_platforms == 'none':
> +        return []
> +
> +    # For tests, prettyNames contains list values (a list of slave builder
> +    # names?), and this should always return the empty list

Can you update this to explain why it should always be an empty list for tests?
Attachment #672653 - Flags: review?(bhearsum) → review+
(In reply to Ben Hearsum [:bhearsum] from comment #4)
> @@ +53,5 @@
> > +    if user_platforms == 'none':
> > +        return []
> > +
> > +    # For tests, prettyNames contains list values (a list of slave builder
> > +    # names?), and this should always return the empty list
> 
> Can you update this to explain why it should always be an empty list for
> tests?

Ok, I rewrote the comment. (Really, the control flow should be straightened out to avoid this case entirely, but for now this should do.)

New comment:

    # When prettyNames contains list values rather than simple strings, it
    # means that we're processing the argument for selecting test suites, so do
    # not return any build builders.
(In reply to Steve Fink [:sfink] from comment #5)
> (In reply to Ben Hearsum [:bhearsum] from comment #4)
> > @@ +53,5 @@
> > > +    if user_platforms == 'none':
> > > +        return []
> > > +
> > > +    # For tests, prettyNames contains list values (a list of slave builder
> > > +    # names?), and this should always return the empty list
> > 
> > Can you update this to explain why it should always be an empty list for
> > tests?
> 
> Ok, I rewrote the comment. (Really, the control flow should be straightened
> out to avoid this case entirely, but for now this should do.)
> 
> New comment:
> 
>     # When prettyNames contains list values rather than simple strings, it
>     # means that we're processing the argument for selecting test suites, so
> do
>     # not return any build builders.

lgtm
Attachment #672653 - Flags: checked-in+
Attachment #672654 - Flags: checked-in+
In production
In production
Steve - is there still one more patch you wanted to do here?
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Product: mozilla.org → Release Engineering
Component: General Automation → General
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: