Inspired by django_mailbox, this app implements a management command
that sends a signal when an email is received.
Other apps can add receivers for that signal, to do their own processing of
inbound emails.
Differential D7325
Bootstrap a common app for management of inbound emails olasd on Mar 9 2022, 5:55 PM. Authored by
Details
Inspired by django_mailbox, this app implements a management command Other apps can add receivers for that signal, to do their own processing of for now, only the utility functions have tests, we need to add tests
Diff Detail
Event TimelineComment Actions Build is green Patch application report for D7325 (id=26498)Could not rebase; Attempt merge onto 51aa6fbc8e... Merge made by the 'recursive' strategy. swh/web/add_forge_now/__init__.py | 0 swh/web/add_forge_now/apps.py | 10 ++ swh/web/add_forge_now/migrations/0001_initial.py | 109 +++++++++++++++++++ swh/web/add_forge_now/migrations/__init__.py | 0 swh/web/add_forge_now/models.py | 71 +++++++++++++ swh/web/add_forge_now/tests/test_migration.py | 62 +++++++++++ swh/web/api/urls.py | 1 + swh/web/api/views/add_forge_now.py | 108 +++++++++++++++++++ swh/web/inbound_email/__init__.py | 0 swh/web/inbound_email/apps.py | 11 ++ .../management/commands/process_inbound_email.py | 73 +++++++++++++ swh/web/inbound_email/signals.py | 36 +++++++ swh/web/inbound_email/tests.py | 3 + swh/web/inbound_email/utils.py | 66 ++++++++++++ swh/web/settings/common.py | 2 + swh/web/tests/api/views/test_add_forge_now.py | 117 +++++++++++++++++++++ swh/web/tests/inbound_email/test_utils.py | 113 ++++++++++++++++++++ swh/web/tests/utils.py | 4 +- 18 files changed, 785 insertions(+), 1 deletion(-) create mode 100644 swh/web/add_forge_now/__init__.py create mode 100644 swh/web/add_forge_now/apps.py create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py create mode 100644 swh/web/add_forge_now/migrations/__init__.py create mode 100644 swh/web/add_forge_now/models.py create mode 100644 swh/web/add_forge_now/tests/test_migration.py create mode 100644 swh/web/api/views/add_forge_now.py create mode 100644 swh/web/inbound_email/__init__.py create mode 100644 swh/web/inbound_email/apps.py create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py create mode 100644 swh/web/inbound_email/signals.py create mode 100644 swh/web/inbound_email/tests.py create mode 100644 swh/web/inbound_email/utils.py create mode 100644 swh/web/tests/api/views/test_add_forge_now.py create mode 100644 swh/web/tests/inbound_email/test_utils.py Changes applied before testcommit bb8a3e00f8f2a24ac90bd7eec8673b33aa53d33f Merge: 51aa6fbc e49b4cee Author: Jenkins user <jenkins@localhost> Date: Wed Mar 9 16:56:22 2022 +0000 Merge branch 'diff-target' into HEAD commit e49b4cee5906f89629d6eb89bbceacdd7ba91cc7 Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 17:48:45 2022 +0100 inbound_email: add some logging statements for unhandled exceptions commit 889a84771fce10d5483de6cd5991d4feee9d1234 Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 16:37:54 2022 +0100 inbound_email: add utilities to extract and filter email recipients commit 1c00cc8a08add62f30468a26b1d8784d51b3a2ec Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 14:29:37 2022 +0100 Bootstrap a common app for management of inbound emails commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Tue Mar 8 15:23:50 2022 +0100 api: Add endpoint to create an add-forge request Related to T3990 commit 03101208803501e5178f35d18d171e740ee4ca76 Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Tue Mar 8 11:34:44 2022 +0100 add_forge_now: Bootstrap app and model See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1433/ for more details. Comment Actions Looks good, thanks. I have a few stylistic comments below
Comment Actions
Comment Actions Apply comments on utilities
Comment Actions Build is green Patch application report for D7325 (id=26545)Could not rebase; Attempt merge onto cdcc1efdfb... Merge made by the 'recursive' strategy. swh/web/add_forge_now/__init__.py | 0 swh/web/add_forge_now/apps.py | 10 + swh/web/add_forge_now/migrations/0001_initial.py | 109 +++++ swh/web/add_forge_now/migrations/__init__.py | 0 swh/web/add_forge_now/models.py | 99 +++++ swh/web/add_forge_now/tests/test_migration.py | 62 +++ swh/web/api/urls.py | 1 + swh/web/api/views/add_forge_now.py | 352 +++++++++++++++ swh/web/inbound_email/__init__.py | 0 swh/web/inbound_email/apps.py | 11 + .../management/commands/process_inbound_email.py | 73 +++ swh/web/inbound_email/signals.py | 36 ++ swh/web/inbound_email/utils.py | 66 +++ swh/web/settings/common.py | 2 + swh/web/tests/add_forge_now/test_models.py | 26 ++ swh/web/tests/api/views/test_add_forge_now.py | 489 +++++++++++++++++++++ .../tests/inbound_email/test_management_command.py | 161 +++++++ swh/web/tests/inbound_email/test_utils.py | 113 +++++ swh/web/tests/utils.py | 10 +- 19 files changed, 1617 insertions(+), 3 deletions(-) create mode 100644 swh/web/add_forge_now/__init__.py create mode 100644 swh/web/add_forge_now/apps.py create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py create mode 100644 swh/web/add_forge_now/migrations/__init__.py create mode 100644 swh/web/add_forge_now/models.py create mode 100644 swh/web/add_forge_now/tests/test_migration.py create mode 100644 swh/web/api/views/add_forge_now.py create mode 100644 swh/web/inbound_email/__init__.py create mode 100644 swh/web/inbound_email/apps.py create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py create mode 100644 swh/web/inbound_email/signals.py create mode 100644 swh/web/inbound_email/utils.py create mode 100644 swh/web/tests/add_forge_now/test_models.py create mode 100644 swh/web/tests/api/views/test_add_forge_now.py create mode 100644 swh/web/tests/inbound_email/test_management_command.py create mode 100644 swh/web/tests/inbound_email/test_utils.py Changes applied before testcommit c12311e306cb319a5e4762e89d91b653e9673cc9 Merge: cdcc1efd 67d393c0 Author: Jenkins user <jenkins@localhost> Date: Mon Mar 14 12:22:41 2022 +0000 Merge branch 'diff-target' into HEAD commit 67d393c0a3b221080af9b966729af73879353850 Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 16:37:54 2022 +0100 inbound_email: add utilities to extract and filter email recipients commit 99413db8665d649e7a598233e972f374d6856e93 Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 14:29:37 2022 +0100 Bootstrap a common app for management of inbound emails commit 26748e56ecce5877fce3a215eba06a19ebb8342f Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Thu Mar 10 14:09:36 2022 +0100 api: Add endpoint to get details about an add-forge request Related to T4030 commit 294a95c711bc40622c6d718afa2535f377b90dfc Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Wed Mar 9 16:30:06 2022 +0100 api: Add endpoint to list add-forge requests Related to T4027 commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Wed Mar 9 16:28:03 2022 +0100 api: Add endpoint to update an add-forge request Related to T4026 commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Tue Mar 8 15:23:50 2022 +0100 api: Add endpoint to create an add-forge request Related to T3990 commit 03101208803501e5178f35d18d171e740ee4ca76 Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Tue Mar 8 11:34:44 2022 +0100 add_forge_now: Bootstrap app and model See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1450/ for more details. Comment Actions Build is green Patch application report for D7325 (id=26546)Could not rebase; Attempt merge onto cdcc1efdfb... Merge made by the 'recursive' strategy. swh/web/add_forge_now/__init__.py | 0 swh/web/add_forge_now/apps.py | 10 + swh/web/add_forge_now/migrations/0001_initial.py | 109 +++++ swh/web/add_forge_now/migrations/__init__.py | 0 swh/web/add_forge_now/models.py | 99 +++++ swh/web/add_forge_now/tests/test_migration.py | 62 +++ swh/web/api/urls.py | 1 + swh/web/api/views/add_forge_now.py | 352 +++++++++++++++ swh/web/inbound_email/__init__.py | 0 swh/web/inbound_email/apps.py | 11 + .../management/commands/process_inbound_email.py | 73 +++ swh/web/inbound_email/signals.py | 36 ++ swh/web/inbound_email/utils.py | 64 +++ swh/web/settings/common.py | 2 + swh/web/tests/add_forge_now/test_models.py | 26 ++ swh/web/tests/api/views/test_add_forge_now.py | 489 +++++++++++++++++++++ .../tests/inbound_email/test_management_command.py | 161 +++++++ swh/web/tests/inbound_email/test_utils.py | 113 +++++ swh/web/tests/utils.py | 10 +- 19 files changed, 1615 insertions(+), 3 deletions(-) create mode 100644 swh/web/add_forge_now/__init__.py create mode 100644 swh/web/add_forge_now/apps.py create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py create mode 100644 swh/web/add_forge_now/migrations/__init__.py create mode 100644 swh/web/add_forge_now/models.py create mode 100644 swh/web/add_forge_now/tests/test_migration.py create mode 100644 swh/web/api/views/add_forge_now.py create mode 100644 swh/web/inbound_email/__init__.py create mode 100644 swh/web/inbound_email/apps.py create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py create mode 100644 swh/web/inbound_email/signals.py create mode 100644 swh/web/inbound_email/utils.py create mode 100644 swh/web/tests/add_forge_now/test_models.py create mode 100644 swh/web/tests/api/views/test_add_forge_now.py create mode 100644 swh/web/tests/inbound_email/test_management_command.py create mode 100644 swh/web/tests/inbound_email/test_utils.py Changes applied before testcommit 3aa73f3e7ddf6a1c99811b55ffb470f7c87fce9d Merge: cdcc1efd fe18e0ac Author: Jenkins user <jenkins@localhost> Date: Mon Mar 14 12:27:31 2022 +0000 Merge branch 'diff-target' into HEAD commit fe18e0acb4e4514c72a7eeed42e734f680a6453f Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 16:37:54 2022 +0100 inbound_email: add utilities to extract and filter email recipients commit 99413db8665d649e7a598233e972f374d6856e93 Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 14:29:37 2022 +0100 Bootstrap a common app for management of inbound emails commit 26748e56ecce5877fce3a215eba06a19ebb8342f Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Thu Mar 10 14:09:36 2022 +0100 api: Add endpoint to get details about an add-forge request Related to T4030 commit 294a95c711bc40622c6d718afa2535f377b90dfc Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Wed Mar 9 16:30:06 2022 +0100 api: Add endpoint to list add-forge requests Related to T4027 commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Wed Mar 9 16:28:03 2022 +0100 api: Add endpoint to update an add-forge request Related to T4026 commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Tue Mar 8 15:23:50 2022 +0100 api: Add endpoint to create an add-forge request Related to T3990 commit 03101208803501e5178f35d18d171e740ee4ca76 Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Tue Mar 8 11:34:44 2022 +0100 add_forge_now: Bootstrap app and model See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1451/ for more details. Comment Actions Build is green Patch application report for D7325 (id=26548)Could not rebase; Attempt merge onto cdcc1efdfb... Merge made by the 'recursive' strategy. swh/web/add_forge_now/__init__.py | 0 swh/web/add_forge_now/apps.py | 10 + swh/web/add_forge_now/migrations/0001_initial.py | 109 +++++ swh/web/add_forge_now/migrations/__init__.py | 0 swh/web/add_forge_now/models.py | 99 +++++ swh/web/add_forge_now/tests/test_migration.py | 62 +++ swh/web/api/urls.py | 1 + swh/web/api/views/add_forge_now.py | 352 +++++++++++++++ swh/web/inbound_email/__init__.py | 0 swh/web/inbound_email/apps.py | 11 + .../management/commands/process_inbound_email.py | 73 +++ swh/web/inbound_email/signals.py | 36 ++ swh/web/inbound_email/utils.py | 63 +++ swh/web/settings/common.py | 2 + swh/web/tests/add_forge_now/test_models.py | 26 ++ swh/web/tests/api/views/test_add_forge_now.py | 489 +++++++++++++++++++++ .../tests/inbound_email/test_management_command.py | 161 +++++++ swh/web/tests/inbound_email/test_utils.py | 113 +++++ swh/web/tests/utils.py | 10 +- 19 files changed, 1614 insertions(+), 3 deletions(-) create mode 100644 swh/web/add_forge_now/__init__.py create mode 100644 swh/web/add_forge_now/apps.py create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py create mode 100644 swh/web/add_forge_now/migrations/__init__.py create mode 100644 swh/web/add_forge_now/models.py create mode 100644 swh/web/add_forge_now/tests/test_migration.py create mode 100644 swh/web/api/views/add_forge_now.py create mode 100644 swh/web/inbound_email/__init__.py create mode 100644 swh/web/inbound_email/apps.py create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py create mode 100644 swh/web/inbound_email/signals.py create mode 100644 swh/web/inbound_email/utils.py create mode 100644 swh/web/tests/add_forge_now/test_models.py create mode 100644 swh/web/tests/api/views/test_add_forge_now.py create mode 100644 swh/web/tests/inbound_email/test_management_command.py create mode 100644 swh/web/tests/inbound_email/test_utils.py Changes applied before testcommit 34102c186708b7f1ea178889514953ab41941a3d Merge: cdcc1efd 531a8bd0 Author: Jenkins user <jenkins@localhost> Date: Mon Mar 14 12:36:02 2022 +0000 Merge branch 'diff-target' into HEAD commit 531a8bd04ad6bc938a66565f0d146da08b172eeb Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 16:37:54 2022 +0100 inbound_email: add utilities to extract and filter email recipients commit 99413db8665d649e7a598233e972f374d6856e93 Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 14:29:37 2022 +0100 Bootstrap a common app for management of inbound emails commit 26748e56ecce5877fce3a215eba06a19ebb8342f Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Thu Mar 10 14:09:36 2022 +0100 api: Add endpoint to get details about an add-forge request Related to T4030 commit 294a95c711bc40622c6d718afa2535f377b90dfc Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Wed Mar 9 16:30:06 2022 +0100 api: Add endpoint to list add-forge requests Related to T4027 commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Wed Mar 9 16:28:03 2022 +0100 api: Add endpoint to update an add-forge request Related to T4026 commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Tue Mar 8 15:23:50 2022 +0100 api: Add endpoint to create an add-forge request Related to T3990 commit 03101208803501e5178f35d18d171e740ee4ca76 Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Tue Mar 8 11:34:44 2022 +0100 add_forge_now: Bootstrap app and model See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1452/ for more details.
Comment Actions Build is green Patch application report for D7325 (id=26595)Could not rebase; Attempt merge onto 627ba79a1d... Merge made by the 'recursive' strategy. swh/web/add_forge_now/__init__.py | 0 swh/web/add_forge_now/apps.py | 10 + swh/web/add_forge_now/migrations/0001_initial.py | 109 +++++ swh/web/add_forge_now/migrations/__init__.py | 0 swh/web/add_forge_now/models.py | 99 +++++ swh/web/add_forge_now/tests/test_migration.py | 62 +++ swh/web/add_forge_now/views.py | 87 ++++ swh/web/api/urls.py | 1 + swh/web/api/views/add_forge_now.py | 355 +++++++++++++++ swh/web/auth/utils.py | 1 + swh/web/inbound_email/__init__.py | 0 swh/web/inbound_email/apps.py | 11 + .../management/commands/process_inbound_email.py | 73 ++++ swh/web/inbound_email/signals.py | 36 ++ swh/web/inbound_email/utils.py | 63 +++ swh/web/settings/common.py | 2 + swh/web/tests/add_forge_now/test_models.py | 26 ++ swh/web/tests/add_forge_now/test_views.py | 203 +++++++++ swh/web/tests/api/views/test_add_forge_now.py | 483 +++++++++++++++++++++ swh/web/tests/conftest.py | 12 +- .../tests/inbound_email/test_management_command.py | 161 +++++++ swh/web/tests/inbound_email/test_utils.py | 113 +++++ swh/web/tests/utils.py | 10 +- swh/web/urls.py | 1 + 24 files changed, 1914 insertions(+), 4 deletions(-) create mode 100644 swh/web/add_forge_now/__init__.py create mode 100644 swh/web/add_forge_now/apps.py create mode 100644 swh/web/add_forge_now/migrations/0001_initial.py create mode 100644 swh/web/add_forge_now/migrations/__init__.py create mode 100644 swh/web/add_forge_now/models.py create mode 100644 swh/web/add_forge_now/tests/test_migration.py create mode 100644 swh/web/add_forge_now/views.py create mode 100644 swh/web/api/views/add_forge_now.py create mode 100644 swh/web/inbound_email/__init__.py create mode 100644 swh/web/inbound_email/apps.py create mode 100644 swh/web/inbound_email/management/commands/process_inbound_email.py create mode 100644 swh/web/inbound_email/signals.py create mode 100644 swh/web/inbound_email/utils.py create mode 100644 swh/web/tests/add_forge_now/test_models.py create mode 100644 swh/web/tests/add_forge_now/test_views.py create mode 100644 swh/web/tests/api/views/test_add_forge_now.py create mode 100644 swh/web/tests/inbound_email/test_management_command.py create mode 100644 swh/web/tests/inbound_email/test_utils.py Changes applied before testcommit e5727a5a6efc41e310b1035e4fd2bdef193a1b31 Merge: 627ba79a ca39b06c Author: Jenkins user <jenkins@localhost> Date: Wed Mar 16 12:58:34 2022 +0000 Merge branch 'diff-target' into HEAD commit ca39b06c46ba42f73f898377d3093299ea21a85a Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 16:37:54 2022 +0100 inbound_email: add utilities to extract and filter email recipients commit bf099ce9654d0b765f0820189857ab7c7beb6c6b Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 9 14:29:37 2022 +0100 Bootstrap a common app for management of inbound emails commit b6d540d2e5fafe04eb71d3b1d8f5c194dafcbb62 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Tue Mar 15 15:06:10 2022 +0100 add_forge_now: Move datatables listing in dedicated endpoint Merging datatables special processing in /api/1/add-forge/request/list endpoint implementation was quite disturbing. So better using a dedicated endpoint for that in a similar manner as with save code now requests listing. The endpoint to use with datatables is now the following one: /add-forge/request/list/datatables. Related to T3989 Related to T3991 commit f6343395310bc226a50a283c88304006e8ece337 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Mon Mar 14 15:35:17 2022 +0100 api/add_forge_now: Allow to use requests list endpoint with datatables datatables is the javascript library we use on the frontend side to display interactive tables. As we use server-side processing, table data must be provided in a paginated way by an HTTP endpoint. Response format expected by datatables is different from the one returned by the Web API endpoint listing add-forge requests. So adapt the response format of that endpoint when we know the input request has been sent by datatables. Related to T3989 Related to T3991 commit 26748e56ecce5877fce3a215eba06a19ebb8342f Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Thu Mar 10 14:09:36 2022 +0100 api: Add endpoint to get details about an add-forge request Related to T4030 commit 294a95c711bc40622c6d718afa2535f377b90dfc Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Wed Mar 9 16:30:06 2022 +0100 api: Add endpoint to list add-forge requests Related to T4027 commit 1bf17d6a75fd7265b1da9c9e87220efa62869c93 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Wed Mar 9 16:28:03 2022 +0100 api: Add endpoint to update an add-forge request Related to T4026 commit 130e9faa9bcab18bc3c76dc898546edb89f3f9b8 Author: Antoine Lambert <anlambert@softwareheritage.org> Date: Tue Mar 8 15:23:50 2022 +0100 api: Add endpoint to create an add-forge request Related to T3990 commit 03101208803501e5178f35d18d171e740ee4ca76 Author: Antoine R. Dumont (@ardumont) <ardumont@softwareheritage.org> Date: Tue Mar 8 11:34:44 2022 +0100 add_forge_now: Bootstrap app and model See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1465/ for more details. |