Commit graph

32 commits

Author SHA1 Message Date
Jennifer Richards 07e26dd52e
refactor: Replace deprecated force_text with force_str 2023-05-09 15:21:50 -03:00
Lars Eggert f8b48f4c43
fix: use Internet-Draft more consistently across the UI (#5104)
* s/Internet Draft/Internet-Draft/i

* s/draft/Internet-Draft/i or s/draft/I-D/i

* s/ID/I-D/

* Fix tests

* a -> an

* Undo case-change to ASCII

* Address code review comments

* Add migrations

* Add merged migration

* fix: straighten out migrations

* fix: finish straightening out migrations

---------

Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2023-02-11 10:09:28 -06:00
Jennifer Richards 31d55f1d37
fix: remove unused imports 2022-09-28 17:45:11 -03:00
Jennifer Richards a653582cf7
fix: timezone fixes from last few comparisons with tzaware-obe 2022-09-28 13:21:50 -03:00
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
Robert Sparks 9a9f3fa360 Merged in [18798] from jennifer@painless-security.com:
Improve handling of submissions for closed working groups. Fixes #3058.
 - Legacy-Id: 18807
Note: SVN reference [18798] has been migrated to Git commit 233bff8196
2021-01-27 23:19:42 +00:00
Jennifer Richards 233bff8196 Improve handling of submissions for closed working groups. Fixes #3058. Commit ready for merge.
- Legacy-Id: 18798
2021-01-18 14:55:25 +00:00
Robert Sparks 3697180cc1 Reverted merge of timezone-aware migration efforts.
- Legacy-Id: 18792
2021-01-12 16:54:20 +00:00
Henrik Levkowetz 774e752a54 Snapshot of timezone-aware datatracker code. Tests pass, and the test-crawler shows only expected differences. Trunk changes merged in up to r18768.
- Legacy-Id: 18770
2020-12-16 23:53:37 +00:00
Henrik Levkowetz f41fd1867d Upgraded the required versions of mypy and django-stubs to the latest that support Django 2.2. Fixed some issues found by after the upgrades.
- Legacy-Id: 18717
2020-11-22 21:13:36 +00:00
Henrik Levkowetz 726fcbf27d Removed all __future__ imports.
- Legacy-Id: 17391
2020-03-05 23:53:42 +00:00
Henrik Levkowetz a7baacf519 Added missing .as_strings() to some gather_address_lists() calls, in order to assign strings rather than lists to Message CharField instances. Fixed a Message content_type setting.
- Legacy-Id: 17337
2020-02-26 16:59:18 +00:00
Henrik Levkowetz 99a7f9c263 Python2/3 compatibility: Added force_str or force_bytes in some places, to ensure the argument right type
- Legacy-Id: 16453
2019-07-15 17:13:46 +00:00
Henrik Levkowetz 1225f8af6b Refactored submission code to be clearer and only do mimetype extraction in one place, made the point where files are saved less obscure, fixed bytes/str issues for file read and write, fixed regex strings, fixed variable name visibility due to scope changes in py3.
- Legacy-Id: 16375
2019-07-04 15:49:42 +00:00
Henrik Levkowetz d7f5c84182 Initial 2to3 patch with added copyright statement updates.
- Legacy-Id: 16309
2019-06-27 14:40:54 +00:00
Robert Sparks 9ace7db719 Send mail to a list when a new IETF WG -00 is submitted. Fixes #2730. Commit ready for merge.
- Legacy-Id: 16287
2019-06-18 21:24:49 +00:00
Russ Housley 733c304e3d Set reply-to for I-D Announcements that include a CC to a mail list. Fixes #2530.
- Legacy-Id: 15282
2018-06-29 18:15:42 +00:00
Lars Eggert 8a70e9773d Fix various "RemovedInDjango20Warning" warnings. Commit ready for merge.
- Legacy-Id: 13112
2017-03-25 19:16:45 +00:00
Henrik Levkowetz f6a1fcdaf8 Added more information about submission errors and a full idnits run to the manual post email sent to the secretariat.
- Legacy-Id: 12831
2017-02-13 20:37:47 +00:00
Henrik Levkowetz 47d6bbbea3 Renamed the SubmissionEmail event class to SubmissionEmailEvent, and added an admin class for it.
- Legacy-Id: 11942
2016-09-08 15:04:53 +00:00
Henrik Levkowetz 7a8c067d83 Changed a state name, and renamed some view functions for easier code reading. Removed extra name= parameters from the submit/ urlpatterns.
- Legacy-Id: 11917
2016-09-01 09:14:34 +00:00
Henrik Levkowetz e2fccfb094 Merged in ^/branch/scow/track-manual-id-posts-6.31.1.dev0@11899, which provides better support for manual ID posting.
- Legacy-Id: 11914
2016-08-31 22:30:31 +00:00
Mike Douglass fa3a34389e Merge forward to 6.31.1.dev0
- Legacy-Id: 11899
2016-08-31 03:00:10 +00:00
Robert Sparks 2009afe7b8 preparing to merge forward to 6.31
- Legacy-Id: 11875
2016-08-25 15:21:57 +00:00
Robert Sparks f5b6465e81 mailtoken becomes mailtrigger
- Legacy-Id: 10090
2015-09-17 20:03:45 +00:00
Robert Sparks 90c3426e2f updated mailtoken utilities to match the model refactor. Morphed all the code using the utilities to match. Added paths to get Cc through as needed. Next up: Recipient selection form for the iesg save-and-send-email workflow
- Legacy-Id: 10040
2015-08-23 18:15:06 +00:00
Robert Sparks 89f038a1e3 checkpoint
- Legacy-Id: 10019
2015-08-17 20:24:16 +00:00
Robert Sparks 8218a59e6f Copy the RFC Editor on new version messages for drafts in any stream if the RFC Editor is already working on the draft. Fixes bug #1700. Commit ready for merge.
- Legacy-Id: 9619
2015-05-12 02:08:32 +00:00
Henrik Levkowetz 4cc4f5080c Merged in [8254] from rjsparks@nostrum.com:\n Don't send mail to unknown-email-* addresses. Fixes bug #1471.
- Legacy-Id: 8365
Note: SVN reference [8254] has been migrated to Git commit f7f29a62588eac9b2aaf26cd0401a910fa48403f
2014-09-28 18:51:21 +00:00
Ole Laursen 7f277a8fbb Replace user.get_profile() with user.person, the profile stuff is deprecated since Django 1.5
- Legacy-Id: 6968
2013-12-18 10:13:40 +00:00
Ole Laursen 650d8316eb Make the submit tool use the access token framework with a bit of backwards compatibility glue
- Legacy-Id: 6717
2013-11-15 16:09:05 +00:00
Ole Laursen ecf68dbb05 Revamp and clean up submit models:
- Rename IdSubmissionDetail to Submission
- Rename various submission fields to correspond to the conventions in
  the new schema
- Use a name model for the states instead of IdSubmissionStatus
- Drop the TempIdAuthor model which is based on splitting up author
  names
- Add a simple textual SubmissionEvent for tracking events in the
  lifetime of a submission
- Delete a bunch of obsolete fields
- Make sure all submission have an access key so we can depend on it
- Add state for when approval is needed from previous authors

A couple of migrations take care of transforming the
IdSubmissionDetail and moving data over/cleaning it up.

Also revamp the submit view code:

- Make form code do validation/cleaning only so there's a clear
  separation of concerns
- Reduce uses of inheritance that made the code hard to follow -
  forms now don't inherit from each other, views don't call each other
  but instead reuse common utilities, templates share CSS/utilities
  instead of relying on inheritance
- Move email rendering/sending to separate file
- Drop the in-grown terminology use (auto post vs. manual posts)
- Make the status page explain who is emailed for what purpose
- Add history table with recorded events
- Make the status page handle its post actions by itself instead of
  duplicating most of the setup logic in a number of simple views
- Fix a couple of minor bugs and handle some edge cases better
- Expand tests with a couple of more cases

Possibly the submit tool could still use more help text added to
explain the process, ideally what's explained in the tool instructions
page should be inlined or self-evident.
 - Legacy-Id: 6714
2013-11-15 13:30:32 +00:00