Better/more configurable notifications from mach

RESOLVED FIXED in Firefox 42

Status

--
enhancement
RESOLVED FIXED
3 years ago
8 months ago

People

(Reporter: nwgh, Assigned: nwgh)

Tracking

Trunk
mozilla42

Firefox Tracking Flags

(firefox42 fixed)

Details

Attachments

(1 attachment)

Created attachment 8631828 [details] [diff] [review]
better-mach-notifications.patch

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 1

3 years ago
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 :)

Comment 3

3 years ago
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
Last Resolved: 3 years ago
status-firefox42: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla42

Updated

8 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.