From f642a18f4178051c8aa53b845a394cda80d765bb Mon Sep 17 00:00:00 2001 From: MJedr Date: Tue, 24 Oct 2023 16:59:56 +0200 Subject: [PATCH] add ticket_url to extra_data --- .github/workflows/backend-tests-on-docker.yml | 3 ++- inspirehep/modules/search/bundles.py | 2 +- inspirehep/modules/workflows/tasks/submission.py | 4 +++- tests/integration/workflows/test_workflow_tasks_submission.py | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/backend-tests-on-docker.yml b/.github/workflows/backend-tests-on-docker.yml index 1a4099dfc1..0fe3091cf9 100644 --- a/.github/workflows/backend-tests-on-docker.yml +++ b/.github/workflows/backend-tests-on-docker.yml @@ -73,7 +73,8 @@ jobs: --ignore tests/integration/workflows/test_workflows_tasks_upload.py \ --ignore tests/integration/workflows/test_arxiv_workflow.py \ --ignore tests/integration/workflows/test_edit_article.py \ - --ignore tests/integration/workflows/test_views.py + --ignore tests/integration/workflows/test_views.py \ + --ignore tests/integration/workflows/test_workflow_tasks_submission Workflows-II: runs-on: ubuntu-latest diff --git a/inspirehep/modules/search/bundles.py b/inspirehep/modules/search/bundles.py index bd390ea2ee..a2a0424858 100644 --- a/inspirehep/modules/search/bundles.py +++ b/inspirehep/modules/search/bundles.py @@ -34,6 +34,6 @@ npm={ 'invenio-search-js': '~1.4.0', 'angular-loading-bar': '~0.9.0', - 'inspire-next-search-js': '~2.0.83' + 'inspire-next-search-js': '~2.0.84' }, ) diff --git a/inspirehep/modules/workflows/tasks/submission.py b/inspirehep/modules/workflows/tasks/submission.py index a416963679..1eeab9468b 100644 --- a/inspirehep/modules/workflows/tasks/submission.py +++ b/inspirehep/modules/workflows/tasks/submission.py @@ -95,9 +95,11 @@ def submit_snow_ticket(obj, queue, template, context, caller, recid, ticket_id_k data=json.dumps(ticket_payload), ) response.raise_for_status() - ticket_id = response.json()["ticket_id"] + response_json = response.json() + ticket_id = response_json["ticket_id"] obj.extra_data[ticket_id_key] = ticket_id + obj.extra_data["ticket_url"] = response_json["ticket_url"] obj.log.info("Ticket {0} created".format(ticket_id)) return ticket_id diff --git a/tests/integration/workflows/test_workflow_tasks_submission.py b/tests/integration/workflows/test_workflow_tasks_submission.py index 1d65e4b08a..59153325e6 100644 --- a/tests/integration/workflows/test_workflow_tasks_submission.py +++ b/tests/integration/workflows/test_workflow_tasks_submission.py @@ -104,7 +104,7 @@ def test_create_ticket_calls_tickets_create_with_template(workflow_app): request_mocker.register_uri( "POST", "http://web:8000/tickets/create-with-template", - json={"ticket_id": "123"}, + json={"ticket_id": "123", "ticket_url": "http//test.com/1"}, headers=_get_headers_for_hep_root_table_request(), status_code=200, )