* 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
* 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
This implements fetching a diff by pathspec, we need to implement this
upstream so it's implemented as a workaround for now.
This remoes support for copy and rename finding for now. I filed #10849
to fix this properly in a separate step.
The actual diff output format is hard-coded and not yet implemented as
serializers for now which makes experimenting much easier in case we
need to adapt the format depending on how the client implements it.
Fixes#10323
We now have the expected values for some of the fields. In addition,
some of the fields that had equivalents in our other APIs are renamed
to match the rest of the API better.
This implements more advanced file-type detection based on `python-magic` thus we don't rely on the files extensions anymore but actually verify their content (header) before serving it to the client and reviewer.
Fixes#10685 (and actually rewrites it's meaning)
* Expose version list for diffing, rework reviewers api to be more concise
We're now mounting any listing/browsing/future diffing APIs under the
already existing addon/<addon_id>/ endpoint which makes the whole
reviewer APIs behave more consistently.
Also implements the listing of versions that can be used for browsing
and diffing.
Fixes#10432
* Simplify view, don't rely on @action decorator but just make it the detail view
* Smaller cleanups, fix permissions
* More smaller cleanups, split list/retreive better
* Fix link in docs
* Improve tests, remove 'should_show_channel' and 'url'
* Smaller performance optimization
* Fix flake8
* Improve docs
* Fix docs for python 3
* Make travis behave like it's inside our container, fix tox/makefile accordingly
* Fix docs build by choosing another label than _search (which is already used)
* Fix codestyle linter issues
* Remove extra force_bytes import
* Add ignore for int|null in docs as it's used in a couple places and it's valid
* Fix more docs build failures in reviewers.rst
Also build docs with -W by default to make future docs breakage
easier to spot locally.
* Leave -f Makefile-docker for UI Tests as they are not running from the standard container
Fixes#10411
This removes unused files.utils helpers `zip_folder_content` and `repack` along the way.
Once this has been merged, ops can remove `GITHUB_API_USER` and `GITHUB_API_TOKEN` from the environment. I actually wonder where they have been generated, e.g to get them revoked?
Also refactors the way we call taar/taar lite since it depends on
a new taar API that needs to be called using POST + a specially
crafted parameter to handle the overrides.
Unfortunately, we'll have to duplicate the environment config but I added
a comment so that should be fine. It's very rarely being used anyway.
Fixes#9288