* drop AppSupport model
* in language-tools api, application param only mandatory for appversion, and ignored otherwise
* Delete 0029_delete_appsupport.py
* change api docs to make v5 the default
* change banners under /v4_frozen/ to say api is frozen and centralize version list
* Update v3 legacy banners too
* always returned urls wrapped in outgoing + originals
* document the slightly unusual data structure for the secondary hero shelves
* more codestyle fixes
* don't outgoingify the `_default` key in the dict.
* test fix
* Add ability to restrict add-on detail/version API and downloads in specific regions
* Document that we can return a 451 error in the API
* Pass a country code as the tests expect
* Add Link header to 451 responses
* drop heading, heading_text, description from discovery api
* bump the migration (and don't need to drop recommendable field now)
* turn off 'disco-heading-and-description-shim' in v4
* add sponsored shelf that uses Adzerk for placement
* cleanup of some commented out code
* log a broken json response as an adzerk fail too
* totally not just renaming the test class to work around an ES indexing bug
* change to use mixins instead of subclassing TestESAddonSerializerOutput
We need to keep both in sync because in manifests the distinction
doesn't exist, and validation is currently performed assuming
compatibility for both applications.
* Add internal API to create AppVersions
* Add missing test for 403
* Remove commented breakpoint call
* Add missing appversion in test_alpha_star_already_exists() test
* Remove views/code about info requests
Info requests are no longer possible, replaced with delayed rejections
(or simple reviewer reply with no deadline).
* Move migration
* Remove `request` from VersionForm, it's no longer needed
* Add new reviewer flag to disable auto-approval until the next manual approval
This will be used by delayed review rejections to "pause" listed auto-approvals
for an add-on until the next version that fixes the issues noted by the reviewer
is approved.
* Bump migration
* Test for the field being False
In case a developer is using Docker Desktop for Windows then
the containers don't prepare /etc/hosts file. Additionally,
elasticsearch faces OOM errors so added a Gotcha for this.
* Expose file.id in compare endpoint.
Fixes#13650
* Actually, expose the file id, not the version id.
* Rename to base_file_id, fix a few other doc typos
* Small refactor, use a nested serializer to render an actual object for base_file
* Fix naming
* Add information about whether a file is minified to the reviewers API.
Fixes#13589
* Add documentation
* experiment, don't delete all validation objects
* Fix how we're fetching the FileValidation, use parent.current_file.pk
* Increase num queries check for now
* Avoid that extra query
* Add methods to the Addon model to deal with DeniedGuid
* Update reviewers.js with new button IDs
* Add new reviewer API endpoints
* Add new buttons to allow/deny resubmission
The `Addon.is_guid_denied()` method is now a prop.
* linting fixes
* move new buttons to the right
* resubmission buttons are red now
* Only calculate sha256 hash of currently selected file.
This will calculate the hash only for the currently selected file which
will reduce the delay of the initial request significantly because we
won't have to calculate sha256 hashes for hundreds of files.
The additional calculation time when selecting a file should be fairly
low because we already have the content in memory and the code-manager
does prefetch some usual usage patterns which will ensure most of the
data is already rendered.
Fixes#12920
* Update docs
* Fix flake8
* Fix typo
Refactor unlisted submission to go through auto-approval workflow
Because unlisted versions can be submitted when the add-on is
disabled, this forces us to consider them as candidates for
auto_approve, but reject them later during processing.
Upgrade Celery to 4.3.0
This PR upgrades to Celery 4.3, introduces a small hack because of a regression in celery.
This PR does not introduce any helpers to make use of celery workers inside the tests, we delayed that to a later point to unblock the upgrade.
This PR does fix some inconsistencies with elasticsearch mocks along the way as they were making some tests fail (see comment logs), the mocks are now applied and rolled back much less than before which makes them easier to reason about and to debug.
Notes:
* acks_late now doesn't acknowledge in case of failures or timeouts (which is the case for index_addons). We could use task_acks_on_failure_or_timeout but I figured the new behavior should be fine.
* any CELERY_ALWAYS_EAGER setting in local_settings.py must be replaced by CELERY_TASK_ALWAYS_EAGER
commit log:
* Implement proper wait_for_tasks helper, make TestTaskQueued work with celery worker
* Revert changes removing threading code from es reindex tests
* Fix es reindex test, correct always eager usage.
* Small cleanups, fix docs, don't reload session worker.
* Ensure docker-compose celery result doesn't use the same database as any potential tests
* Monkeypatch for celery regression
* Actually use our own app where all tasks are already bound to. This also enables logging
* Experiment: Group celery worker tests together with elasticsearch and dont run them multitasked
* Remove envlist as it doesn't add anything to our specific setup
* Fix es-and-celery marker selection
* Remove completely redundant tests
* Fix hanging tasks, let's see what travis thinks... I'll follow up with cleanups and much more docs once tests are actually succeeding
* Define celery.ping in amo.celery, use redis result backend
* Cleanup celery worker implementation a bit.
Mimic our usage of elasticsearch specific tests, this avoids various
necessary workarounds and environment cleanups because django handles
things like settings properly in the first place.
* Untangle es mocks a bit, raise error in case of not properly stopped patches.
* Re-implement state test by using celery manager to wait for results
* Explicitly re-reinitialize the workers event loop and dont reuse anything existing
* Remove celery worker thread specific code.
* Reset default celery result backend setting
* Correct canned_response description, document response values.
Also document possible null values.
Fixes#12263Fixes#12087
* Use a definition list instead of duplicated data.
* Add more information about nullable values.
* move all the make commands that operate on a single container to Makefile-docker
* add default user to Dockerfile
* revert the PYTHON_COMMAND var change
AbuseReport.addon_install_source is added to match what Firefox
has internally, and to help support future versions that may
introduce new possible values, the AbuseReport serializer now
accepts unknown values for addon_install_method and
addon_install_source and turns them into "other" instead of
returning a 400.
* Implement new `canned_response` relationship in draft comments.
This also updates the api changelog along the way with a few things I
forgot to add in the past.
Fixes#11320Fixes#11807
* Fix flake8
* Add missing migration
* Do not expose heading_text in the discovery pane serializer.
Fixes#11817
* Update help text.
* Update API docs
* Actually commit removing heading_text
* Remove all usage of 'six' and as much compat code as I could find.
Cleans up some imports along the way.
Fixes#11728
* Fix typo
* Fix rta related code paths, I actually misread the comment…
* Move ResourceWarning filtering to setup.cfg
* Completely revamp draft comments API.
Revamp how draft comments work, store multiple comments per version and
paginate them.
This also implement PATCH to update a comment, updates DELETE, GET
and POST endpoints properly and updates the documentation accordingly.
Fixes#11380Fixes#11379Fixes#11378Fixes#11374
* Fix statuscode in docs
* Fix docs, use regular VersionSerializer
* Allow filename and lineno to be optional.
* Add note about lineno should be specific to the version, not the parent.
* Fix test to use regular VersionSerializer
* Fix test to test that the 'id' is set properly now
* Add more details to pagination, add detail endpoint for comments.
* Use user_factory
Currently we followed how ``git diff`` works and didn't render any
changes for unmodified files.
To fix some frontend issues we now need to include unmodified files.
That alone would not render their contents, so we're including a faked
hunk that shows all lines as unmodified.
Fixes#11639
* Expose canned responses through API
Fixes#11276
Requires #11404 to be merged first
* Make sure category is serialized as a string
* Small cleanup
* Fix tests and docs
* Implement a new draft-comment model.
This new model will be used to present draft-comments written in the
code-manager and displayed during review.
The related rest-api comes in a second step.
Fixes#11319Fixes#11277
Refs mozilla/addons-code-manager#112
* Smaller fixes, implement API
* Implement GET, add docs
* Fix accidentally dropped line
* Fix migration naming
* Add user constraint
* Fix permissions, correct querying of user
* Put 'PUT' related code into elif block
* Fix CI
Indicate file status in file.entries.
We're now adding a new `status` property to `file.entries` which
indicates the git status of the file.
This will make it easier to show added/deleted/removed files.
This does not yet cover renamed/copied status as this will happen in #10849Fixes#11123