Skip to content

Commit

Permalink
Bug 1333023 - Add ESR correlations (mozilla-services#3659)
Browse files Browse the repository at this point in the history
* Fail gracefully when correlation data for a channel is missing

* Bug 1333023 - Support showing ESR correlations
  • Loading branch information
marco-c authored and willkg committed Jan 24, 2017
1 parent 21582a4 commit 38d00d5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,12 @@ window.correlations = (function () {
'date': totals['date'],
};

['release', 'beta', 'aurora', 'nightly'].forEach(function (ch) {
var channels = ['release', 'beta', 'aurora', 'nightly'];
if (product === 'Firefox') {
channels.push('esr');
}

channels.forEach(function (ch) {
correlationData[product][ch] = {
'total': totals[ch],
'signatures': {},
Expand All @@ -58,7 +63,7 @@ window.correlations = (function () {
function loadCorrelationData(signature, channel, product) {
return loadChannelsData(product)
.then(function (channelsData) {
if (!channelsData || signature in channelsData[channel]['signatures']) {
if (!channelsData || !channelsData[channel] || signature in channelsData[channel]['signatures']) {
return;
}

Expand Down Expand Up @@ -184,6 +189,10 @@ window.correlations = (function () {
return 'No correlation data was generated for the "' + product + '" product.';
}

if (!data[product][channel]) {
return 'No correlation data was generated for the "' + channel + '" channel and the "' + product + '" product.';
}

var signatureData = data[product][channel]['signatures'][signature];

if (!signatureData || !signatureData.results) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ SignatureReport.CorrelationsTab.prototype.loadControls = function() {
// Create a select box for the channel.
this.channelSelect = $('<select>', {'class': 'channels-list', id: 'correlations-channels-list'});
channels.forEach(function (channel) {
if (channel === 'esr') {
// This correlations module doesn't support ESR releases.
return;
}
self.channelSelect.append($('<option>', {
'value': channel,
'text': channel,
Expand Down
2 changes: 2 additions & 0 deletions webapp-django/crashstats/signature/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ def signature_correlations(request, params):
context['channel'] = 'aurora'
elif all('a1' in version for version in params['version']):
context['channel'] = 'nightly'
elif all('esr' in version for version in params['version']):
context['channel'] = 'esr'

context['product'] = 'Firefox'
if (
Expand Down

0 comments on commit 38d00d5

Please sign in to comment.