Details
- Reviewers
vlorentz anlambert ardumont - Group Reviewers
Reviewers - Maniphest Tasks
- T3998: [Add forge now] Change request status
T3988: [Add forge now] Create Help text tab
T3989: [Add forge now] Create "browse add requests" tab
T3997: [Add forge now] Deny request
T4012: [Add forge now] Create a message panel for non logged user - Commits
- rDWAPPS6c96f964adc7: Create "Add forge now" request
Diff Detail
- Repository
- rDWAPPS Web applications
- Branch
- sprint-add-forge-now
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 27490 Build 43016: Phabricator diff pipeline on jenkins Jenkins console · Jenkins Build 43015: arc lint + arc unit
Event Timeline
assets/src/bundles/add_forge/create-request.js | ||
---|---|---|
10–28 | @anlambert I've not used csrfPost here. form.serialize is giving a urlencoded request body. Let me know if we have to change this |
Build is green
Patch application report for D7357 (id=26594)
Could not rebase; Attempt merge onto 627ba79a1d...
Merge made by the 'recursive' strategy. assets/src/bundles/add_forge/create-request.js | 74 ++++ assets/src/bundles/add_forge/index.js | 10 + .../add-forge-now-request-create.spec.js | 139 ++++++ 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 | 107 +++++ swh/web/api/urls.py | 1 + swh/web/api/views/add_forge_now.py | 355 +++++++++++++++ swh/web/auth/utils.py | 1 + swh/web/settings/common.py | 1 + .../templates/add_forge_now/create-request.html | 234 ++++++++++ swh/web/templates/layout.html | 6 + 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 +- swh/web/tests/utils.py | 10 +- swh/web/urls.py | 1 + 22 files changed, 1939 insertions(+), 4 deletions(-) create mode 100644 assets/src/bundles/add_forge/create-request.js create mode 100644 assets/src/bundles/add_forge/index.js create mode 100644 cypress/integration/add-forge-now-request-create.spec.js 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/templates/add_forge_now/create-request.html 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
Changes applied before test
commit f99bb4bd1d4f80dc93e9ca438b67ce62b157e420 Merge: 627ba79a 5c4c7714 Author: Jenkins user <jenkins@localhost> Date: Wed Mar 16 12:46:46 2022 +0000 Merge branch 'diff-target' into HEAD commit 5c4c7714b67d450d967d38fde23275e218f43db6 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed Mar 16 13:44:35 2022 +0100 Create form for "Add forge now" "add forge now" request creation form Browse 'add forge now' requests tab Url and view module for "add forge now" JS files for "add forge now" bundle cypress tests Related to T3998 Related to T3989 Related to T4012 Related to T3988 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/1464/ for more details.
When JS is disabled, submitting the form leads to a "ImproperlyConfigured: Returned a template response with no template_name attribute set on either the view or response".
This is an issue on the server side, but I don't see how we can fix it properly.
assets/src/bundles/add_forge/create-request.js | ||
---|---|---|
28–31 | if the response's Content-Type is application/json, parse responseText instead of showing "Sorry; an error occurred" followed by a dump of the content. Typically, it has this format: {"exception":"BadInputExc","reason":"{\"forge_contact_comment\": [\"This field is required.\"]}"} | |
swh/web/templates/add_forge_now/create-request.html | ||
68–70 |
swh/web/templates/add_forge_now/create-request.html | ||
---|---|---|
142–146 | I know this was already discussed a lot, but I find it really weird to hide this help text behind a "For more information" link. I think we should just show the help text directly. |
Build has FAILED
Patch application report for D7357 (id=26607)
Could not rebase; Attempt merge onto 627ba79a1d...
Updating 627ba79a..9d68306b Fast-forward assets/src/bundles/add_forge/create-request.js | 91 ++++ assets/src/bundles/add_forge/index.js | 10 + .../add-forge-now-request-create.spec.js | 139 ++++++ 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 | 107 +++++ 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 + .../templates/add_forge_now/create-request.html | 234 ++++++++++ swh/web/templates/layout.html | 6 + 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 + 29 files changed, 2414 insertions(+), 4 deletions(-) create mode 100644 assets/src/bundles/add_forge/create-request.js create mode 100644 assets/src/bundles/add_forge/index.js create mode 100644 cypress/integration/add-forge-now-request-create.spec.js 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/templates/add_forge_now/create-request.html 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 test
commit 9d68306bbfb95ba7cd1ece36b02088570dd8c231 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed Mar 16 14:35:11 2022 +0100 Create form for "Add forge now" "add forge now" request creation form Browse 'add forge now' requests tab Url and view module for "add forge now" JS files for "add forge now" bundle cypress tests Related to T3998 Related to T3989 Related to T4012 Related to T3988 commit c24e6822a1569817b6d970fbc550cdf66f2188f0 Merge: ca39b06c 627ba79a Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 16 14:20:52 2022 +0100 Merge branch 'master' into sprint-add-forge-now 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
Link to build: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1466/
See console output for more information: https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/1466/console
I updated with the JS fix.
Having different routes is an option.
But I feel we need to handle this with better JS technologies.
swh/web/templates/add_forge_now/create-request.html | ||
---|---|---|
142–146 | Please, just keep that for now, as you said it's been discussed. It should be simple enough to drop it later if we don't want to keep that. So let's focus on landing this soon so we can continue on the next views. |
I updated with the JS fix.
It still does not interact well with browser history
But I feel we need to handle this with better JS technologies.
Why?
assets/src/bundles/add_forge/create-request.js | ||
---|---|---|
28–31 | Most important fix prior to this diff landing. The rest we can improve later on (including the browse link in js or not). |
Build is green
Patch application report for D7357 (id=26607)
Could not rebase; Attempt merge onto 627ba79a1d...
Updating 627ba79a..9d68306b Fast-forward assets/src/bundles/add_forge/create-request.js | 91 ++++ assets/src/bundles/add_forge/index.js | 10 + .../add-forge-now-request-create.spec.js | 139 ++++++ 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 | 107 +++++ 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 + .../templates/add_forge_now/create-request.html | 234 ++++++++++ swh/web/templates/layout.html | 6 + 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 + 29 files changed, 2414 insertions(+), 4 deletions(-) create mode 100644 assets/src/bundles/add_forge/create-request.js create mode 100644 assets/src/bundles/add_forge/index.js create mode 100644 cypress/integration/add-forge-now-request-create.spec.js 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/templates/add_forge_now/create-request.html 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 test
commit 9d68306bbfb95ba7cd1ece36b02088570dd8c231 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed Mar 16 14:35:11 2022 +0100 Create form for "Add forge now" "add forge now" request creation form Browse 'add forge now' requests tab Url and view module for "add forge now" JS files for "add forge now" bundle cypress tests Related to T3998 Related to T3989 Related to T4012 Related to T3988 commit c24e6822a1569817b6d970fbc550cdf66f2188f0 Merge: ca39b06c 627ba79a Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 16 14:20:52 2022 +0100 Merge branch 'master' into sprint-add-forge-now 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/1467/ for more details.
The biggest issue with our JS is, it is dealing directly with the DOM elements.
It always get complicated after a while.
Virtual dom is an alternative. https://reactjs.org/docs/faq-internals.html
You just manage a data structure, and it manages your view.
So a tab change will be about changing a variable to true and false
React (or any virtual DOM) is waaaay overkill, when two HTML pages would work perfectly for our needs.
Build is green
Patch application report for D7357 (id=26609)
Could not rebase; Attempt merge onto 627ba79a1d...
Updating 627ba79a..cb076df6 Fast-forward assets/src/bundles/add_forge/create-request.js | 91 ++++ assets/src/bundles/add_forge/index.js | 10 + .../add-forge-now-request-create.spec.js | 139 ++++++ 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 | 107 +++++ 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 + .../templates/add_forge_now/create-request.html | 234 ++++++++++ swh/web/templates/layout.html | 6 + 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 + 29 files changed, 2414 insertions(+), 4 deletions(-) create mode 100644 assets/src/bundles/add_forge/create-request.js create mode 100644 assets/src/bundles/add_forge/index.js create mode 100644 cypress/integration/add-forge-now-request-create.spec.js 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/templates/add_forge_now/create-request.html 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 test
commit cb076df6aebf7a931f8b556651da9c500a2f1053 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed Mar 16 14:54:40 2022 +0100 Create form for "Add forge now" "add forge now" request creation form Browse 'add forge now' requests tab Url and view module for "add forge now" JS files for "add forge now" bundle cypress tests Related to T3998 Related to T3989 Related to T4012 Related to T3988 commit c24e6822a1569817b6d970fbc550cdf66f2188f0 Merge: ca39b06c 627ba79a Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 16 14:20:52 2022 +0100 Merge branch 'master' into sprint-add-forge-now 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/1468/ for more details.
Why do you think a virtual DOM an overkill, when we already have a lot of hard to manage JS?
Either we make full server rendered pages, or we use a full JS client
Here, we are hitting back to the same server, that already had all the data we need, with JS to fetch data.
Isn't that an anti pattern?
assets/src/bundles/add_forge/create-request.js | ||
---|---|---|
10–28 | You can pass request headers as second parameter of csrfPost, use it like this (just tested and it worked) const response = await csrfPost($(this).attr('action'), {'Content-Type': 'application/x-www-form-urlencoded'}, $(this).serialize()); | |
56 | s/populateRequesBrowseList/populateRequestsBrowseList/ |
Build is green
Patch application report for D7357 (id=26610)
Could not rebase; Attempt merge onto 627ba79a1d...
Updating 627ba79a..1ad86781 Fast-forward assets/src/bundles/add_forge/create-request.js | 91 ++++ assets/src/bundles/add_forge/index.js | 10 + .../add-forge-now-request-create.spec.js | 139 ++++++ 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 | 107 +++++ 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 + .../templates/add_forge_now/create-request.html | 234 ++++++++++ swh/web/templates/layout.html | 6 + 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 + 29 files changed, 2414 insertions(+), 4 deletions(-) create mode 100644 assets/src/bundles/add_forge/create-request.js create mode 100644 assets/src/bundles/add_forge/index.js create mode 100644 cypress/integration/add-forge-now-request-create.spec.js 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/templates/add_forge_now/create-request.html 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 test
commit 1ad86781ccc32c45d357e063f1d89ad660aee4f1 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed Mar 16 15:04:24 2022 +0100 Create form for "Add forge now" "add forge now" request creation form Browse 'add forge now' requests tab Url and view module for "add forge now" JS files for "add forge now" bundle cypress tests Related to T3998 Related to T3989 Related to T4012 Related to T3988 commit c24e6822a1569817b6d970fbc550cdf66f2188f0 Merge: ca39b06c 627ba79a Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 16 14:20:52 2022 +0100 Merge branch 'master' into sprint-add-forge-now 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/1469/ for more details.
I'd rather have the former. I know but already have many pages that depend on JS; and I think adding more is a step in the wrong direction.
Here, we are hitting back to the same server, that already had all the data we need, with JS to fetch data.
Isn't that an anti pattern?
I don't understand the difference. Using separate HTML pages provides the same features (reload, history, cache) with less code.
assets/src/bundles/add_forge/create-request.js | ||
---|---|---|
52 | Add the following event handler to witch tab when URL fragment changed: $(window).on('hashchange', () => { if (window.location.hash === '#browse-requests') { $('.nav-tabs a[href="#swh-add-forge-requests-list"]').tab('show'); } else { $('.nav-tabs a[href="#swh-add-forge-submit-request"]').tab('show'); } }); |
I agree, but it is super hard to ignore JS. So, I suggest doing it in the modern/less complex way :).
Here, we are hitting back to the same server, that already had all the data we need, with JS to fetch data.
Isn't that an anti pattern?I don't understand the difference. Using separate HTML pages provides the same features (reload, history, cache) with less code.
My comment was about the general scenario. In this case rendering from server will not make any big difference
(Other than the user feeling a bit lost, as reload will always move the focus to the very top)
Build is green
Patch application report for D7357 (id=26612)
Could not rebase; Attempt merge onto 627ba79a1d...
Updating 627ba79a..2e15f2ef Fast-forward assets/src/bundles/add_forge/create-request.js | 87 ++++ assets/src/bundles/add_forge/index.js | 10 + .../add-forge-now-request-create.spec.js | 139 ++++++ 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 | 107 +++++ 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 + .../templates/add_forge_now/create-request.html | 234 ++++++++++ swh/web/templates/layout.html | 6 + 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 + 29 files changed, 2410 insertions(+), 4 deletions(-) create mode 100644 assets/src/bundles/add_forge/create-request.js create mode 100644 assets/src/bundles/add_forge/index.js create mode 100644 cypress/integration/add-forge-now-request-create.spec.js 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/templates/add_forge_now/create-request.html 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 test
commit 2e15f2efe5083eeb2d8660d02fdfbf30163632ba Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed Mar 16 15:34:07 2022 +0100 Create form for "Add forge now" "add forge now" request creation form Browse 'add forge now' requests tab Url and view module for "add forge now" JS files for "add forge now" bundle cypress tests Related to T3998 Related to T3989 Related to T4012 Related to T3988 commit c24e6822a1569817b6d970fbc550cdf66f2188f0 Merge: ca39b06c 627ba79a Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 16 14:20:52 2022 +0100 Merge branch 'master' into sprint-add-forge-now 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/1471/ for more details.
I'm not saying we should ignore JS entirely (eg. it's completely fine to use Datatables). I don't agree using Django + React is less complex than just Django.
But anyway, let's keep this discussion for later.
Build is green
Patch application report for D7357 (id=26613)
Could not rebase; Attempt merge onto 627ba79a1d...
Updating 627ba79a..80854e98 Fast-forward assets/src/bundles/add_forge/create-request.js | 87 ++++ assets/src/bundles/add_forge/index.js | 10 + .../add-forge-now-request-create.spec.js | 139 ++++++ 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 | 107 +++++ 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 + .../templates/add_forge_now/create-request.html | 234 ++++++++++ swh/web/templates/layout.html | 6 + 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 + 29 files changed, 2410 insertions(+), 4 deletions(-) create mode 100644 assets/src/bundles/add_forge/create-request.js create mode 100644 assets/src/bundles/add_forge/index.js create mode 100644 cypress/integration/add-forge-now-request-create.spec.js 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/templates/add_forge_now/create-request.html 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 test
commit 80854e982167b42ca1a52c8de5d3cebaed7d60e2 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed Mar 16 15:37:43 2022 +0100 Create form for "Add forge now" "add forge now" request creation form Browse 'add forge now' requests tab Url and view module for "add forge now" JS files for "add forge now" bundle cypress tests Related to T3998 Related to T3989 Related to T4012 Related to T3988 commit c24e6822a1569817b6d970fbc550cdf66f2188f0 Merge: ca39b06c 627ba79a Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 16 14:20:52 2022 +0100 Merge branch 'master' into sprint-add-forge-now 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/1472/ for more details.
You miss one of my inline comment to handle tabs switch when playing with browser history.
Add the following event handler to switch tab when URL fragment changed:
$(window).on('hashchange', () => { if (window.location.hash === '#browse-requests') { $('.nav-tabs a[href="#swh-add-forge-requests-list"]').tab('show'); } else { $('.nav-tabs a[href="#swh-add-forge-submit-request"]').tab('show'); } });
I also added a last batch of nitpick comments;
Last but not least, the commit message should be improved by detailing the newly introduced features
with proper sentences. Simply enumerating the new files being added is not really relevant as we
can have the info by looking at the diff of the git commit.
swh/web/add_forge_now/views.py | ||
---|---|---|
105 | You can remove the trailing slash here. | |
swh/web/templates/add_forge_now/create-request.html | ||
56 | Remove the here word. |
Build is green
Patch application report for D7357 (id=26623)
Could not rebase; Attempt merge onto 39bab96e9f...
Merge made by the 'recursive' strategy. assets/src/bundles/add_forge/create-request.js | 88 ++++ assets/src/bundles/add_forge/index.js | 10 + .../add-forge-now-request-create.spec.js | 139 ++++++ 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 | 107 +++++ 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 + .../templates/add_forge_now/create-request.html | 234 ++++++++++ swh/web/templates/layout.html | 6 + 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 + 29 files changed, 2411 insertions(+), 4 deletions(-) create mode 100644 assets/src/bundles/add_forge/create-request.js create mode 100644 assets/src/bundles/add_forge/index.js create mode 100644 cypress/integration/add-forge-now-request-create.spec.js 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/templates/add_forge_now/create-request.html 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 test
commit 5f09a741fcae5ebc720a8787426faa879fa45856 Merge: 39bab96e 654ffaf6 Author: Jenkins user <jenkins@localhost> Date: Wed Mar 16 17:12:54 2022 +0000 Merge branch 'diff-target' into HEAD commit 654ffaf6ae69fdb1b1dec84388b5a97520c63cc6 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Wed Mar 16 18:09:46 2022 +0100 Create "Add forge now" request Added a form to submit an "add forge now" request. Left menus changed to include "add forge now" page. Possbility to browse existing requests is added in a seperate tab in the same view. Cypress tests Related to T3998 Related to T3989 Related to T4012 Related to T3988 commit 80e55b0a12eb27a5df72acf6fe07640db12eaf27 Merge: c24e6822 9f2e1cb9 Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 16 16:21:35 2022 +0100 Merge branch 'master' into sprint-add-forge-now commit c24e6822a1569817b6d970fbc550cdf66f2188f0 Merge: ca39b06c 627ba79a Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 16 14:20:52 2022 +0100 Merge branch 'master' into sprint-add-forge-now 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/1476/ for more details.
I added another round of comments to handle before landing this. I will accept the diff afterwards.
assets/src/bundles/add_forge/create-request.js | ||
---|---|---|
12–18 | this should be moved at the end of the function, close to the code related to the history navigation features. | |
12–50 | it would be safer to wrap that code in a $(document).ready(() => {}) block. | |
54–87 | The DataTable instance should be created once and put in a variable global to that file. Then to update the table, simply call myTable.draw(); |
assets/src/bundles/add_forge/create-request.js | ||
---|---|---|
12–50 | I agree and moved all the event listeners inside the document ready function. |
Build is green
Patch application report for D7357 (id=26629)
Could not rebase; Attempt merge onto 39bab96e9f...
Merge made by the 'recursive' strategy. assets/src/bundles/add_forge/create-request.js | 92 ++++ assets/src/bundles/add_forge/index.js | 10 + .../add-forge-now-request-create.spec.js | 139 ++++++ 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 | 107 +++++ 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 + .../templates/add_forge_now/create-request.html | 234 ++++++++++ swh/web/templates/layout.html | 6 + 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 + 29 files changed, 2415 insertions(+), 4 deletions(-) create mode 100644 assets/src/bundles/add_forge/create-request.js create mode 100644 assets/src/bundles/add_forge/index.js create mode 100644 cypress/integration/add-forge-now-request-create.spec.js 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/templates/add_forge_now/create-request.html 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 test
commit 88aa1fcf6377cb876ae158d3ba99a8f24c8f61d3 Merge: 39bab96e 6c96f964 Author: Jenkins user <jenkins@localhost> Date: Thu Mar 17 10:35:28 2022 +0000 Merge branch 'diff-target' into HEAD commit 6c96f964adc7ffb7e9ea32de6d240a6a45bd8b97 Author: Jayesh Velayudhan <jayesh@softwareheritage.org> Date: Thu Mar 17 11:33:57 2022 +0100 Create "Add forge now" request Added a form to submit an "add forge now" request. Left menus changed to include "add forge now" page. Possbility to browse existing requests is added in a seperate tab in the same view. Cypress tests Related to T3998 Related to T3989 Related to T4012 Related to T3988 commit 80e55b0a12eb27a5df72acf6fe07640db12eaf27 Merge: c24e6822 9f2e1cb9 Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 16 16:21:35 2022 +0100 Merge branch 'master' into sprint-add-forge-now commit c24e6822a1569817b6d970fbc550cdf66f2188f0 Merge: ca39b06c 627ba79a Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Mar 16 14:20:52 2022 +0100 Merge branch 'master' into sprint-add-forge-now 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/1482/ for more details.