From 3cfd73550f48104150d9750ef4e2d68d6cf45dfc Mon Sep 17 00:00:00 2001 From: William Durand Date: Wed, 14 Oct 2020 14:52:00 +0200 Subject: [PATCH] Remove prefix for Fenix versions (#15716) --- .../migrations/0009_auto_20201013_1417.py | 18 ++++++++++++++++++ src/olympia/stats/templates/stats/stats.html | 1 - src/olympia/stats/tests/test_views.py | 17 ----------------- src/olympia/stats/views.py | 5 ----- static/js/impala/stats/manager.js | 12 +----------- 5 files changed, 19 insertions(+), 34 deletions(-) create mode 100644 src/olympia/stats/migrations/0009_auto_20201013_1417.py diff --git a/src/olympia/stats/migrations/0009_auto_20201013_1417.py b/src/olympia/stats/migrations/0009_auto_20201013_1417.py new file mode 100644 index 0000000000..2515fccf6b --- /dev/null +++ b/src/olympia/stats/migrations/0009_auto_20201013_1417.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.13 on 2020-07-27 08:43 + +from django.db import migrations + + +def delete_waffle_switch(apps, schema_editor): + Switch = apps.get_model("waffle", "Switch") + + Switch.objects.filter(name="use-fenix-build-ids").delete() + + +class Migration(migrations.Migration): + + dependencies = [ + ("stats", "0008_auto_20201007_0839"), + ] + + operations = [migrations.RunPython(delete_waffle_switch)] diff --git a/src/olympia/stats/templates/stats/stats.html b/src/olympia/stats/templates/stats/stats.html index 2e0262ebc6..79c99eff28 100644 --- a/src/olympia/stats/templates/stats/stats.html +++ b/src/olympia/stats/templates/stats/stats.html @@ -116,7 +116,6 @@ data-start_date="{{ view.start }}" data-end_date="{{ view.end }}" {% endif %} - data-use-fenix-build-ids="{{ use_fenix_build_ids }}" data-base_url="{{ stats_base_url }}">
diff --git a/src/olympia/stats/tests/test_views.py b/src/olympia/stats/tests/test_views.py index 26f175ed48..601bb1a404 100644 --- a/src/olympia/stats/tests/test_views.py +++ b/src/olympia/stats/tests/test_views.py @@ -8,7 +8,6 @@ from unittest import mock from django.http import Http404 from django.test.client import RequestFactory from django.utils.encoding import force_text -from waffle.testutils import override_switch from olympia import amo from olympia.access.models import Group, GroupUser @@ -1130,22 +1129,6 @@ class TestStatsWithBigQuery(TestCase): assert b'Download campaigns by Date' in response.content assert b'About tracking external sources' in response.content - @override_switch('use-fenix-build-ids', active=True) - def test_fenix_build_ids(self): - url = reverse('stats.apps', args=[self.addon.slug]) - - response = self.client.get(url) - - assert b'data-use-fenix-build-ids="True"' in response.content - - @override_switch('use-fenix-build-ids', active=False) - def test_no_fenix_build_ids(self): - url = reverse('stats.apps', args=[self.addon.slug]) - - response = self.client.get(url) - - assert b'data-use-fenix-build-ids="False"' in response.content - class TestProcessLocales(TestCase): def test_performs_lowercase_lookup(self): diff --git a/src/olympia/stats/views.py b/src/olympia/stats/views.py index 2980c8012d..443040a888 100644 --- a/src/olympia/stats/views.py +++ b/src/olympia/stats/views.py @@ -5,8 +5,6 @@ import itertools from datetime import timedelta -import waffle - from dateutil.parser import parse from django import http from django.core.exceptions import PermissionDenied @@ -365,9 +363,6 @@ def stats_report(request, addon, report): 'report': report, 'stats_base_url': stats_base_url, 'view': view, - 'use_fenix_build_ids': ( - waffle.switch_is_active('use-fenix-build-ids') - ), } ) diff --git a/static/js/impala/stats/manager.js b/static/js/impala/stats/manager.js index 9045c48692..996954cdea 100644 --- a/static/js/impala/stats/manager.js +++ b/static/js/impala/stats/manager.js @@ -10,8 +10,6 @@ z.StatsManager = (function () { var $primary = $('.primary'); - var useFenixBuildIDs = $primary.data('use-fenix-build-ids') === 'True'; - var storage = z.Storage('stats'), storageCache = z.SessionStorage('statscache'), dataStore = {}, @@ -532,17 +530,9 @@ z.StatsManager = (function () { key = parts[0]; parts = parts.slice(1); - // Fenix app versions are build IDs so we need a prefix for end users. - var versionPrefix = - metric === 'apps' && - key === '{aa3c5121-dab2-40e2-81ca-7ea25febc110}' && - useFenixBuildIDs - ? 'Build #' - : ''; - if (metric in csv_keys) { if (key in csv_keys[metric]) { - return csv_keys[metric][key] + ' ' + versionPrefix + parts.join(' '); + return csv_keys[metric][key] + ' ' + parts.join(' '); } } return field;