Commit graph

148 commits

Author SHA1 Message Date
Jennifer Richards 6aff818b72
feat: remove deprecated /api/submit/ endpoint (#8017)
* feat: remove deprecated /api/submit endpoint

* chore: remove unused imports

* test: test api_submit_tombstone view
2024-10-09 10:56:00 -05:00
Robert Sparks a00dfc0c27
chore: remove unused submit by email functionality (#7249) 2024-03-26 09:44:49 -05:00
Robert Sparks f9c9644263
chore: merge main and fix conflicts 2023-08-30 16:35:20 -05:00
Robert Sparks 383899c5c4
chore: checkpoint: docalias mostly removed 2023-08-15 16:49:17 -05:00
Liubov Kurafeeva 91297f18e6
fix: Provide human-friendly status in submission status API response (#6011)
Co-authored-by: nectostr <bastinda96@gmail.com>
2023-07-22 12:43:08 -07:00
Jennifer Richards e3d16bc8e6
feat: Use distinct event desc for drafts received via api_submit (#5735) 2023-06-01 11:15:57 -05:00
Jennifer Richards a0f6cdb661
feat: Process uploaded submissions asynchronously (#5580)
* fix: Use relative URL for submission status link

* refactor: Refactor/rename process_uploaded_submission async task

* feat: Add async task to process but not accept a submission

* feat: Replace upload_submission() with an async implementation (WIP)

* fix: Do not put Submission in "uploaded" state if an error occured

* refactor: Improve text/XML draft processing flow

* feat: Extract authors from text in async processing

* fix: Fix call signatures and abort submission on failed validation

* feat: Validate submission name format

* fix: Correctly validate emails from text submission

* fix: Clean up submission validation

* fix: Better display errors on upload_submission page

* feat: Reload submission status page when awaiting validation

* test: Fix call signatures; remove unused imports

* chore: Add type hint

* test: Update tests to match renamed task

* fix: Fix typo in error message

* test: Fix failing Api- and AsyncSubmissionTests

* Rename process_uploaded_submission to process_and_accept_...
* Remove outdated tests

Does not yet test new behavior.

* refactor: Break up submission_file() helper

* test: Refactor tests to run the async processing (wip)

* test: Drop test of bad PDF submission

The PDF submission field was removed, so no need to test it.

* test: Update more tests

* test: Bring back create_and_post_submission() and fix more tests

* fix: Drop to manual, don't cancel, on revision inconsistency

Fixes remaining failing SubmitTest tests

* style: Restyle upload_submission() with black

* test: Verify that async submission processing is invoked on upload

* test: Bring back old do_submission and fix tests

Properly separating the upload and async processing stages of submission
is a bigger refactoring than will fit right now. This better exercises
the submission pipeline.

* fix: Accept only XML for API submissions

* test: Test submission processing utilities

* feat: Improve status display for "validating" submissions

* chore: Remove obsolete code

* test: Update test to match amended text

---------

Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2023-05-09 15:21:46 -05:00
Robert Sparks c38ade6e1b
feat: treat django auth username as case insensitive throughout the datatracker (#5165)
* feat: insensitive username matching at django authentication

* feat: use iexact when using the User object manager

* fix: more places to ignore username case

* fix: remove unused management command

* fix: avoid get when probing for object existance

* fix: force lowercase new usernames in secr/rolodex

* fix: use explicit arguments when creating user
2023-02-21 10:01:03 -06: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 3220bf3c40
chore: replace last few datetime.date.today() calls with date_today() 2022-10-18 12:45:47 -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 902e37d24d
fix: improve looking into submission request for remote ip. (#3720) 2022-03-22 13:04:50 -05:00
Lars Eggert 962253f994 Remove the Note Well from the datatracker and point to the IETF web site.
One less thing to keep in sync if the Note Well changes.

Commit ready for merge.
 - Legacy-Id: 19484
2021-10-28 13:08:10 +00:00
Jennifer Richards b08110b838 Allow external resources to be set/suggested during submission process. Fixes #3068. Commit ready for merge.
- Legacy-Id: 18960
2021-04-19 20:21:19 +00:00
Jennifer Richards 17d37723f7 Consolidate repeated searchable field code into SearchableField class. Fix single-valued searchable fields. Make javascript test config reusable. Use Django Form.media for JS/CSS inclusion. Fixes #3196, #3204. Commit ready for merge.
- Legacy-Id: 18939
2021-04-09 15:18:11 +00: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 45a808db95 Added more logging for submissions, to get timing information.
- Legacy-Id: 18635
2020-10-24 15:20:43 +00:00
Henrik Levkowetz 57938b039d Converted many cases of plain-text 403 messages to use a properly styled page instead, with a login link when appropriate. Also changed some API endpoint 400 responses to a more correct 403.
- Legacy-Id: 18339
2020-08-06 10:59:52 +00:00
Henrik Levkowetz 0a0df995e6 Merged in [18250] from jennifer@painless-security.com:
Reject or require manual processing for submissions when inconsistent SubmissionDocEvent revs exist. Fixes #2909.
 - Legacy-Id: 18277
Note: SVN reference [18250] has been migrated to Git commit b61bdc289b
2020-07-26 11:15:49 +00:00
Jennifer Richards b61bdc289b Reject or require manual processing for submissions when inconsistent SubmissionDocEvent revs exist. Fixes #2909. Commit ready for merge.
- Legacy-Id: 18250
2020-07-24 13:24:00 +00:00
Henrik Levkowetz 186e2ae67b Decorated post_submission() with @transaction.atomic, and did some slight refactoring of code related to post_submission() calls and submission events. This was triggered by a submission left in an intermediate state because of a WSGI timeout (leading to a 504 error).
- Legacy-Id: 17892
2020-05-28 15:01:33 +00:00
Henrik Levkowetz f2b883d2bb Merged in ^/trunk@17617.
- Legacy-Id: 17618
2020-04-14 17:11:51 +00:00
Henrik Levkowetz 5c3c3fff82 Changed the handling of some exceptions during draft submission to give user feedback rather than server 500 responses, in order to deal better with severely malformed drafts.
- Legacy-Id: 17595
2020-04-08 13:12:39 +00:00
Henrik Levkowetz f10ddadc0e Merged in changes from trunk up to r17584.
- Legacy-Id: 17593
2020-04-07 16:02:52 +00:00
Henrik Levkowetz 726fcbf27d Removed all __future__ imports.
- Legacy-Id: 17391
2020-03-05 23:53:42 +00:00
Henrik Levkowetz b4d7dd131a Added ability to use the submission API with active secondary email addresses. Fixes issue #2639.
- Legacy-Id: 17383
2020-03-04 18:05:56 +00:00
Henrik Levkowetz b7724c43d7 Changed some # type: ignore statements to work with the latest mypy
- Legacy-Id: 16968
2019-11-05 22:41:18 +00:00
Henrik Levkowetz 33e8733b91 Fixed up mypy issues or added type:ignore comments as needed for a clean mypy run.
- Legacy-Id: 16772
2019-09-30 15:42:18 +00:00
Henrik Levkowetz e0479d8d13 Changed the call signature of docevent_from_submission() to take an optional Person object, rather than person name. Added a type hint for the signature.
- Legacy-Id: 16764
2019-09-29 20:00:49 +00:00
Henrik Levkowetz a1db2d5aef Tweaked the condition for waiving submission email confirmation slightly.
- Legacy-Id: 16760
2019-09-27 06:12:55 +00:00
Henrik Levkowetz 3939c0b88c Changed draft submission to not require an email round-trip when the submitter is logged in. Added corresponding test cases.
- Legacy-Id: 16749
2019-09-26 14:43:26 +00:00
Henrik Levkowetz 855716e1d5 Py2/3 compatibility: Added __future__ import
- Legacy-Id: 16448
2019-07-15 15:46:06 +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
Henrik Levkowetz b57ad67041 Updated code and templates to use the new docman and groupman group features.
- Legacy-Id: 15922
2019-01-30 15:59:00 +00:00
Henrik Levkowetz c87d3741f3 Added 2 utility functions to help create group features query filters, and applied them in 3 places in order to move group feature role list code back into DB queries.
- Legacy-Id: 15911
2019-01-23 18:40:39 +00:00
Henrik Levkowetz 57a4c9f41f Added 9 new group features, and changed list-like char fields to json fields, to get better support for using the values as lists. Modified code to use the group features instead of explicit lists of group types in many places in the code.
- Legacy-Id: 15908
2019-01-22 18:11:46 +00:00
Henrik Levkowetz a9fbea113b Changed incorrect use of 404 status code in api to 400. Fixes issue #2498.
- Legacy-Id: 15044
2018-04-13 11:11:48 +00:00
Henrik Levkowetz 6e5e50c78c Added an error message for missing email in extracted author information during automated draft submission.
- Legacy-Id: 14743
2018-03-07 16:42:57 +00:00
Henrik Levkowetz 26bf387356 Replaced direct assignment to m2m fields with .clear() and .set()
- Legacy-Id: 14666
2018-02-21 23:58:25 +00:00
Henrik Levkowetz ec02ed5cdd Removed case sensitivity in the submission API when comparing the submitter email address with the email addresses found in the draft. Fixes issue #2396.
- Legacy-Id: 14265
2017-11-01 13:47:12 +00:00
Henrik Levkowetz 437a622141 Set a temporary state 'confirmed' when handling submission confirmations in order to avoid running the confirmation code multiple times on multiple form submits.
- Legacy-Id: 14191
2017-10-07 13:34:14 +00:00
Henrik Levkowetz 7b2d921a5a Tweaked the submission search form to accept draft names which include revision numbers. Fixes issue #2380.
- Legacy-Id: 14171
2017-09-27 15:08:40 +00:00
Henrik Levkowetz 2d817427fc Added a cancel button to the submission confirmation page. Fixes issue #2379.
- Legacy-Id: 14170
2017-09-27 14:18:12 +00:00
Henrik Levkowetz d0583f4f02 Removed the repeat of the error message in the HTTP reason string. Fixes issue #2378.
- Legacy-Id: 14168
2017-09-27 11:03:25 +00:00