Closed Bug 673930 Opened 13 years ago Closed 13 years ago

[shipping] create view to do outreach around beta/aurora

Categories

(Webtools Graveyard :: Elmo, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Pike, Assigned: Pike)

References

Details

Attachments

(1 file)

I think I found a set of queries and data items that can be useful generically to do outreach around beta/aurora: Poke everyone that has an old sign-off on aurora, and on beta, exclude those sign-offs that were made on aurora in the last cycle. The current patch comes with a json-export that ties in to the latest landing in the outreach couchapp, http://hg.mozilla.org/users/axel_mozilla.com/outreach/rev/2f048ba24482. The combo is designed to do outreach across all apps on the rapid release train, which should reduce the noise quite considerably.
Attached patch add outreach views (deleted) — Splinter Review
Add the new views. I don't have a clever idea on how to test this, as it's going to be one hell of a ride on fixtures before the test becomes remotely sensible.
Attachment #548191 - Flags: review?(peterbe)
Comment on attachment 548191 [details] [diff] [review] add outreach views Review of attachment 548191 [details] [diff] [review]: ----------------------------------------------------------------- ::: apps/shipping/static/shipping/js/outreach.js @@ +64,5 @@ > + }); > + return {appvers: avs, locales: locales, data:rv}; > +} > + > +$('#export').click(function() { Why isn't this wrapped in a `$(function()` wrapper? Even if we load the jquery file and this after the DOM it's not a guarantee the DOM is ready to be manipulated. ::: apps/shipping/templates/shipping/out-data.html @@ +48,5 @@ > +<script src="{{ STATIC_URL }}shipping/js/outreach.js"></script> > +{% endblock %} > + > +{% block content %} > +Outreach for {{apps|join:", "}} for sign-offs prior to {{branchdate}}: Can we put this in a block tag? Like a H4 or something? It's better to not have floating text without containers. ::: apps/shipping/templates/shipping/out-select-apps.html @@ +40,5 @@ > + > +{% block title_matter %}Outreach{% endblock %} > + > +{% block content %} > +Select the applications for which you want to do outreach: Can you put this in a H4 tag? @@ +49,5 @@ > +{% endfor %} > +Beta branch date (Y-M-D): <input type="text" value="{{betadate}}" name="betadate"><br> > +Aurora branch date (Y-M-D): <input type="text" value="{{auroradate}}" name="auroradate"><br> > +</p> > +<input type="submit"> Doesn't this need a `value="Submit"`? ::: apps/shipping/views/outreach.py @@ +37,5 @@ > + > +"""Views to help with outreach around the rapid release cycle. > +""" > + > +from datetime import datetime, timedelta Please use the module level import. I.e.: import datetime ... datetime.datetime.utcnow() It's in the Mozilla style guide actually and it's better practice in general. @@ +61,5 @@ > + .filter(appversion__tree__l10n=beta_forest) > + .order_by('code')) > + epoch = datetime(2011, 7, 5) # magic date for the rapid release calendar > + n = datetime.utcnow() > + sixweeks = int(math.floor((n - epoch).days / 7.0 / 6.0)) Why not just: sixweeks = (n - epoch).days / (6 * 7) It gives the same number as far as I can see. In fact, (whilst writing this) I checked: >>> def axel(n): ... return int(math.floor(n / 7.0 /6.0)) ... >>> def peter(n): ... return n/ (6*7) ... >>> for i in range(10000): ... assert axel(i) == peter(i) ... @@ +62,5 @@ > + .order_by('code')) > + epoch = datetime(2011, 7, 5) # magic date for the rapid release calendar > + n = datetime.utcnow() > + sixweeks = int(math.floor((n - epoch).days / 7.0 / 6.0)) > + auroradate = epoch + sixweeks * timedelta(6 * 7) When using timedelta, it's better to be explicit with the keyword arguments: timedelta(days=6 * 7) @@ +66,5 @@ > + auroradate = epoch + sixweeks * timedelta(6 * 7) > + betadate = auroradate - timedelta(6 * 7) > + return render_to_response('shipping/out-select-apps.html', > + {'apps': beta_apps, > + 'auroradate': auroradate.strftime('%Y-%m-%d'), Unless that makes it really impractical for you, the date should be formatted in the presentation layer (ie. the template). E.g. {{ auroradate|date:"Y-m-d" }} @@ +121,5 @@ > + so.appversion_id in beta_av and > + so.push.push_date >= betadate and > + so.push.push_date < auroradate), > + old_signoffs) > + print len(old_signoffs) Debugging left intentionally? @@ +125,5 @@ > + print len(old_signoffs) > + runqueries = (Q(locale=so.locale_id, tree=tree4av[so.appversion_id]) > + for so in old_signoffs) > + actives = (Run.objects > + .filter(reduce(lambda l, r: l | r, runqueries)) Smart! @@ +129,5 @@ > + .filter(reduce(lambda l, r: l | r, runqueries)) > + .exclude(active__isnull=True)) > + missings = dict(((r.tree_id, r.locale_id), r.allmissing) > + for r in actives) > + print missings Debugging? @@ +134,5 @@ > + matrix = dict() > + for signoff in old_signoffs: > + if signoff.locale_id not in matrix: > + matrix[signoff.locale_id] = [None] * len(appvers) > + for av_i in xrange(len(appvers)): Consider using an `enumerate` loop instead. I.e.: nth = None for i, av in enumerate(appvers): if signoff.appversion_id == av.id: nth = i break
Attachment #548191 - Flags: review?(peterbe) → review+
Priority: -- → P2
https://github.com/mozilla/elmo/commit/9208268e6353112734dbff23a3a624b5fed61c4f, FIXED. I'll file a follow-up bug to create tests for this, too.
Target Milestone: --- → 1.3
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Blocks: 677505
Blocks: 677507
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: