implement new uploads to the addon api, for listed too. #17765
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Basic flow:
api/v5/addons/submission/
to create a FileUpload (returns a serialized response that contains the upload UUID). The upload is wherechannel
is set.api/v5/addons/submission/<uuid>
api/v5/addons/addon/
with json like{"categories": {"firefox": ["bookmarks"]}, "version": {"upload": "<uuid>", "license": 7}}
api/v5/addons/addon/<addon slug or id or guid>/versions/
with json like{"upload": "<uuid>", "license": 7}
Known limitations:
FileUploadViewSet
needs refactoring to move most/all of the creation logic intoFileUploadSerializer
AddonSerializer
toVersionSerializer
.AddonSerializer
that should be writable but are currently eitherSerializerMethodField
s or customField
s/Serializer
s that don't have a working write implementation.default_locale
did unexpected things during Addon creation with respect to data in the manifest so left it read only.CreateModelMixin
has been added to the views to limit the scope of the changes/tests. The serializers should handle updates without a massive amount of extra work (in theory!).when the feature is launched mozilla/addons#5348 will be fixed, but it's a way off at this point