Remove all traces of jetpack-specific code

Jetpack is the old Add-on SDK, we used to treat those in a special way, but
today everything should be WebExtension so that code can go.
This commit is contained in:
Mathieu Pillard 2019-03-20 15:10:07 +01:00
Родитель d09f948966
Коммит e9cb26f6ba
16 изменённых файлов: 2 добавлений и 195 удалений

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

@ -420,7 +420,6 @@
"platform": 1,
"version": 1,
"reviewed": null,
"jetpack_version": null,
"requires_chrome": false,
"datestatuschanged": "2014-12-08T06:39:45",
"is_restart_required": true,
@ -442,7 +441,6 @@
"platform": 1,
"version": 2,
"reviewed": null,
"jetpack_version": null,
"requires_chrome": false,
"datestatuschanged": "2014-12-08T06:40:07",
"is_restart_required": true,
@ -464,7 +462,6 @@
"platform": 1,
"version": 3,
"reviewed": null,
"jetpack_version": null,
"requires_chrome": false,
"datestatuschanged": "2014-12-08T06:40:16",
"is_restart_required": true,
@ -486,7 +483,6 @@
"platform": 1,
"version": 4,
"reviewed": null,
"jetpack_version": null,
"requires_chrome": false,
"datestatuschanged": "2014-12-08T06:40:23",
"is_restart_required": true,
@ -508,7 +504,6 @@
"platform": 1,
"version": 5,
"reviewed": null,
"jetpack_version": null,
"requires_chrome": false,
"datestatuschanged": "2014-12-08T06:40:24",
"is_restart_required": true,
@ -530,7 +525,6 @@
"platform": 1,
"version": 6,
"reviewed": null,
"jetpack_version": null,
"requires_chrome": false,
"datestatuschanged": "2014-12-08T06:40:25",
"is_restart_required": true,

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

@ -274,7 +274,6 @@
"platform": 1,
"version": 1268881,
"reviewed": null,
"jetpack_version": null,
"requires_chrome": false,
"datestatuschanged": "2011-12-05 14:46:43",
"is_restart_required": true,
@ -296,7 +295,6 @@
"platform": 1,
"version": 1268882,
"reviewed": null,
"jetpack_version": null,
"requires_chrome": false,
"datestatuschanged": "2011-12-05 14:46:43",
"is_restart_required": true,
@ -318,7 +316,6 @@
"platform": 1,
"version": 1268883,
"reviewed": null,
"jetpack_version": null,
"requires_chrome": false,
"datestatuschanged": "2011-12-05 14:46:43",
"is_restart_required": true,
@ -340,7 +337,6 @@
"platform": 1,
"version": 1268884,
"reviewed": null,
"jetpack_version": null,
"requires_chrome": false,
"datestatuschanged": "2011-12-05 14:46:43",
"is_restart_required": true,

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

@ -35,7 +35,7 @@ class FileAdmin(admin.ModelAdmin):
}),
('Details', {
'fields': (
'jetpack_version', 'cert_serial_num', 'original_status'),
'cert_serial_num', 'original_status'),
}),
('Flags', {
'fields': (

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

@ -58,7 +58,6 @@ class File(OnChangeMixin, ModelBase):
# The original hash of the file, before we sign it, or repackage it in
# any other way.
original_hash = models.CharField(max_length=255, default='')
jetpack_version = models.CharField(max_length=10, null=True, blank=True)
status = models.PositiveSmallIntegerField(
choices=STATUS_CHOICES.items(), default=amo.STATUS_AWAITING_REVIEW)
datestatuschanged = models.DateTimeField(null=True, auto_now_add=True)
@ -500,12 +499,6 @@ def track_status_change(old_attr=None, new_attr=None, **kwargs):
def track_file_status_change(file_):
statsd.incr('file_status_change.all.status_{}'.format(file_.status))
if (file_.jetpack_version and
not file_.is_restart_required and
not file_.requires_chrome):
statsd.incr('file_status_change.jetpack_sdk_only.status_{}'
.format(file_.status))
@python_2_unicode_compatible
class FileUpload(ModelBase):

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

@ -1,10 +0,0 @@
Your add-on, {{ addon.name }} {{ addon.current_version.version }}, has been repackaged with a new version of the SDK. Repacks happen automatically for security and stability updates to the SDK. Your add-on should continue working without any further changes.
You can manage your new version ({{ new_version.version }}) here: {{ url('devhub.versions.edit', addon.slug, new_version.id)|absolutify }}
To learn more about SDK {{ sdk_version }}, please see http://blog.mozilla.com/addons/category/jetpack/
Thank you,
Firefox Add-ons Team
--
You are receiving this email as the registered author of {{ addon.name }} on addons.mozilla.org. To opt out of automatic repackaging when new version of the SDK are released, change your settings here: {{ url('devhub.addons.edit', addon.slug)|absolutify }}#edit-addon-technical

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

@ -72,10 +72,6 @@
<input type="checkbox" id="toggle-known"/>
<label for="toggle-known">{{ _('Hide known files') }}</label>
</div>
<div id="jetpack-version" class="js-hidden">
<label>{{ _('Add-on SDK Version:') }}</label>
<span></span>
</div>
<div id="tab-stops-container">
<label class="control" for="tab-stops">{{ _('Tab stops:') }}</label>
<input id="tab-stops" type="number" size="1" />

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

@ -31,7 +31,7 @@ class TestWebextExtractPermissions(UploadTest):
def setUp(self):
super(TestWebextExtractPermissions, self).setUp()
self.platform = amo.PLATFORM_ALL.id
self.addon = Addon.objects.create(guid='guid@jetpack',
self.addon = Addon.objects.create(guid='guid@webext',
type=amo.ADDON_EXTENSION,
name='xxx')
self.version = Version.objects.create(addon=self.addon)

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

@ -43,7 +43,6 @@ VIEW_QUEUE_FLAGS = (
_('Needs Admin Content Review')),
('needs_admin_theme_review', 'needs-admin-theme-review',
_('Needs Admin Static Theme Review')),
('is_jetpack', 'jetpack', _('Jetpack Add-on')),
('is_restart_required', 'is_restart_required', _('Requires Restart')),
('pending_info_request', 'info', _('More Information Requested')),
('expired_info_request', 'expired-info', _('Expired Information Request')),
@ -112,7 +111,6 @@ class ViewQueue(RawSQLModel):
needs_admin_content_review = models.NullBooleanField()
needs_admin_theme_review = models.NullBooleanField()
is_restart_required = models.BooleanField()
is_jetpack = models.BooleanField()
source = models.CharField(max_length=100)
is_webextension = models.BooleanField()
latest_version = models.CharField(max_length=255)
@ -142,7 +140,6 @@ class ViewQueue(RawSQLModel):
('expired_info_request', (
'TIMEDIFF(addons_addonreviewerflags.pending_info_request,'
'NOW()) < 0')),
('is_jetpack', 'MAX(files.jetpack_version IS NOT NULL)'),
('is_restart_required', 'MAX(files.is_restart_required)'),
('source', 'versions.source'),
('is_webextension', 'MAX(files.is_webextension)'),

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

@ -136,13 +136,6 @@ class TestPendingQueue(TestQueue):
queue = self.Queue.objects.get()
assert queue.flags == [('info', 'More Information Requested')]
def test_flags_jetpack(self):
self.new_addon().find_latest_version(self.channel).all_files[0].update(
jetpack_version='1.8')
queue = self.Queue.objects.get()
assert queue.flags == [('jetpack', 'Jetpack Add-on')]
def test_flags_is_restart_required(self):
self.new_addon().find_latest_version(self.channel).all_files[0].update(
is_restart_required=True)

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

@ -1227,21 +1227,6 @@ class TestQueueBasics(QueueTest):
assert response.status_code == 200
assert pq(response.content)('th.ordered a').text() == text
def test_flags_jetpack(self):
addon = addon_factory(
status=amo.STATUS_NOMINATED, name='Jetpack',
version_kw={'version': '0.1'},
file_kw={'status': amo.STATUS_AWAITING_REVIEW,
'jetpack_version': 1.2})
r = self.client.get(reverse('reviewers.queue_nominated'))
rows = pq(r.content)('#addon-queue tr.addon-row')
assert rows.length == 1
assert rows.attr('data-addon') == str(addon.id)
assert rows.find('td').eq(1).text() == 'Jetpack 0.1'
assert rows.find('.ed-sprite-jetpack').length == 1
def test_flags_is_restart_required(self):
addon = addon_factory(
status=amo.STATUS_NOMINATED, name='Some Add-on',
@ -1255,7 +1240,6 @@ class TestQueueBasics(QueueTest):
assert rows.length == 1
assert rows.attr('data-addon') == str(addon.id)
assert rows.find('td').eq(1).text() == 'Some Add-on 0.1'
assert rows.find('.ed-sprite-jetpack').length == 0
assert rows.find('.ed-sprite-is_restart_required').length == 1
def test_flags_is_restart_required_false(self):
@ -1271,7 +1255,6 @@ class TestQueueBasics(QueueTest):
assert rows.length == 1
assert rows.attr('data-addon') == str(addon.id)
assert rows.find('td').eq(1).text() == 'Restartless 0.1'
assert rows.find('.ed-sprite-jetpack').length == 0
assert rows.find('.ed-sprite-is_restart_required').length == 0
def test_tabnav_permissions(self):

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

@ -502,10 +502,6 @@ class Version(OnChangeMixin, ModelBase):
return not bool([f for f in self.all_files if f.status not in
amo.UNREVIEWED_FILE_STATUSES])
@property
def is_jetpack(self):
return all(f.jetpack_version for f in self.all_files)
@property
def sources_provided(self):
return bool(self.source)

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

@ -83,90 +83,6 @@
line-height: 1.3em;
}
#jetpack-overlay {
background-color: rgba(0, 0, 0, 0.6);
height: 100%;
left: 0;
position: fixed;
top: 0;
width: 100%;
z-index: 1000;
text-align: center;
video {
.border-box();
max-height: 100%;
padding: 1em;
width: 100%;
}
}
#jetpack {
ul {
color: #777;
font-size: 14px;
list-style: disc;
padding-bottom: 1em;
list-style-position: inside;
li {
padding-bottom: 5px;
}
}
h2.section {
font-family: Georgia;
font-size: 25px;
font-style: italic;
margin-bottom: 0.5em;
}
p {
.p-light;
margin-bottom: 1em;
}
.island p {
font-size: 14px;
}
h2 a {
font-weight: bold;
}
.cols-light {
div {
padding: 0 2em;
margin: 2em 0;
border-left: 2px dotted #C6E1FF;
&:first-child {
border-left: 0 none;
}
h3 {
color: #555;
font-weight: bold;
font-size: 1.3em;
margin-bottom: 0.5em;
}
p {
font-size: 1em;
}
}
}
.jetpack-builder, .jetpack-sdk {
padding: 1em 0 1em 100px;
position: relative;
img {
position: absolute;
top: 10px;
left: 5px;
}
}
.jetpack_footer {
color: #555;
margin-top: 1em;
text-align: center;
}
}
.html-rtl #devhub-promo {
overflow: hidden;

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

@ -123,7 +123,6 @@
.collapsed-files .command,
.collapsed-files #toggle-known-container,
.collapsed-files #jetpack-version,
.collapsed-files #tab-stops-container {
display: none !important;
}
@ -632,11 +631,6 @@ a.selected > span {
margin-top: .3em;
}
#jetpack-version {
margin: .5em 0;
}
option.status-public {
font-weight: bold;
}

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

@ -24,7 +24,6 @@
.ed-sprite-seamonkey { background-position: 0 -32px; }
.ed-sprite-android { background-position: 0 -48px; }
.ed-sprite-mobile { background-position: 0 -64px; }
.ed-sprite-jetpack { background-position: 0 -80px; }
.ed-sprite-is_restart_required { background-position: 0 -96px; }
.ed-sprite-notes { background-position: 0 -112px; }
.ed-sprite-needs-admin-content-review { background-position: 0 -128px; }

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

@ -59,41 +59,6 @@ $(document).ready(function() {
$uploadAddon.addonUploader(opt);
}
// Jetpack
if($('#jetpack').exists()) {
$('a[rel="video-lightbox"]').click(_pd(function() {
var $this = $(this),
text = gettext('Your browser does not support the video tag'),
$overlay = $('<div>', {id: 'jetpack-overlay'}),
$video = $('<video>', {'controls': 'controls', 'text': text,
'css': {'max-width': $this.attr('data-width') + 'px'}}),
$src_mp3 = $('<source>', {'type': 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',
'src': $this.attr('data-mp4') }),
$src_webm = $('<source>', {'type': 'video/webm; codecs="vp8, vorbis"',
'src': $this.attr('data-webm') }),
$src_ogv = $('<source>', {'type': 'video/ogv; codecs="theora, vorbis"',
'src': $this.attr('data-ogv') });
$(window).on('keydown.lightboxDismiss', function(e) {
if (e.which == 27) {
$overlay.remove();
$(window).off('keydown.lightboxDismiss');
}
});
$overlay.append($video);
$video.append($src_mp3);
$video.append($src_webm);
$video.append($src_ogv);
$('body').append($overlay);
$video[0].play();
$video.click(function(e){ e.stopPropagation(); });
$overlay.click(function() {
$(this).remove();
$(window).off('keydown.lightboxDismiss');
});
}));
}
$(".invisible-upload a").click(_pd(function() {}));
// when to start and stop image polling

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

@ -525,11 +525,6 @@ function bind_viewer(nodes) {
this.known_files = {};
var metadata = data.validation.metadata;
if (metadata) {
if (metadata.jetpack_sdk_version) {
$('#jetpack-version').show()
.find('span').text(metadata.jetpack_sdk_version);
}
var identified_files = {};
(function process_files(prefix, metadata) {
if (metadata.identified_files) {