Make langpacks work with remote storage

RESOLVED FIXED

Status

Marketplace
Code Quality
P1
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: mat, Assigned: ashort)

Tracking

Points:
---

Details

(Reporter)

Description

2 years ago
Although Langpacks code was written to already use storage, since it's using the default storage class it will probably be broken with a remote storage (I haven't tested - I may be wrong).

It's probably just a matter of adjusting tests, views and models to use public_storage/private_storage correctly. Langpacks are automatically signed once uploaded, even if they are not active, and re-uses code from Webapp and and signing, so it should be straightforward.
(Reporter)

Comment 1

2 years ago
in mkt/langpacks/models.py:

                sign_app(storage.open(upload.path), self.file_path, ids)
            except SigningError:
                log.info('[LangPack:%s] Signing failed' % self.pk)
                if storage.exists(self.file_path):
                    storage.delete(self.file_path)

Using the default storage for upload.path would work, but we should use private_storage instead (FileUpload should be created using private_storage IIRC). In the except close though, it should be public_storage.

Some docs about the API: https://wiki.mozilla.org/Marketplace/LangPacks ; you can also try to download a manifest once a langpack is uploaded.

Updated

2 years ago
Assignee: nobody → mpillard
Priority: -- → P1
(Reporter)

Comment 2

2 years ago
Moving over to ashort since he has a PR dealing with that.
Assignee: mpillard → ashort
(Assignee)

Comment 3

2 years ago
https://github.com/mozilla/zamboni/commit/4cb0a838a41da268b3a0891b5316afad9a4cc74f
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.