From 85557dbb752061fd2dccd7b5a5970ec670391684 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 17 Jul 2024 13:07:40 -0700 Subject: [PATCH 01/12] put all of csv file in one line --- app/commands.py | 6 ++++-- poetry.lock | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/commands.py b/app/commands.py index c97a2f774..cdf84ee91 100644 --- a/app/commands.py +++ b/app/commands.py @@ -597,8 +597,10 @@ def download_csv_file_by_name(csv_filename): access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"] secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"] region = current_app.config["CSV_UPLOAD_BUCKET"]["region"] - print(s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region)) - + content = s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region) + # We want it all to get logged in one line + content = content.replace("\n", "|") + print(content) @notify_command(name="populate-annual-billing-with-the-previous-years-allowance") @click.option( diff --git a/poetry.lock b/poetry.lock index c6de7033d..9b23a4db8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2098,13 +2098,9 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2493,6 +2489,7 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, + {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -3475,7 +3472,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, From 7600699e23a9039333daa5da24c8f7745ff897d0 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 18 Jul 2024 07:39:01 -0700 Subject: [PATCH 02/12] fix flake8 --- app/commands.py | 1 + 1 file changed, 1 insertion(+) diff --git a/app/commands.py b/app/commands.py index cdf84ee91..c10327108 100644 --- a/app/commands.py +++ b/app/commands.py @@ -602,6 +602,7 @@ def download_csv_file_by_name(csv_filename): content = content.replace("\n", "|") print(content) + @notify_command(name="populate-annual-billing-with-the-previous-years-allowance") @click.option( "-y", From 86c9065a440d1aacb3004187694a3b0bc4cbd0c8 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 23 Jul 2024 07:47:35 -0700 Subject: [PATCH 03/12] use click.echo --- app/commands.py | 6 ++---- docs/all.md | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/commands.py b/app/commands.py index c10327108..cca20d626 100644 --- a/app/commands.py +++ b/app/commands.py @@ -590,7 +590,7 @@ def process_row_from_job(job_id, job_row_number): @notify_command(name="download-csv-file-by-name") -@click.option("-f", "--csv_filename", required=True, help="csv file name") +@click.argument("csv_filename") def download_csv_file_by_name(csv_filename): bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"] @@ -598,9 +598,7 @@ def download_csv_file_by_name(csv_filename): secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"] region = current_app.config["CSV_UPLOAD_BUCKET"]["region"] content = s3.get_s3_file(bucket_name, csv_filename, access_key, secret, region) - # We want it all to get logged in one line - content = content.replace("\n", "|") - print(content) + click.echo(content) @notify_command(name="populate-annual-billing-with-the-previous-years-allowance") diff --git a/docs/all.md b/docs/all.md index d98f0d336..3b1c999d2 100644 --- a/docs/all.md +++ b/docs/all.md @@ -1349,7 +1349,7 @@ cf run-task notify-api-production --command "flask command download-csv-file-by- locally, just do: ``` -poetry run flask command download-csv-file-by-name -f +poetry run flask command download-csv-file-by-name ``` ## Debug steps From bd75e30f96729d955bc884248b24d387722228c1 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 1 Aug 2024 08:19:33 -0700 Subject: [PATCH 04/12] add test --- tests/app/test_commands.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/app/test_commands.py b/tests/app/test_commands.py index 7eee00bbf..7b4885660 100644 --- a/tests/app/test_commands.py +++ b/tests/app/test_commands.py @@ -8,6 +8,7 @@ from app.commands import ( bulk_invite_user_to_service, create_new_service, create_test_user, + download_csv_file_by_name, fix_billable_units, insert_inbound_numbers_from_file, populate_annual_billing_with_defaults, @@ -427,6 +428,22 @@ def test_promote_user_to_platform_admin( assert user.platform_admin is True +def test_download_csv_file_by_name( + notify_api, sample_platform_admin +): + assert sample_platform_admin.platform_admin is True + + result = notify_api.test_cli_runner().invoke( + download_csv_file_by_name, + [ + "NonExistentName", + ], + ) + + print(result) + assert result == '404' + + def test_promote_user_to_platform_admin_no_result_found( notify_db_session, notify_api, sample_user ): From 4299b46f8a110878e05502aca493311fcd5d6c0c Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 1 Aug 2024 09:23:26 -0700 Subject: [PATCH 05/12] fix test --- app/aws/s3.py | 11 ++++++++--- tests/app/test_commands.py | 9 ++++----- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/aws/s3.py b/app/aws/s3.py index 7886b8f3a..189c6b4a9 100644 --- a/app/aws/s3.py +++ b/app/aws/s3.py @@ -104,15 +104,20 @@ def download_from_s3( region_name=region, ) s3 = session.client("s3", config=AWS_CLIENT_CONFIG) + result = None try: - s3.download_file(bucket_name, s3_key, local_filename) + result = s3.download_file(bucket_name, s3_key, local_filename) print(f"File downloaded successfully to {local_filename}") - except botocore.exceptions.NoCredentialsError: + except botocore.exceptions.NoCredentialsError as nce: print("Credentials not found") - except botocore.exceptions.PartialCredentialsError: + raise Exception(nce) + except botocore.exceptions.PartialCredentialsError as pce: print("Incomplete credentials provided") + raise Exception(pce) except Exception as e: print(f"An error occurred {e}") + raise Exception(e) + return result def get_s3_object(bucket_name, file_location, access_key, secret_key, region): diff --git a/tests/app/test_commands.py b/tests/app/test_commands.py index 7b4885660..817f2e4bf 100644 --- a/tests/app/test_commands.py +++ b/tests/app/test_commands.py @@ -428,9 +428,7 @@ def test_promote_user_to_platform_admin( assert user.platform_admin is True -def test_download_csv_file_by_name( - notify_api, sample_platform_admin -): +def test_download_csv_file_by_name(notify_api, sample_platform_admin): assert sample_platform_admin.platform_admin is True result = notify_api.test_cli_runner().invoke( @@ -440,8 +438,9 @@ def test_download_csv_file_by_name( ], ) - print(result) - assert result == '404' + # if we get a 404, it means that the file is not in s3 (of course) + # but we are making the call to s3, etc. so that part is working + assert "404" in str(result) def test_promote_user_to_platform_admin_no_result_found( From b5014bd0ec0ae5844acea47bcb1086c0a284d06f Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 1 Aug 2024 09:37:49 -0700 Subject: [PATCH 06/12] ugh --- app/aws/s3.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/aws/s3.py b/app/aws/s3.py index 189c6b4a9..760e4dedf 100644 --- a/app/aws/s3.py +++ b/app/aws/s3.py @@ -116,7 +116,8 @@ def download_from_s3( raise Exception(pce) except Exception as e: print(f"An error occurred {e}") - raise Exception(e) + text = f"EXCEPTION {e} local_filename {local_filename}" + raise Exception(text) return result From 2dd3ebc6570f56c5832161485b171019ac5db9ae Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Thu, 1 Aug 2024 10:38:58 -0700 Subject: [PATCH 07/12] fix test --- .ds.baseline | 4 ++-- app/commands.py | 7 ++++--- tests/app/service/test_rest.py | 6 +----- tests/app/test_commands.py | 17 ++++++++--------- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.ds.baseline b/.ds.baseline index bf8b9631a..8b6703173 100644 --- a/.ds.baseline +++ b/.ds.baseline @@ -305,7 +305,7 @@ "filename": "tests/app/service/test_rest.py", "hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", "is_verified": false, - "line_number": 1274, + "line_number": 1275, "is_secret": false } ], @@ -384,5 +384,5 @@ } ] }, - "generated_at": "2024-07-22T21:27:35Z" + "generated_at": "2024-08-01T17:38:39Z" } diff --git a/app/commands.py b/app/commands.py index 9e1a26081..fe59537fb 100644 --- a/app/commands.py +++ b/app/commands.py @@ -592,14 +592,15 @@ def process_row_from_job(job_id, job_row_number): @notify_command(name="download-csv-file-by-name") -@click.argument("csv_filename") +@click.option("-f", "--csv_filename", required=True, help="S3 file location") def download_csv_file_by_name(csv_filename): - # poetry run flask command download-csv-file-by-name - # cf run-task notify-api-production --command "flask command download-csv-file-by-name " + # poetry run flask command download-csv-file-by-name -f + # cf run-task notify-api-production --command "flask command download-csv-file-by-name -f " bucket_name = current_app.config["CSV_UPLOAD_BUCKET"]["bucket"] access_key = current_app.config["CSV_UPLOAD_BUCKET"]["access_key_id"] secret = current_app.config["CSV_UPLOAD_BUCKET"]["secret_access_key"] region = current_app.config["CSV_UPLOAD_BUCKET"]["region"] + s3.download_from_s3( bucket_name, csv_filename, "download.csv", access_key, secret, region ) diff --git a/tests/app/service/test_rest.py b/tests/app/service/test_rest.py index 8a97046e0..0cdae7de4 100644 --- a/tests/app/service/test_rest.py +++ b/tests/app/service/test_rest.py @@ -1770,9 +1770,6 @@ def test_get_all_notifications_for_service_in_order_with_post_request( assert response.status_code == 200 -@pytest.mark.skip( - reason="We can't search on recipient if recipient is not kept in the db" -) def test_get_all_notifications_for_service_filters_notifications_when_using_post_request( client, notify_db_session ): @@ -1808,7 +1805,6 @@ def test_get_all_notifications_for_service_filters_notifications_when_using_post "page": 1, "template_type": [TemplateType.SMS], "status": [NotificationStatus.CREATED, NotificationStatus.SENDING], - "to": "0855", } response = client.post( @@ -1818,7 +1814,7 @@ def test_get_all_notifications_for_service_filters_notifications_when_using_post ) resp = json.loads(response.get_data(as_text=True)) - assert len(resp["notifications"]) == 1 + assert len(resp["notifications"]) == 2 assert resp["notifications"][0]["to"] == "1" assert resp["notifications"][0]["status"] == returned_notification.status assert response.status_code == 200 diff --git a/tests/app/test_commands.py b/tests/app/test_commands.py index 817f2e4bf..46dd2b0c1 100644 --- a/tests/app/test_commands.py +++ b/tests/app/test_commands.py @@ -428,23 +428,22 @@ def test_promote_user_to_platform_admin( assert user.platform_admin is True -def test_download_csv_file_by_name(notify_api, sample_platform_admin): - assert sample_platform_admin.platform_admin is True - - result = notify_api.test_cli_runner().invoke( +def test_download_csv_file_by_name(notify_api, mocker): + mock_download = mocker.patch("app.commands.s3.download_from_s3") + notify_api.test_cli_runner().invoke( download_csv_file_by_name, [ + "-f", "NonExistentName", ], ) - - # if we get a 404, it means that the file is not in s3 (of course) - # but we are making the call to s3, etc. so that part is working - assert "404" in str(result) + mock_download.assert_called_once() def test_promote_user_to_platform_admin_no_result_found( - notify_db_session, notify_api, sample_user + notify_db_session, + notify_api, + sample_user, ): assert sample_user.platform_admin is False From 0dbb5dbcc1fcacbd539121dbe1982547319346a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2024 21:33:46 +0000 Subject: [PATCH 08/12] Bump botocore from 1.34.150 to 1.34.154 Bumps [botocore](https://github.com/boto/botocore) from 1.34.150 to 1.34.154. - [Changelog](https://github.com/boto/botocore/blob/develop/CHANGELOG.rst) - [Commits](https://github.com/boto/botocore/compare/1.34.150...1.34.154) --- updated-dependencies: - dependency-name: botocore dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 22 +++++++++++++--------- pyproject.toml | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/poetry.lock b/poetry.lock index 33d0907b2..6d4bd20c0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -204,17 +204,17 @@ tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "p [[package]] name = "awscli" -version = "1.33.32" +version = "1.33.36" description = "Universal Command Line Environment for AWS." optional = false python-versions = ">=3.8" files = [ - {file = "awscli-1.33.32-py3-none-any.whl", hash = "sha256:94e0e348b4e98d949d01f3c9bba817ef9c0da4aabea53a5d966445618339c7dd"}, - {file = "awscli-1.33.32.tar.gz", hash = "sha256:90137622dcd7695939d64f57172901376d8ca5eb995c12e5fce50f55316c5b62"}, + {file = "awscli-1.33.36-py3-none-any.whl", hash = "sha256:b4d79946aff15f83a653d41573610c55a2f2311f7387e409074dea1d2f432037"}, + {file = "awscli-1.33.36.tar.gz", hash = "sha256:52de9dd8fb3600d8d99db7ce400d058413ce69634a476582af8e2301936f0af7"}, ] [package.dependencies] -botocore = "1.34.150" +botocore = "1.34.154" colorama = ">=0.2.5,<0.4.7" docutils = ">=0.10,<0.17" PyYAML = ">=3.10,<6.1" @@ -422,13 +422,13 @@ crt = ["botocore[crt] (>=1.21.0,<2.0a0)"] [[package]] name = "botocore" -version = "1.34.150" +version = "1.34.154" description = "Low-level, data-driven core of boto 3." optional = false python-versions = ">=3.8" files = [ - {file = "botocore-1.34.150-py3-none-any.whl", hash = "sha256:b988d47f4d502df85befce11a48002421e4e6ea4289997b5e0261bac5fa76ce6"}, - {file = "botocore-1.34.150.tar.gz", hash = "sha256:4d23387e0f076d87b637a2a35c0ff2b8daca16eace36b63ce27f65630c6b375a"}, + {file = "botocore-1.34.154-py3-none-any.whl", hash = "sha256:4eef4b1bb809b382ba9dc9c88f5fcc4a133f221a1acb693ee6bee4de9f325979"}, + {file = "botocore-1.34.154.tar.gz", hash = "sha256:64d9b4c85a504d77cb56dabb2ad717cd8e1717424a88edb458b01d1e5797262a"}, ] [package.dependencies] @@ -2093,9 +2093,13 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, + {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, + {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, + {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, + {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2484,7 +2488,6 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, - {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -3467,6 +3470,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -4739,4 +4743,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "4ef9a352a137fe091b1084b06959b9b674c30635771abc23010d2ba560f6bfd6" +content-hash = "3ef243b66ad1952b29dafb605b31f18ec5512073565c9241b05a06c47df279e0" diff --git a/pyproject.toml b/pyproject.toml index 3bfff266b..9261ae6d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ alembic = "==1.13.2" amqp = "==5.2.0" beautifulsoup4 = "==4.12.3" boto3 = "^1.34.150" -botocore = "^1.34.150" +botocore = "^1.34.154" cachetools = "==5.4.0" celery = {version = "==5.4.0", extras = ["redis"]} certifi = ">=2022.12.7" From f50374608391928eea7e0e5304254c8da7eeab88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:33:48 +0000 Subject: [PATCH 09/12] Bump redis from 5.0.7 to 5.0.8 Bumps [redis](https://github.com/redis/redis-py) from 5.0.7 to 5.0.8. - [Release notes](https://github.com/redis/redis-py/releases) - [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES) - [Commits](https://github.com/redis/redis-py/compare/v5.0.7...v5.0.8) --- updated-dependencies: - dependency-name: redis dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6d4bd20c0..fdaac364f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3630,17 +3630,17 @@ full = ["numpy"] [[package]] name = "redis" -version = "5.0.7" +version = "5.0.8" description = "Python client for Redis database and key-value store" optional = false python-versions = ">=3.7" files = [ - {file = "redis-5.0.7-py3-none-any.whl", hash = "sha256:0e479e24da960c690be5d9b96d21f7b918a98c0cf49af3b6fafaa0753f93a0db"}, - {file = "redis-5.0.7.tar.gz", hash = "sha256:8f611490b93c8109b50adc317b31bfd84fff31def3475b92e7e80bf39f48175b"}, + {file = "redis-5.0.8-py3-none-any.whl", hash = "sha256:56134ee08ea909106090934adc36f65c9bcbbaecea5b21ba704ba6fb561f8eb4"}, + {file = "redis-5.0.8.tar.gz", hash = "sha256:0c5b10d387568dfe0698c6fad6615750c24170e548ca2deac10c649d463e9870"}, ] [package.extras] -hiredis = ["hiredis (>=1.0.0)"] +hiredis = ["hiredis (>1.0.0)"] ocsp = ["cryptography (>=36.0.1)", "pyopenssl (==20.0.1)", "requests (>=2.26.0)"] [[package]] @@ -4743,4 +4743,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "3ef243b66ad1952b29dafb605b31f18ec5512073565c9241b05a06c47df279e0" +content-hash = "8c2b194b00fa7c91ae6f1c3c62343e2643fc82598ca2c165e62cf9f8e77539d6" diff --git a/pyproject.toml b/pyproject.toml index 9261ae6d9..a1323a4f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,7 +76,7 @@ urllib3 = "^2.2.2" webencodings = "^0.5.1" itsdangerous = "^2.2.0" jinja2 = "^3.1.4" -redis = "^5.0.7" +redis = "^5.0.8" requests = "^2.32.3" From cf4c7722c0c7a7a920d3f6019497f9a6662bfb48 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 15:45:03 +0000 Subject: [PATCH 10/12] Bump phonenumbers from 8.13.40 to 8.13.42 Bumps [phonenumbers](https://github.com/daviddrysdale/python-phonenumbers) from 8.13.40 to 8.13.42. - [Commits](https://github.com/daviddrysdale/python-phonenumbers/compare/v8.13.40...v8.13.42) --- updated-dependencies: - dependency-name: phonenumbers dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index fdaac364f..b5108c604 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2821,13 +2821,13 @@ ptyprocess = ">=0.5" [[package]] name = "phonenumbers" -version = "8.13.40" +version = "8.13.42" description = "Python version of Google's common library for parsing, formatting, storing and validating international phone numbers." optional = false python-versions = "*" files = [ - {file = "phonenumbers-8.13.40-py2.py3-none-any.whl", hash = "sha256:9582752c20a1da5ec4449f7f97542bf8a793c8e2fec0ab57f767177bb8fc0b1d"}, - {file = "phonenumbers-8.13.40.tar.gz", hash = "sha256:f137c2848b8e83dd064b71881b65680584417efa202177fd330e2f7ff6c68113"}, + {file = "phonenumbers-8.13.42-py2.py3-none-any.whl", hash = "sha256:18acc22ee03116d27b26e990f53806a1770a3e05f05e1620bc09ad187f889456"}, + {file = "phonenumbers-8.13.42.tar.gz", hash = "sha256:7137904f2db3b991701e853174ce8e1cb8f540b8bfdf27617540de04c0b7bed5"}, ] [[package]] @@ -4743,4 +4743,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "8c2b194b00fa7c91ae6f1c3c62343e2643fc82598ca2c165e62cf9f8e77539d6" +content-hash = "89b99841ebd4bd735104048c8f8f0a35bfedb700a7a5648ecabe713816e25579" diff --git a/pyproject.toml b/pyproject.toml index a1323a4f0..9f9b39ce7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ geojson = "^3.1.0" govuk-bank-holidays = "^0.14" numpy = "^1.26.4" ordered-set = "^4.1.0" -phonenumbers = "^8.13.40" +phonenumbers = "^8.13.42" python-json-logger = "^2.0.7" pytz = "^2024.1" regex = "^2024.7.24" From 38b49da0d3400f0a23e04f735b97fe9625fb4a49 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 7 Aug 2024 12:41:35 -0700 Subject: [PATCH 11/12] add MethodNotAllowed --- notifications_utils/request_helper.py | 2 ++ poetry.lock | 6 +----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/notifications_utils/request_helper.py b/notifications_utils/request_helper.py index eb7a2061f..93590fdaa 100644 --- a/notifications_utils/request_helper.py +++ b/notifications_utils/request_helper.py @@ -84,6 +84,8 @@ class ResponseHeaderMiddleware(object): current_app.logger.error(be) elif "AttributeError" in str(be): # notify-api-1394 current_app.logger.error(be) + elif "MethodNotAllowed" in str(be): # notify-admin-1392 + current_app.logger.error(be) else: raise be diff --git a/poetry.lock b/poetry.lock index b5108c604..cc661a9a1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2093,13 +2093,9 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2488,6 +2484,7 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, + {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] @@ -3470,7 +3467,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, From 37ba16d019353bd9a12d564e2413d8c154316317 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Wed, 7 Aug 2024 13:15:36 -0700 Subject: [PATCH 12/12] fix format --- notifications_utils/request_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notifications_utils/request_helper.py b/notifications_utils/request_helper.py index 93590fdaa..1dd9a9ae1 100644 --- a/notifications_utils/request_helper.py +++ b/notifications_utils/request_helper.py @@ -84,7 +84,7 @@ class ResponseHeaderMiddleware(object): current_app.logger.error(be) elif "AttributeError" in str(be): # notify-api-1394 current_app.logger.error(be) - elif "MethodNotAllowed" in str(be): # notify-admin-1392 + elif "MethodNotAllowed" in str(be): # notify-admin-1392 current_app.logger.error(be) else: raise be