Add Enterprise Add-on API - #25215
Conversation
970e277 to
4761b3c
Compare
55ec3e4 to
b98378c
Compare
b98378c to
f054b68
Compare
eviljeff
left a comment
There was a problem hiding this comment.
Looks fine, just looking for some clarification before approving.
| addon = self.get_addon_object() | ||
| if requested == 'all_with_deleted' or self.action != 'list': | ||
| queryset = addon.versions(manager='unfiltered_for_relations').all() | ||
| elif requested == 'all_with_unlisted': |
There was a problem hiding this comment.
all_with_unlisted is actually "all" - i.e. including listed, unlisted, and enterprise.
Two questions here:
- do we want
all_with_unlistedto include enterprise? If not do we want/need anall_with_unlisted_and_enterprise? Either way the docs should mention the behaviour. - if
all_with_unlistedis going to include enterprise versions in v5, should it also include enterprise versions in v4 and v3? i.e. if the no-enterprise gate is active, should this queryset exclude enterprise versions?
There was a problem hiding this comment.
RE: The comment above this section;
# filter in use. When fetching a single instance however, we use the
# same queryset as the less restrictive filter, that allows us to see
# all versions, even deleted ones. In any case permission checks will
# prevent access if necessary (meaning regular users will never see
# deleted or unlisted versions regardless of the queryset being used).
I imagine it would be more consistent with the intent to include enterprise versions in v5, and consistent with the rest of the code to gate it for v3/v4?
There was a problem hiding this comment.
Depends really if we want consistency across the version of the api - so enterprise is available everywhere in v5, but unavailable everywhere in v3 and v4. Or across the add-on, so no matter which version of the api you use, once submitted, the enterprise versions would be in the list of versions.
Really a question for Product if not already specified in the PRD/issues, but imo, I don't think we gain anything from preventing those versions from being exposed to developers in the api responses. Going further, maybe we don't need the api gate either - i.e. does it matter if someone used v3 with filter=enterprise_only? 🤷
… error on pass for enterprise channel in v3/v4
22649b7 to
3862c4f
Compare
eviljeff
left a comment
There was a problem hiding this comment.
r+wc if we don't care about developers using v3/v4 and seeing enterprise versions we could strip out some of the extra complexity with the new api gate🤷
Fixes mozilla/addons#14851
Description
Adds API support for enterprise channel work.
Testing
1. Upload
/api/v5/addons/upload//api/v5/addons/upload/<string:uuid>/ADMIN_INSTALL_ONLY_REQUIREDerror when the setting is missing.Screenshots
2. Add-on
/api/v5/addons/addon/3. Version
/api/v5/addons/addon/(int:addon_id|string:addon_slug|string:addon_guid)/versions/enterprise_only./api/v5/addons/addon/(int:addon_id|string:addon_slug|string:addon_guid)/versions/(int:id|string:version_number)/Checklist
#ISSUENUMat the top of your PR to an existing open issue in the mozilla/addons repository.