Closed Bug 1182301 Opened 9 years ago Closed 9 years ago

Better/more configurable notifications from mach

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox42 fixed)

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: u408661, Assigned: u408661)

Details

Attachments

(1 file)

I have often found myself wishing that (1) I could make mach notify me earlier than the default 5 minutes, and (2) mach's notification would tell me if the build failed (rather than just "completed"). So, I whipped up a patch to make it do those things.
Attachment #8631828 - Flags: review?(gps)
Comment on attachment 8631828 [details] [diff] [review]
better-mach-notifications.patch

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

::: python/mozbuild/mozbuild/mach_commands.py
@@ +424,5 @@
>  
> +        notify_minimum_time = 300
> +        try:
> +            notify_minimum_time = int(os.getenv('MACH_NOTIFY_MINTIME'))
> +        except (TypeError, ValueError):

Why TypeError?

Also, os.environ is preferred over os.getenv(). e.g. os.environ.get('MACH_NOTIFY_MINTIME', '300')
Attachment #8631828 - Flags: review?(gps) → review+
(In reply to Gregory Szorc [:gps] from comment #1)
> Comment on attachment 8631828 [details] [diff] [review]
> better-mach-notifications.patch
> 
> Review of attachment 8631828 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: python/mozbuild/mozbuild/mach_commands.py
> @@ +424,5 @@
> >  
> > +        notify_minimum_time = 300
> > +        try:
> > +            notify_minimum_time = int(os.getenv('MACH_NOTIFY_MINTIME'))
> > +        except (TypeError, ValueError):
> 
> Why TypeError?

Without a default (as in the patch), os.getenv returns None, which causes int() to raise a TypeError instead of a ValueError.

> Also, os.environ is preferred over os.getenv(). e.g.
> os.environ.get('MACH_NOTIFY_MINTIME', '300')

This makes the TypeError check useless, though :)
notify_minimum_time = 300
try:
    notify_minimum_time = int(os.environ.get('MACH_NOTIFY_MINTIME', '300'))
except ValueError:
    pass
https://hg.mozilla.org/mozilla-central/rev/d10aa8e7b3d7
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: