Merge pull request #49 from kmaglione/validation-email-stuff

Fix bulk validation errors for add-ons without reviewed versions.
This commit is contained in:
Mathieu Agopian 2014-04-22 10:53:23 +02:00
Родитель 416172a875 22643b333a
Коммит c7e8353823
3 изменённых файлов: 56 добавлений и 44 удалений

Просмотреть файл

@ -122,10 +122,6 @@ class NotifyForm(happyforms.Form):
Template(data).render(Context({}))
except TemplateSyntaxError, err:
raise forms.ValidationError(err)
for name in varname.findall(data):
if name not in self.variable_names:
raise forms.ValidationError(
u'Variable {{%s}} is not a valid variable' % name)
return data
def clean_text(self):

Просмотреть файл

@ -286,46 +286,59 @@ def notify_compatibility(users, job, data, **kw):
for user in users:
stats['processed'] += 1
for a in chain(user.passing_addons, user.failing_addons):
results = job.result_set.filter(file__version__addon=a)
try:
for a in chain(user.passing_addons, user.failing_addons):
try:
results = job.result_set.filter(file__version__addon=a)
a.links = ' '.join(absolutify(reverse('devhub.bulk_compat_result',
a.links = [absolutify(reverse('devhub.bulk_compat_result',
args=[a.slug, r.pk]))
for r in results)
for r in results]
a.compat_link = absolutify(reverse('devhub.versions.edit',
args=[a.pk,
a.current_version.pk]))
v = a.current_version or a.latest_version
a.compat_link = absolutify(reverse('devhub.versions.edit',
args=[a.pk, v.pk]))
except:
task_error = sys.exc_info()
log.error(u'Bulk validation email error for user %s, '
u'addon %s: %s: %s'
% (user.email, a.slug,
task_error[0], task_error[1]), exc_info=False)
context = Context({
'APPLICATION': str(job.application),
'VERSION': job.target_version.version,
'PASSING_ADDONS': user.passing_addons,
'FAILING_ADDONS': user.failing_addons,
})
context = Context({
'APPLICATION': str(job.application),
'VERSION': job.target_version.version,
'PASSING_ADDONS': user.passing_addons,
'FAILING_ADDONS': user.failing_addons,
})
log.info(u'Emailing %s%s for %d addons about '
'bulk validation job %s'
% (user.email,
' [PREVIEW]' if dry_run else '',
len(user.passing_addons) + len(user.failing_addons),
job.pk))
args = (Template(data['subject']).render(context),
Template(data['text']).render(context))
kwargs = dict(from_email=settings.DEFAULT_FROM_EMAIL,
recipient_list=[user.email])
if dry_run:
job.preview_notify_mail(*args, **kwargs)
else:
stats['author_emailed'] += 1
send_mail(*args, **kwargs)
amo.log(amo.LOG.BULK_VALIDATION_USER_EMAILED,
user,
details={'passing': [a.id for a in user.passing_addons],
'failing': [a.id for a in user.failing_addons],
'target': job.target_version.version,
'application': app_id})
log.info(u'Emailing %s%s for %d addons about '
'bulk validation job %s'
% (user.email,
' [PREVIEW]' if dry_run else '',
len(user.passing_addons) + len(user.failing_addons),
job.pk))
args = (Template(data['subject']).render(context),
Template(data['text']).render(context))
kwargs = dict(from_email=settings.DEFAULT_FROM_EMAIL,
recipient_list=[user.email])
if dry_run:
job.preview_notify_mail(*args, **kwargs)
else:
stats['author_emailed'] += 1
send_mail(*args, **kwargs)
amo.log(amo.LOG.BULK_VALIDATION_USER_EMAILED,
user,
details={'passing': [a.id for a in user.passing_addons],
'failing': [a.id for a in user.failing_addons],
'target': job.target_version.version,
'application': app_id})
except:
task_error = sys.exc_info()
log.error(u'Bulk validation email error for user %s: %s: %s'
% (user.email,
task_error[0], task_error[1]), exc_info=False)
log.info('[%s@%s] bulk email stats for job %s: {%s}'
% (len(users), notify_compatibility.rate_limit, job.pk,

Просмотреть файл

@ -1,6 +1,6 @@
Dear add-on author,
{% autoescape off %}Dear add-on author,
{% if PASSING_ADDONS and not FAILING_ADDONS %}
Good news! Our automated tests did not detect any compatibility issues with your add-on{{PASSING_ADDONS|length|pluralize}} and {{APPLICATION}} {{VERSION}}. We've updated your add-on{{PASSING_ADDONS|length|pluralize:"'s,s'"}} compatibility to work with {{APPLICATION}} {{VERSION}} so that our Aurora users can begin using your add-on{{PASSING_ADDONS|length|pluralize}}.
Good news! Our automated tests did not detect any compatibility issues with your add-on{{PASSING_ADDONS|length|pluralize}} and {{APPLICATION}} {{VERSION}}. We've updated your add-on{{PASSING_ADDONS|length|pluralize:"'s,s'"}} compatibility to work with {{APPLICATION}} {{VERSION}} so that our beta and release users can begin using your add-on{{PASSING_ADDONS|length|pluralize}}.
We encourage you to view the results of the compatibility test, as some compatibility issues may have been detected but without enough certainty to declare the add-on incompatible:
{% elif FAILING_ADDONS and not PASSING_ADDONS %}
@ -8,12 +8,13 @@ While testing add-ons for compatibility with the upcoming release of {{APPLICATI
{% else %}
While testing add-ons for compatibility with the upcoming release of {{APPLICATION}} {{VERSION}}, we detected some potential compatibility issues with your add-on{{FAILING_ADDONS|length|pluralize}}.
Our automated tests did not detect any compatibility issues with the following add-on{{PASSING_ADDONS|length|pluralize}} and {{APPLICATION}} {{VERSION}}. We've updated your add-on{{PASSING_ADDONS|length|pluralize:"'s,s'"}} compatibility to work with {{APPLICATION}} {{VERSION}} so that our Aurora users can begin using your add-on{{PASSING_ADDONS|length|pluralize}}.
Our automated tests did not detect any compatibility issues with the following add-on{{PASSING_ADDONS|length|pluralize}} and {{APPLICATION}} {{VERSION}}. We've updated your add-on{{PASSING_ADDONS|length|pluralize:"'s,s'"}} compatibility to work with {{APPLICATION}} {{VERSION}} so that our beta and release users can begin using your add-on{{PASSING_ADDONS|length|pluralize}}.
{% endif %}{% comment %}
{% endcomment %}{% if PASSING_ADDONS %}
{% for addon in PASSING_ADDONS %}
• {{addon.name}}: {{addon.links}}{% endfor %}
• {{addon.name}}:{% for link in addon.links %}
▶ {{link}}{% endfor %}{% endfor %}
This compatibility bump is server-side and we did not modify your add-on package in any way.
{% endif %}{% comment %}
@ -21,11 +22,13 @@ This compatibility bump is server-side and we did not modify your add-on package
{% endcomment %}{% if FAILING_ADDONS %}
Because of these potential problems, we were not able to automatically mark the following add-on{{FAILING_ADDONS|length|pluralize}} as compatible with {{APPLICATION}} {{VERSION}}. Please look into these issues and upload a new version if necessary. If you've tested your add-on{{FAILING_ADDONS|length|pluralize}} and no changes are required, you can update your compatibility to {{APPLICATION}} {{VERSION}} on the developer hub page{{FAILING_ADDONS|length|pluralize}} below. No future compatibility tests will be run on {{FAILING_ADDONS|length|pluralize:"this add-on,these add-ons"}} until their compatibility information has been updated to include the latest {{APPLICATION}} release.
{% for addon in FAILING_ADDONS %}
• {{addon.name}}: {{addon.links}} {{addon.compat_link}}{% endfor %}
• {{addon.name}}:{% for link in addon.links %}
▶ {{link}}{% endfor %}
▶ {{addon.compat_link}}{% endfor %}
{% endif %}
Thank you,
Firefox Add-ons team
--
You are receiving this email as a registered add-on author on addons.mozilla.org. If you no longer wish to receive these emails, please disable your add-on from the Developer Hub at https://addons.mozilla.org/developers
You are receiving this email as a registered add-on author on addons.mozilla.org. If you no longer wish to receive these emails, please disable your add-on from the Developer Hub at https://addons.mozilla.org/developers{% endautoescape %}