datatracker/ietf/name/migrations
Jennifer Richards 3705bedfcd
feat: Celery support and asynchronous draft submission API (#4037)
* ci: add Dockerfile and action to build celery worker image

* ci: build celery worker on push to jennifer/celery branch

* ci: also build celery worker for main branch

* ci: Add comment to celery Dockerfile

* chore: first stab at a celery/rabbitmq docker-compose

* feat: add celery configuration and test task / endpoint

* chore: run mq/celery containers for dev work

* chore: point to ghcr.io image for celery worker

* refactor: move XML parsing duties into XMLDraft

Move some PlaintextDraft methods into the Draft base class and
implement for the XMLDraft class. Use xml2rfc code from ietf.submit
as a model for the parsing.

This leaves some mismatch between the PlaintextDraft and the Draft
class spec for the get_author_list() method to be resolved.

* feat: add api_upload endpoint and beginnings of async processing

This adds an api_upload() that behaves analogously to the api_submit()
endpoint. Celery tasks to handle asynchronous processing are added but
are not yet functional enough to be useful.

* perf: index Submission table on submission_date

This substantially speeds up submission rate threshold checks.

* feat: remove existing files when accepting a new submission

After checking that a submission is not in progress, remove any files
in staging that have the same name/rev with any extension. This should
guard against stale files confusing the submission process if the
usual cleanup fails or is skipped for some reason.

* refactor: make clear that deduce_group() uses only the draft name

* refactor: extract only draft name/revision in clean() method

Minimizing the amount of validation done when accepting a file. The
data extraction will be moved to asynchronous processing.

* refactor: minimize checks and data extraction in api_upload() view

* ci: fix dockerfiles to match sandbox testing

* ci: tweak celery container docker-compose settings

* refactor: clean up Draft parsing API and usage

  * remove get_draftname() from Draft api; set filename during init
  * further XMLDraft work
    - remember xml_version after parsing
    - extract filename/revision during init
    - comment out long broken get_abstract() method
  * adjust form clean() method to use changed API

* feat: flesh out async submission processing

First basically working pass!

* feat: add state name for submission being validated asynchronously

* feat: cancel submissions that async processing can't handle

* refactor: simplify/consolidate async tasks and improve error handling

* feat: add api_submission_status endpoint

* refactor: return JSON from submission api endpoints

* refactor: reuse cancel_submission method

* refactor: clean up error reporting a bit

* feat: guard against cancellation of a submission while validating

Not bulletproof but should prevent

* feat: indicate that a submission is still being validated

* fix: do not delete submission files after creating them

* chore: remove debug statement

* test: add tests of the api_upload and api_submission_status endpoints

* test: add tests and stubs for async side of submission handling

* fix: gracefully handle (ignore) invalid IDs in async submit task

* test: test process_uploaded_submission method

* fix: fix failures of new tests

* refactor: fix type checker complaints

* test: test submission_status view of submission in "validating" state

* fix: fix up migrations

* fix: use the streamlined SubmissionBaseUploadForm for api_upload

* feat: show submission history event timestamp as mouse-over text

* fix: remove 'manual' as next state for 'validating' submission state

* refactor: share SubmissionBaseUploadForm code with Deprecated version

* fix: validate text submission title, update a couple comments

* chore: disable requirements updating when celery dev container starts

* feat: log traceback on unexpected error during submission processing

* feat: allow secretariat to cancel "validating" submission

* feat: indicate time since submission on the status page

* perf: check submission rate thresholds earlier when possible

No sense parsing details of a draft that is going to be dropped regardless
of those details!

* fix: create Submission before saving to reduce race condition window

* fix: call deduce_group() with filename

* refactor: remove code lint

* refactor: change the api_upload URL to api/submission

* docs: update submission API documentation

* test: add tests of api_submission's text draft consistency checks

* refactor: rename api_upload to api_submission to agree with new URL

* test: test API documentation and submission thresholds

* fix: fix a couple api_submission view renames missed in templates

* chore: use base image + add arm64 support

* ci: try to fix workflow_dispatch for celery worker

* ci: another attempt to fix workflow_dispatch

* ci: build celery image for submit-async branch

* ci: fix typo

* ci: publish celery worker to ghcr.io/painless-security

* ci: install python requirements in celery image

* ci: fix up requirements install on celery image

* chore: remove XML_LIBRARY references that crept back in

* feat: accept 'replaces' field in api_submission

* docs: update api_submission documentation

* fix: remove unused import

* test: test "replaces" validation for submission API

* test: test that "replaces" is set by api_submission

* feat: trap TERM to gracefully stop celery container

* chore: tweak celery/mq settings

* docs: update installation instructions

* ci: adjust paths that trigger celery worker image  build

* ci: fix branches/repo names left over from dev

* ci: run manage.py check when initializing celery container

Driver here is applying the patches. Starting the celery workers
also invokes the check task, but this should cause a clearer failure
if something fails.

* docs: revise INSTALL instructions

* ci: pass filename to pip update in celery container

* docs: update INSTALL to include freezing pip versions

Will be used to coordinate package versions with the celery
container in production.

* docs: add explanation of frozen-requirements.txt

* ci: build image for sandbox deployment

* ci: add additional build trigger path

* docs: tweak INSTALL

* fix: change INSTALL process to stop datatracker before running migrations

* chore: use ietf.settings for manage.py check in celery container

* chore: set uid/gid for celery worker

* chore: create user/group in celery container if needed

* chore: tweak docker compose/init so celery container works in dev

* ci: build mq docker image

* fix: move rabbitmq.pid to writeable location

* fix: clear password when CELERY_PASSWORD is empty

Setting to an empty password is really not a good plan!

* chore: add shutdown debugging option to celery image

* chore: add django-celery-beat package

* chore: run "celery beat" in datatracker-celery image

* chore: fix docker image name

* feat: add task to cancel stale submissions

* test: test the cancel_stale_submissions task

* chore: make f-string with no interpolation a plain string

Co-authored-by: Nicolas Giard <github@ngpixel.com>
Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2022-08-22 13:29:31 -05:00
..
0001_initial.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
0002_agendatypename.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
0003_agendatypename_data.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
0004_add_prefix_to_doctypenames.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
0005_reviewassignmentstatename.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
0006_adjust_statenames.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
0007_fix_m2m_slug_id_length.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
0008_reviewerqueuepolicyname.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
0009_add_verified_errata_to_doctagname.py Removed all __future__ imports. 2020-03-05 23:53:42 +00:00
0010_timerangename.py Add support for the timerange, wg_adjacent and time_relation constraints. 2020-02-12 10:42:38 +00:00
0011_constraintname_editor_label.py Renamed a migration (multiple leaf nodes) 2020-04-28 17:59:07 +00:00
0012_role_name_robots.py Added a new role 'Robot', for use with reg-system and mail-archive automated accesses. 2020-06-08 19:16:23 +00:00
0013_add_auth48_docurltagname.py Renumbered some migrations to avoid multiple leaf nodes. 2020-07-14 17:40:41 +00:00
0014_extres.py Merged in the ExtResource work from rjsparks@nostrum.com, based on a feature request and contributions from rsalz@akamai.com. This provides external resource models for Person, Group, and Document models, as a generalisation of the previous related-URL concept. This provides a consistent labelling and classification of URLs and other resources related to a Group, Document, or Person. The GroupURL (and similar) classes will be removed in a later step. Some DocumentURL instances (such as auth48 URLs) remain to convert, as they have come in with other merged-in work while the ExtResource work was in transit. 2020-07-20 01:58:26 +00:00
0015_populate_extres.py Undid an ordering dependency for migration name.0015_populate_extref. 2020-07-22 20:24:48 +00:00
0016_add_research_area_groups.py Merged in [18299] from rjsparks@nostrum.com: 2020-07-29 14:37:51 +00:00
0017_update_constraintname_order_and_label.py fontawesome -> bootstrap-icons 2021-11-10 09:28:38 +00:00
0018_slidesubmissionstatusname.py Merged in [18371] from mark@painless-security.com: 2020-08-26 16:47:35 +00:00
0019_add_timeslottypename_private.py Merged in ^/branch/iola/meeting-improvement-r18382@18466. This provides a beta-level snapshot of the new schedule editor work. All known issues should be fixed, but there might be adjustments needed after experience with using the new edit view. 2020-09-04 14:28:25 +00:00
0020_add_rescheduled_session_name.py Merged in ^/branch/iola/meeting-improvement-r18382@18466. This provides a beta-level snapshot of the new schedule editor work. All known issues should be fixed, but there might be adjustments needed after experience with using the new edit view. 2020-09-04 14:28:25 +00:00
0021_add_ad_appr_draftsubmissionstatename.py Improve handling of submissions for closed working groups. Fixes #3058. Commit ready for merge. 2021-01-18 14:55:25 +00:00
0022_add_liaison_contact_rolenames.py Use Roles instead of dedicated model for liaison statement group contacts. Fixes #3100. Commit ready for merge. 2021-02-12 16:39:20 +00:00
0023_change_stream_descriptions.py Modifies stream name descriptions and changes document page to use the description instead of the stream name. Fixes issue 3169. Commit ready for merge. 2021-02-24 03:11:50 +00:00
0024_constraintname_is_group_conflict.py Add ConstraintNames for chair, tech, and key participant conflicts. Replace temporary UI workaround with proper conflict type handling. Fixes #3083. Commit ready for merge. 2021-06-09 19:36:27 +00:00
0025_set_constraintname_is_group_conflict.py Add ConstraintNames for chair, tech, and key participant conflicts. Replace temporary UI workaround with proper conflict type handling. Fixes #3083. Commit ready for merge. 2021-06-09 19:36:27 +00:00
0026_add_conflict_constraintnames.py fontawesome -> bootstrap-icons 2021-11-10 09:28:38 +00:00
0027_add_bofrequest.py Use BOF consistently. 2021-07-14 17:33:14 +00:00
0028_iabasg.py Add IAB Administrative Support Group group type. Add IAB groups to the group menu. Clearly delineate group types in the group menu. Fixes #3295 and #3296. Commit ready for merge. 2021-08-30 19:39:21 +00:00
0029_proceedingsmaterialtypename.py Reordered migrations. Updated name fixture. 2021-09-04 15:33:53 +00:00
0030_populate_proceedingsmaterialtypename.py Reordered migrations. Updated name fixture. 2021-09-04 15:33:53 +00:00
0031_add_procmaterials.py Reordered migrations. Updated name fixture. 2021-09-04 15:33:53 +00:00
0032_agendafiltertypename.py Snapshot of dev work to add session purpose annotation 2021-10-12 17:08:58 +00:00
0033_populate_agendafiltertypename.py Snapshot of dev work to add session purpose annotation 2021-10-12 17:08:58 +00:00
0034_sessionpurposename.py Eliminate the officehours timeslot type, update/renumber migrations, mark offagenda/reserved TimeSlotTypeNames as not used, add a 'none' SessionPurposeName and disallow null, update agenda filter keywords/filter helpers, fix broken tests and general debugging 2021-11-04 17:06:06 +00:00
0035_populate_sessionpurposename.py Eliminate the officehours timeslot type, update/renumber migrations, mark offagenda/reserved TimeSlotTypeNames as not used, add a 'none' SessionPurposeName and disallow null, update agenda filter keywords/filter helpers, fix broken tests and general debugging 2021-11-04 17:06:06 +00:00
0036_depopulate_timeslottypename_private.py Update migrations and fix a few failing tests. Branch ready for merge. 2021-11-09 02:40:54 +00:00
0037_remove_timeslottypename_private.py Eliminate the officehours timeslot type, update/renumber migrations, mark offagenda/reserved TimeSlotTypeNames as not used, add a 'none' SessionPurposeName and disallow null, update agenda filter keywords/filter helpers, fix broken tests and general debugging 2021-11-04 17:06:06 +00:00
0038_disuse_offagenda_and_reserved.py Eliminate the officehours timeslot type, update/renumber migrations, mark offagenda/reserved TimeSlotTypeNames as not used, add a 'none' SessionPurposeName and disallow null, update agenda filter keywords/filter helpers, fix broken tests and general debugging 2021-11-04 17:06:06 +00:00
0039_depopulate_constraintname_editor_label.py chore: remove editor_label field from ConstraintName model (#3783) 2022-04-14 15:30:11 -03:00
0040_remove_constraintname_editor_label.py chore: remove editor_label field from ConstraintName model (#3783) 2022-04-14 15:30:11 -03:00
0041_update_rfcedtyp.py feat: begin supporting the new rfc editor model (#3960) 2022-05-20 12:22:17 -05:00
0042_editorial_stream.py feat: begin supporting the new rfc editor model (#3960) 2022-05-20 12:22:17 -05:00
0043_editorial_stream_grouptype.py feat: begin supporting the new rfc editor model (#3960) 2022-05-20 12:22:17 -05:00
0044_validating_draftsubmissionstatename.py feat: Celery support and asynchronous draft submission API (#4037) 2022-08-22 13:29:31 -05:00
__init__.py Introduce more generic ballot models, start porting doc ballot page to the 2012-03-30 17:16:50 +00:00