From 6464bcee205d31adb2dd7cad49d5217701e6789b Mon Sep 17 00:00:00 2001 From: Arun Siluvery Date: Tue, 12 Jul 2022 13:43:16 +0100 Subject: [PATCH 1/6] Upgrade Django to current LTS version 3.2 The support for the current Django version has ended in April 2022 hence upgrading to current LTS version 3.2. Chosen version is 3.2.14 which is the same as lite-api version. --- Pipfile | 2 +- Pipfile.lock | 46 +++++++++++++++++++++++++++++++++++++--------- conf/views.py | 4 ++-- mail/enums.py | 3 +-- 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/Pipfile b/Pipfile index 1127e6e8..7de4ba55 100644 --- a/Pipfile +++ b/Pipfile @@ -17,7 +17,6 @@ pytest-django = "*" pytest-cov = "*" [packages] -Django = "~=2.2" djangorestframework = "~=3.9" django-background-tasks = "~=1.2" django-environ = "~=0.4" @@ -33,6 +32,7 @@ requests = "~=2.21" unidecode = "~=1.2" django-log-formatter-ecs = "==0.0.5" gunicorn = "*" +django = "==3.2.14" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index db70e037..f5522c31 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "2ce8fc086a14e5df078a0d65de355a2951f96ded8b58b3d54978069c8bea4eee" + "sha256": "ab4e8283e3fcd86ad26a54e422d4b068f557f3d6ecf8b28393c93ed159d07d56" }, "pipfile-spec": 6, "requires": { @@ -16,6 +16,14 @@ ] }, "default": { + "asgiref": { + "hashes": [ + "sha256:1d2880b792ae8757289136f1db2b7b99100ce959b2aa57fd69dab783d05afac4", + "sha256:4a29362a6acebe09bf1d6640db38c1dc3d9217c68e6f9f6204d72667fc19a424" + ], + "markers": "python_version >= '3.7'", + "version": "==3.5.2" + }, "attrs": { "hashes": [ "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4", @@ -93,10 +101,12 @@ "django": { "hashes": [ "sha256:0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413", - "sha256:365429d07c1336eb42ba15aa79f45e1c13a0b04d5c21569e7d596696418a6a45" + "sha256:365429d07c1336eb42ba15aa79f45e1c13a0b04d5c21569e7d596696418a6a45", + "sha256:677182ba8b5b285a4e072f3ac17ceee6aff1b5ce77fd173cc5b6a2d3dc022fcf", + "sha256:a8681e098fa60f7c33a4b628d6fcd3fe983a0939ff1301ecacac21d0b38bad56" ], "index": "pypi", - "version": "==2.2.28" + "version": "==3.2.14" }, "django-background-tasks": { "hashes": [ @@ -207,7 +217,7 @@ "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff", "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" ], - "markers": "python_full_version >= '3.5.0'", + "markers": "python_version >= '3.5'", "version": "==3.3" }, "importlib-metadata": { @@ -377,7 +387,7 @@ "sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae", "sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d" ], - "markers": "python_full_version >= '3.5.0'", + "markers": "python_version >= '3.5'", "version": "==0.4.2" }, "tomli": { @@ -595,10 +605,12 @@ "django": { "hashes": [ "sha256:0200b657afbf1bc08003845ddda053c7641b9b24951e52acd51f6abda33a7413", - "sha256:365429d07c1336eb42ba15aa79f45e1c13a0b04d5c21569e7d596696418a6a45" + "sha256:365429d07c1336eb42ba15aa79f45e1c13a0b04d5c21569e7d596696418a6a45", + "sha256:677182ba8b5b285a4e072f3ac17ceee6aff1b5ce77fd173cc5b6a2d3dc022fcf", + "sha256:a8681e098fa60f7c33a4b628d6fcd3fe983a0939ff1301ecacac21d0b38bad56" ], "index": "pypi", - "version": "==2.2.28" + "version": "==3.2.14" }, "django-extensions": { "hashes": [ @@ -940,6 +952,22 @@ "markers": "python_version >= '3.7'", "version": "==7.1.2" }, + "pytest-cov": { + "hashes": [ + "sha256:578d5d15ac4a25e5f961c938b85a05b09fdaae9deef3bb6de9a6e766622ca7a6", + "sha256:e7f0f5b1617d2210a2cabc266dfe2f4c75a8d32fb89eafb7ad9d06f6d076d470" + ], + "index": "pypi", + "version": "==3.0.0" + }, + "pytest-django": { + "hashes": [ + "sha256:c60834861933773109334fe5a53e83d1ef4828f2203a1d6a0fa9972f4f75ab3e", + "sha256:d9076f759bb7c36939dbdd5ae6633c18edfc2902d1a69fdbefd2426b970ce6c2" + ], + "index": "pypi", + "version": "==4.5.2" + }, "pytz": { "hashes": [ "sha256:1e760e2fe6a8163bc0b3d9a19c4f84342afa0a2affebfaa84b01b978a02ecaa7", @@ -991,7 +1019,7 @@ "sha256:9124b0fa5808660e2ae65a06049dfe248a7b7df73f8e9d48d0ad7f7c790690ad", "sha256:d9fa8da14813500f6f94752c2bf4a6cf33d13e9f2140947f7df0149f1537437b" ], - "markers": "python_version < '4.0' and python_full_version >= '3.6.2'", + "markers": "python_version < '4' and python_full_version >= '3.6.2'", "version": "==1.0.3" }, "setoptconf": { @@ -1038,7 +1066,7 @@ "sha256:0c00730c74263a94e5a9919ade150dfc3b19c574389985446148402998287dae", "sha256:48719e356bb8b42991bdbb1e8b83223757b93789c00910a616a071910ca4a64d" ], - "markers": "python_full_version >= '3.5.0'", + "markers": "python_version >= '3.5'", "version": "==0.4.2" }, "stevedore": { diff --git a/conf/views.py b/conf/views.py index 72e0fc18..c441608b 100644 --- a/conf/views.py +++ b/conf/views.py @@ -4,7 +4,7 @@ from background_task.models import Task from django.conf import settings -from django.shortcuts import render_to_response +from django.shortcuts import render from django.utils import timezone from rest_framework.status import HTTP_200_OK, HTTP_503_SERVICE_UNAVAILABLE from rest_framework.views import APIView @@ -88,4 +88,4 @@ def _build_response(status, message, start_time): response_time = "{:.3f}".format(duration_ms) context = {"message": message, "response_time": response_time} - return render_to_response("healthcheck.xml", context, content_type="application/xml", status=status) + return render("healthcheck.xml", context, content_type="application/xml", status=status) diff --git a/mail/enums.py b/mail/enums.py index 84194f80..087bff29 100644 --- a/mail/enums.py +++ b/mail/enums.py @@ -1,8 +1,7 @@ import enum from types import DynamicClassAttribute -from django.utils.decorators import classproperty -from django.utils.functional import Promise +from django.utils.functional import Promise, classproperty # Backported from Django 4.x From 9f71642bcf11c3936247c1fc4380d276aff17bbf Mon Sep 17 00:00:00 2001 From: Arun Siluvery Date: Tue, 12 Jul 2022 15:55:42 +0100 Subject: [PATCH 2/6] Remove django-jsonfield as Django has inbuilt support from 3.1 django-jsonfield is currently in maintenance mode and not recommended to use. Previous django version didn't have support so that package was necessary, now that we have upgraded to 3.2 which has support for json fields we can remove django-jsonfield. --- Pipfile | 1 - Pipfile.lock | 4 +- mail/migrations/0018_auto_20220714_1127.py | 63 ++++++++++++++++++++++ mail/models.py | 21 ++++---- 4 files changed, 75 insertions(+), 14 deletions(-) create mode 100644 mail/migrations/0018_auto_20220714_1127.py diff --git a/Pipfile b/Pipfile index 7de4ba55..9b31ee50 100644 --- a/Pipfile +++ b/Pipfile @@ -21,7 +21,6 @@ djangorestframework = "~=3.9" django-background-tasks = "~=1.2" django-environ = "~=0.4" django-model-utils = "~=4.0" -django-jsonfield = "~=1.4" elastic-apm = "~=5.8" sentry-sdk = "~=0.16" typed-ast = "~=1.4.2" diff --git a/Pipfile.lock b/Pipfile.lock index f5522c31..4975f479 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "ab4e8283e3fcd86ad26a54e422d4b068f557f3d6ecf8b28393c93ed159d07d56" + "sha256": "38b709b62107a6905006fd7835192519e4220a61708036093ea6601131ade76c" }, "pipfile-spec": 6, "requires": { @@ -1019,7 +1019,7 @@ "sha256:9124b0fa5808660e2ae65a06049dfe248a7b7df73f8e9d48d0ad7f7c790690ad", "sha256:d9fa8da14813500f6f94752c2bf4a6cf33d13e9f2140947f7df0149f1537437b" ], - "markers": "python_version < '4' and python_full_version >= '3.6.2'", + "markers": "python_version < '4.0' and python_full_version >= '3.6.2'", "version": "==1.0.3" }, "setoptconf": { diff --git a/mail/migrations/0018_auto_20220714_1127.py b/mail/migrations/0018_auto_20220714_1127.py new file mode 100644 index 00000000..fcac4536 --- /dev/null +++ b/mail/migrations/0018_auto_20220714_1127.py @@ -0,0 +1,63 @@ +# Generated by Django 3.2.14 on 2022-07-14 11:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("mail", "0017_auto_20220517_0830"), + ] + + operations = [ + migrations.AlterField( + model_name="licencepayload", + name="data", + field=models.JSONField(default=dict), + ), + migrations.AlterField( + model_name="usagedata", + name="licence_ids", + field=models.JSONField(default=list), + ), + migrations.AlterField( + model_name="usagedata", + name="lite_accepted_licences", + field=models.JSONField(default=list), + ), + migrations.AlterField( + model_name="usagedata", + name="lite_licences", + field=models.JSONField(default=dict), + ), + migrations.AlterField( + model_name="usagedata", + name="lite_payload", + field=models.JSONField(default=dict), + ), + migrations.AlterField( + model_name="usagedata", + name="lite_rejected_licences", + field=models.JSONField(default=list), + ), + migrations.AlterField( + model_name="usagedata", + name="lite_response", + field=models.JSONField(default=dict), + ), + migrations.AlterField( + model_name="usagedata", + name="spire_accepted_licences", + field=models.JSONField(default=dict), + ), + migrations.AlterField( + model_name="usagedata", + name="spire_licences", + field=models.JSONField(default=dict), + ), + migrations.AlterField( + model_name="usagedata", + name="spire_rejected_licences", + field=models.JSONField(default=dict), + ), + ] diff --git a/mail/models.py b/mail/models.py index 607a038e..c6e059c2 100644 --- a/mail/models.py +++ b/mail/models.py @@ -6,7 +6,6 @@ from django.db import IntegrityError, models from django.utils import timezone -from jsonfield import JSONField from model_utils.models import TimeStampedModel from mail.enums import ( @@ -109,21 +108,21 @@ def get_licence_ids(self): class UsageData(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) - licence_ids = JSONField() + licence_ids = models.JSONField(default=list) mail = models.ForeignKey(Mail, on_delete=models.DO_NOTHING, null=False) spire_run_number = models.IntegerField() hmrc_run_number = models.IntegerField() has_lite_data = models.NullBooleanField(default=None) has_spire_data = models.NullBooleanField(default=None) - lite_payload = JSONField() + lite_payload = models.JSONField(default=dict) lite_sent_at = models.DateTimeField(blank=True, null=True) # When update was sent to LITE API - lite_accepted_licences = JSONField() - lite_rejected_licences = JSONField() - spire_accepted_licences = JSONField() - spire_rejected_licences = JSONField() - lite_licences = JSONField() - spire_licences = JSONField() - lite_response = JSONField() + lite_accepted_licences = models.JSONField(default=list) + lite_rejected_licences = models.JSONField(default=list) + spire_accepted_licences = models.JSONField(default=dict) + spire_rejected_licences = models.JSONField(default=dict) + lite_licences = models.JSONField(default=dict) + spire_licences = models.JSONField(default=dict) + lite_response = models.JSONField(default=dict) class Meta: ordering = ["mail__created_at"] @@ -143,7 +142,7 @@ class LicencePayload(models.Model): lite_id = models.UUIDField(null=False, blank=False, unique=False) reference = models.CharField(null=False, blank=False, max_length=35) action = models.CharField(choices=LicenceActionEnum.choices, null=False, blank=False, max_length=6) - data = JSONField() + data = models.JSONField(default=dict) received_at = models.DateTimeField(default=timezone.now) is_processed = models.BooleanField(default=False) From 574c1f7bbcc9810c0de4be4dbbb70ff1771b2341 Mon Sep 17 00:00:00 2001 From: Arun Siluvery Date: Wed, 13 Jul 2022 11:06:15 +0100 Subject: [PATCH 3/6] Upgrade elastic-apm --- Pipfile | 2 +- Pipfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Pipfile b/Pipfile index 9b31ee50..d22ac417 100644 --- a/Pipfile +++ b/Pipfile @@ -21,7 +21,6 @@ djangorestframework = "~=3.9" django-background-tasks = "~=1.2" django-environ = "~=0.4" django-model-utils = "~=4.0" -elastic-apm = "~=5.8" sentry-sdk = "~=0.16" typed-ast = "~=1.4.2" mohawk = ">=1.1" @@ -32,6 +31,7 @@ unidecode = "~=1.2" django-log-formatter-ecs = "==0.0.5" gunicorn = "*" django = "==3.2.14" +elastic-apm = "==6.7.2" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index 4975f479..59b14dd9 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "38b709b62107a6905006fd7835192519e4220a61708036093ea6601131ade76c" + "sha256": "c42485ee36357152138e8a5e0b0fc516260b4b5af2a40041e96ae94abacb93b1" }, "pipfile-spec": 6, "requires": { @@ -202,7 +202,7 @@ "sha256:fc4d8467f5c1a47bc182068b4ad777d46914b6661f3c02f81804697e045ba712" ], "index": "pypi", - "version": "==5.10.1" + "version": "==6.7.2" }, "gunicorn": { "hashes": [ From a32a70258614fba27ef336b9a9543aeacd0c5525 Mon Sep 17 00:00:00 2001 From: Kevin Carrogan Date: Wed, 13 Jul 2022 11:27:42 +0100 Subject: [PATCH 4/6] Updating pipenv lock file --- Pipfile.lock | 355 ++++++++++++++++++--------------------------------- 1 file changed, 124 insertions(+), 231 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 59b14dd9..7fb9a6b6 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -24,79 +24,21 @@ "markers": "python_version >= '3.7'", "version": "==3.5.2" }, - "attrs": { - "hashes": [ - "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4", - "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==21.4.0" - }, "certifi": { "hashes": [ - "sha256:9c5705e395cd70084351dd8ad5c41e65655e08ce46f2ec9cf6c2c08390f71eb7", - "sha256:f1d53542ee8cbedbe2118b5686372fb33c297fcd6379b050cca0ef13a597382a" + "sha256:84c85a9078b11105f04f3036a9482ae10e4621616db313fe045dd24743a0820d", + "sha256:fe86415d55e84719d75f8b69414f6438ac3547d2078ab91b67e779ef69378412" ], "markers": "python_version >= '3.6'", - "version": "==2022.5.18.1" + "version": "==2022.6.15" }, "charset-normalizer": { "hashes": [ - "sha256:2857e29ff0d34db842cd7ca3230549d1a697f96ee6d3fb071cfa6c7393832597", - "sha256:6881edbebdb17b39b4eaaa821b438bf6eddffb4468cf344f09f89def34a8b1df" - ], - "markers": "python_full_version >= '3.5.0'", - "version": "==2.0.12" - }, - "coverage": { - "extras": [ - "toml" - ], - "hashes": [ - "sha256:01c5615d13f3dd3aa8543afc069e5319cfa0c7d712f6e04b920431e5c564a749", - "sha256:106c16dfe494de3193ec55cac9640dd039b66e196e4641fa8ac396181578b982", - "sha256:129cd05ba6f0d08a766d942a9ed4b29283aff7b2cccf5b7ce279d50796860bb3", - "sha256:145f296d00441ca703a659e8f3eb48ae39fb083baba2d7ce4482fb2723e050d9", - "sha256:1480ff858b4113db2718848d7b2d1b75bc79895a9c22e76a221b9d8d62496428", - "sha256:269eaa2c20a13a5bf17558d4dc91a8d078c4fa1872f25303dddcbba3a813085e", - "sha256:26dff09fb0d82693ba9e6231248641d60ba606150d02ed45110f9ec26404ed1c", - "sha256:2bd9a6fc18aab8d2e18f89b7ff91c0f34ff4d5e0ba0b33e989b3cd4194c81fd9", - "sha256:309ce4a522ed5fca432af4ebe0f32b21d6d7ccbb0f5fcc99290e71feba67c264", - "sha256:3384f2a3652cef289e38100f2d037956194a837221edd520a7ee5b42d00cc605", - "sha256:342d4aefd1c3e7f620a13f4fe563154d808b69cccef415415aece4c786665397", - "sha256:39ee53946bf009788108b4dd2894bf1349b4e0ca18c2016ffa7d26ce46b8f10d", - "sha256:4321f075095a096e70aff1d002030ee612b65a205a0a0f5b815280d5dc58100c", - "sha256:4803e7ccf93230accb928f3a68f00ffa80a88213af98ed338a57ad021ef06815", - "sha256:4ce1b258493cbf8aec43e9b50d89982346b98e9ffdfaae8ae5793bc112fb0068", - "sha256:664a47ce62fe4bef9e2d2c430306e1428ecea207ffd68649e3b942fa8ea83b0b", - "sha256:75ab269400706fab15981fd4bd5080c56bd5cc07c3bccb86aab5e1d5a88dc8f4", - "sha256:83c4e737f60c6936460c5be330d296dd5b48b3963f48634c53b3f7deb0f34ec4", - "sha256:84631e81dd053e8a0d4967cedab6db94345f1c36107c71698f746cb2636c63e3", - "sha256:84e65ef149028516c6d64461b95a8dbcfce95cfd5b9eb634320596173332ea84", - "sha256:865d69ae811a392f4d06bde506d531f6a28a00af36f5c8649684a9e5e4a85c83", - "sha256:87f4f3df85aa39da00fd3ec4b5abeb7407e82b68c7c5ad181308b0e2526da5d4", - "sha256:8c08da0bd238f2970230c2a0d28ff0e99961598cb2e810245d7fc5afcf1254e8", - "sha256:961e2fb0680b4f5ad63234e0bf55dfb90d302740ae9c7ed0120677a94a1590cb", - "sha256:9b3e07152b4563722be523e8cd0b209e0d1a373022cfbde395ebb6575bf6790d", - "sha256:a7f3049243783df2e6cc6deafc49ea123522b59f464831476d3d1448e30d72df", - "sha256:bf5601c33213d3cb19d17a796f8a14a9eaa5e87629a53979a5981e3e3ae166f6", - "sha256:cec3a0f75c8f1031825e19cd86ee787e87cf03e4fd2865c79c057092e69e3a3b", - "sha256:d42c549a8f41dc103a8004b9f0c433e2086add8a719da00e246e17cbe4056f72", - "sha256:d67d44996140af8b84284e5e7d398e589574b376fb4de8ccd28d82ad8e3bea13", - "sha256:d9c80df769f5ec05ad21ea34be7458d1dc51ff1fb4b2219e77fe24edf462d6df", - "sha256:e57816f8ffe46b1df8f12e1b348f06d164fd5219beba7d9433ba79608ef011cc", - "sha256:ee2ddcac99b2d2aec413e36d7a429ae9ebcadf912946b13ffa88e7d4c9b712d6", - "sha256:f02cbbf8119db68455b9d763f2f8737bb7db7e43720afa07d8eb1604e5c5ae28", - "sha256:f1d5aa2703e1dab4ae6cf416eb0095304f49d004c39e9db1d86f57924f43006b", - "sha256:f5b66caa62922531059bc5ac04f836860412f7f88d38a476eda0a6f11d4724f4", - "sha256:f69718750eaae75efe506406c490d6fc5a6161d047206cc63ce25527e8a3adad", - "sha256:fb73e0011b8793c053bfa85e53129ba5f0250fdc0392c1591fd35d915ec75c46", - "sha256:fd180ed867e289964404051a958f7cccabdeed423f91a899829264bb7974d3d3", - "sha256:fdb6f7bd51c2d1714cea40718f6149ad9be6a2ee7d93b19e9f00934c0f2a74d9", - "sha256:ffa9297c3a453fba4717d06df579af42ab9a28022444cae7fa605af4df612d54" + "sha256:5189b6f22b01957427f35b6a08d9a0bc45b46d3788ef5a92e978433c7a35f8a5", + "sha256:575e708016ff3a5e3681541cb9d79312c416835686d054a23accb873b254f413" ], - "markers": "python_version >= '3.7'", - "version": "==6.4.1" + "markers": "python_version >= '3.6'", + "version": "==2.1.0" }, "django": { "hashes": [ @@ -123,11 +65,11 @@ }, "django-environ": { "hashes": [ - "sha256:42593bee519a527602a467c7b682aee1a051c2597f98c45f4f4f44169ecdb6e5", - "sha256:6f0bc902b43891656b20486938cba0861dc62892784a44919170719572a534cb" + "sha256:bff5381533056328c9ac02f71790bd5bf1cea81b1beeb648f28b81c9e83e0a21", + "sha256:f21a5ef8cc603da1870bbf9a09b7e5577ab5f6da451b843dbcc721a7bca6b3d9" ], "index": "pypi", - "version": "==0.8.1" + "version": "==0.9.0" }, "django-ipware": { "hashes": [ @@ -137,14 +79,6 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", "version": "==3.0.7" }, - "django-jsonfield": { - "hashes": [ - "sha256:ccb2fe623e1bf7799e49c593b0a89a85084ef8d3debbf26d92a54e27b5305d72", - "sha256:f789a0ea1f80b48aff7d6c36dd356ce125dbf1b7cd97a82d315607ac758f50ff" - ], - "index": "pypi", - "version": "==1.4.1" - }, "django-log-formatter-ecs": { "hashes": [ "sha256:1e8731dd25a11ac64e789f19931e12fe7ef8ad1a172b7bceb2ea5cab185a583e", @@ -176,30 +110,51 @@ "sha256:141f0ed583dc0d0d39ebea423cfa94bce303156f09cb09dfcb1250df8964ee1d", "sha256:14d0f1a7e6b725478cdb682fb0e674b1dae06f72a323d7c3e300d81feb71ab54", "sha256:187dab4fa5252b23f871dcb9662763cf3e54b07ff652c5728de3233d8198dca0", + "sha256:219c239282c4de01cfa616dda0566cc46729c1b53185226ca1e46b9fa14d9caa", "sha256:255db7da152f1fe59f18066d44fc2b05e3b97d0296ccc90e7dbd4567cdf17670", + "sha256:2c142b9b7d45b1c395ac17aa0447535671e0d3316093d44495bc85e10a42cb89", + "sha256:2dd38d1f77040d982b6a8769c31215ba03fb0edac99fce481440f683565ecf9b", "sha256:37747145249a02bdd6b2f222fe8ee2f8f356aad06df1e6debab2470f82aed88e", + "sha256:3f598f92cd3b05857a449bd203188c0e45860cd829a1e09e7668a1b12a9e7979", + "sha256:47792765747e13a05811d1bbe849c17e074056b3d970cdb439f17e224ba06330", "sha256:5465d419b449c1d389efd6d37a20cfe4a517ce11fd33bea7ae2606f756b99934", + "sha256:555a6e8a4e0bc5302ee004eb6a106372015491b6c0a314f0924e4f818ece1116", + "sha256:5b0a925203d4c9f77573fbf94ef9de5a3de565194a1f6c487b0f9644fc2d0264", "sha256:60ded274b39a1a0ba4e1be2a15711c6c515fcd8caf4368e13115bf3f8723e34d", "sha256:6113ca8e79cc231091dc696b7227f89d763b40bdd7b616e95f1c32037627c165", "sha256:61c0509833d35290e8f9b9e60ff72a4fb19e25cff5a3d71a4d8d200c23f8a18a", + "sha256:61c593de26e51875aba80345054c12253faf9603be9909b1699e1e64ebe50760", "sha256:6462a0a2ee246db39a5661f9ab3ce4f670c20783c0c367191c8723982c50f06e", "sha256:666fb62e74c56473b953a9c0d6a1162a0af903b56c388eed914cd261767d6f24", + "sha256:6831e9b8fbad76ec4c9d07c8b3141c19964ac7a4ea4c502653744cfc02772aa5", "sha256:68be8ce381346dab66ceae92e7d5950fe5ab56c89df96daedf01e9b187eab18f", "sha256:71fbced250444effe937a9d6d88429a4d16aed49caabbe593bed7311452f28d3", "sha256:72aa4c769a666339411630747be4144e5aeb6de39d3b786dd3d080a0fda370d8", + "sha256:7431abcfd07b6a0d07b03c6d9ba23c39e0a1366bf76ec04b0ca87ca608b72e13", + "sha256:7d057b717e9c701facd96daf716f6af170e1ea973f11beaa52a52dd6ad801466", + "sha256:8734fafd770b9aa100cfd2b490e737fe5e0ae7c6b9e2582490f97098722b8ca8", "sha256:8c3d0d2a5518cb34942fd1eb824bd6effc129fda2e9fdc1fa57e39c7e0cd3672", "sha256:9f92b24f3f66f3ffc025ad9d559357ac198e5af2027ffca1647e02cc75016ba8", "sha256:a729ccff7085e92f57cb677045e841449d63d13c520885997e9db3d189a80f6c", "sha256:b0f396000b123734fe5607ae7f955fba9944a9fc7d047cbc1509156589f29be7", "sha256:b44fed1574e1aa579f1020b270e58f3934f09b7f703febc6ab92ffa819bd662e", + "sha256:b4d853d74381c356ca4c4a42f4a4b51a1933128793aebf1af32d74633a500205", "sha256:bedb5c9a2703802552e5623e81c7dcd843b5c4d791ebc40da23e4277d55005f7", "sha256:c183ba3b544004a045423ae908b3624727bf262280970fc629ae4e0c0307fc8c", "sha256:c3c722b1c12fdae5d7e320282e1a00462a081c27d33281f032d95faeba47d3d4", "sha256:c5b71a1701570544843b10f41fe0dd984cd6532297f98f6b33032e458d1e7113", + "sha256:c5d705c12dd9701592887a8abb842cde5698b4dfa296e24c3fa5d1a69231df52", + "sha256:cfa659534547643f8672999919c691b78c9907e3f683ef618a86f28a99f39d81", "sha256:d3dd4df4118987d85476e356af1dee8f51ef614fa35e1d7b9e0b350bd9830c0f", + "sha256:d9354dbf7bc0c08105870caa9294db5cf506c73d7125468024f6a13f276cf6af", + "sha256:d9a94be583ef2ef3edf00dd05ef83ec57bf4ce38010d0ad11b5baa11ccb19d82", "sha256:ebe0eed05658722ed0394cf5603867ab692a6f388b55dffe7e27f221edd916ae", "sha256:edb57d553488008480b8a26093ffb5d8f7ba94a2447ab6267a43ab3450951be5", - "sha256:fc4d8467f5c1a47bc182068b4ad777d46914b6661f3c02f81804697e045ba712" + "sha256:f607e5e40ff74f515be8681f892d78e5025aab82793e9e1c3316e9a8136402e6", + "sha256:f8009e1e9e1e5e38e657c7e93a27bb5aa50ec334ec747b4a74360bc204770264", + "sha256:fbb8df15d86eca54f9431e54b61aeea892fbb8cc2b090df926f3f165a6ab55b0", + "sha256:fc4d8467f5c1a47bc182068b4ad777d46914b6661f3c02f81804697e045ba712", + "sha256:fdae0521793c4c4a8863e2bdd9e73d0d581ea593b7a72317fd91e1242ecee2f8" ], "index": "pypi", "version": "==6.7.2" @@ -220,21 +175,6 @@ "markers": "python_version >= '3.5'", "version": "==3.3" }, - "importlib-metadata": { - "hashes": [ - "sha256:5d26852efe48c0a32b0509ffbc583fda1a2266545a78d104a6f4aff3db17d700", - "sha256:c58c8eb8a762858f49e18436ff552e83914778e50e9d2f1660535ffb364552ec" - ], - "markers": "python_version < '3.8'", - "version": "==4.11.4" - }, - "iniconfig": { - "hashes": [ - "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3", - "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32" - ], - "version": "==1.1.1" - }, "kubi-ecs-logger": { "hashes": [ "sha256:9ff1b2a297fa4aa46c268a6897bc9af6f76266588e15d28936e4aed6f8a86281" @@ -266,14 +206,6 @@ "markers": "python_version >= '3.6'", "version": "==21.3" }, - "pluggy": { - "hashes": [ - "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159", - "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3" - ], - "markers": "python_version >= '3.6'", - "version": "==1.0.0" - }, "psycopg2": { "hashes": [ "sha256:00195b5f6832dbf2876b8bf77f12bdce648224c89c880719c745b90515233301", @@ -295,14 +227,6 @@ "index": "pypi", "version": "==2.8.6" }, - "py": { - "hashes": [ - "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719", - "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", - "version": "==1.11.0" - }, "pyparsing": { "hashes": [ "sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb", @@ -311,30 +235,6 @@ "markers": "python_full_version >= '3.6.8'", "version": "==3.0.9" }, - "pytest": { - "hashes": [ - "sha256:13d0e3ccfc2b6e26be000cb6568c832ba67ba32e719443bfe725814d3c42433c", - "sha256:a06a0425453864a270bc45e71f783330a7428defb4230fb5e6a731fde06ecd45" - ], - "markers": "python_version >= '3.7'", - "version": "==7.1.2" - }, - "pytest-cov": { - "hashes": [ - "sha256:578d5d15ac4a25e5f961c938b85a05b09fdaae9deef3bb6de9a6e766622ca7a6", - "sha256:e7f0f5b1617d2210a2cabc266dfe2f4c75a8d32fb89eafb7ad9d06f6d076d470" - ], - "index": "pypi", - "version": "==3.0.0" - }, - "pytest-django": { - "hashes": [ - "sha256:c60834861933773109334fe5a53e83d1ef4828f2203a1d6a0fa9972f4f75ab3e", - "sha256:d9076f759bb7c36939dbdd5ae6633c18edfc2902d1a69fdbefd2426b970ce6c2" - ], - "index": "pypi", - "version": "==4.5.2" - }, "python-dateutil": { "hashes": [ "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86", @@ -352,11 +252,11 @@ }, "requests": { "hashes": [ - "sha256:bc7861137fbce630f17b03d3ad02ad0bf978c844f3536d0edda6499dafce2b6f", - "sha256:d568723a7ebd25875d8d1eaf5dfa068cd2fc8194b2e483d7b1f7c81918dbec6b" + "sha256:7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983", + "sha256:8fefa2a1a1365bf5520aac41836fbee479da67864514bdb821f31ce07ce65349" ], "index": "pypi", - "version": "==2.28.0" + "version": "==2.28.1" }, "sentry-sdk": { "hashes": [ @@ -368,11 +268,11 @@ }, "setuptools": { "hashes": [ - "sha256:5a844ad6e190dccc67d6d7411d119c5152ce01f7c76be4d8a1eaa314501bba77", - "sha256:bf8a748ac98b09d32c9a64a995a6b25921c96cc5743c1efa82763ba80ff54e91" + "sha256:16923d366ced322712c71ccb97164d07472abeecd13f3a6c283f6d5d26722793", + "sha256:db3b8e2f922b2a910a29804776c643ea609badb6a32c4bcc226fd4fd902cce65" ], "markers": "python_version >= '3.7'", - "version": "==62.4.0" + "version": "==63.1.0" }, "six": { "hashes": [ @@ -390,14 +290,6 @@ "markers": "python_version >= '3.5'", "version": "==0.4.2" }, - "tomli": { - "hashes": [ - "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", - "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" - ], - "markers": "python_version >= '3.7'", - "version": "==2.0.1" - }, "typed-ast": { "hashes": [ "sha256:01ae5f73431d21eead5015997ab41afa53aa1fbe252f9da060be5dad2c730ace", @@ -436,11 +328,11 @@ }, "typing-extensions": { "hashes": [ - "sha256:6657594ee297170d19f67d55c05852a874e7eb634f4f753dbd667855e07c1708", - "sha256:f1c24655a0da0d1b67f07e17a5e6b2a105894e6824b92096378bb3668ef02376" + "sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02", + "sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6" ], "markers": "python_version < '3.8'", - "version": "==4.2.0" + "version": "==4.3.0" }, "unidecode": { "hashes": [ @@ -452,19 +344,11 @@ }, "urllib3": { "hashes": [ - "sha256:44ece4d53fb1706f667c9bd1c648f5469a2ec925fcf3a776667042d645472c14", - "sha256:aabaf16477806a5e1dd19aa41f8c2b7950dd3c746362d7e3223dbe6de6ac448e" + "sha256:8298d6d56d39be0e3bc13c1c97d133f9b45d797169a0e11cdd0e0489d786f7ec", + "sha256:879ba4d1e89654d9769ce13121e0f94310ea32e8d2f8cf587b77c08bbcdb30d6" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.9" - }, - "zipp": { - "hashes": [ - "sha256:56bf8aadb83c24db6c4b577e13de374ccfb67da2078beba1d037c17980bf43ad", - "sha256:c4f6e5bbf48e74f7a38e7cc5b0480ff42b0ae5178957d564d18932525d5cf099" - ], - "markers": "python_version >= '3.7'", - "version": "==3.8.0" + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5' and python_version < '4'", + "version": "==1.26.10" } }, "develop": { @@ -545,54 +429,63 @@ "version": "==8.1.3" }, "coverage": { - "extras": [ - "toml" - ], - "hashes": [ - "sha256:01c5615d13f3dd3aa8543afc069e5319cfa0c7d712f6e04b920431e5c564a749", - "sha256:106c16dfe494de3193ec55cac9640dd039b66e196e4641fa8ac396181578b982", - "sha256:129cd05ba6f0d08a766d942a9ed4b29283aff7b2cccf5b7ce279d50796860bb3", - "sha256:145f296d00441ca703a659e8f3eb48ae39fb083baba2d7ce4482fb2723e050d9", - "sha256:1480ff858b4113db2718848d7b2d1b75bc79895a9c22e76a221b9d8d62496428", - "sha256:269eaa2c20a13a5bf17558d4dc91a8d078c4fa1872f25303dddcbba3a813085e", - "sha256:26dff09fb0d82693ba9e6231248641d60ba606150d02ed45110f9ec26404ed1c", - "sha256:2bd9a6fc18aab8d2e18f89b7ff91c0f34ff4d5e0ba0b33e989b3cd4194c81fd9", - "sha256:309ce4a522ed5fca432af4ebe0f32b21d6d7ccbb0f5fcc99290e71feba67c264", - "sha256:3384f2a3652cef289e38100f2d037956194a837221edd520a7ee5b42d00cc605", - "sha256:342d4aefd1c3e7f620a13f4fe563154d808b69cccef415415aece4c786665397", - "sha256:39ee53946bf009788108b4dd2894bf1349b4e0ca18c2016ffa7d26ce46b8f10d", - "sha256:4321f075095a096e70aff1d002030ee612b65a205a0a0f5b815280d5dc58100c", - "sha256:4803e7ccf93230accb928f3a68f00ffa80a88213af98ed338a57ad021ef06815", - "sha256:4ce1b258493cbf8aec43e9b50d89982346b98e9ffdfaae8ae5793bc112fb0068", - "sha256:664a47ce62fe4bef9e2d2c430306e1428ecea207ffd68649e3b942fa8ea83b0b", - "sha256:75ab269400706fab15981fd4bd5080c56bd5cc07c3bccb86aab5e1d5a88dc8f4", - "sha256:83c4e737f60c6936460c5be330d296dd5b48b3963f48634c53b3f7deb0f34ec4", - "sha256:84631e81dd053e8a0d4967cedab6db94345f1c36107c71698f746cb2636c63e3", - "sha256:84e65ef149028516c6d64461b95a8dbcfce95cfd5b9eb634320596173332ea84", - "sha256:865d69ae811a392f4d06bde506d531f6a28a00af36f5c8649684a9e5e4a85c83", - "sha256:87f4f3df85aa39da00fd3ec4b5abeb7407e82b68c7c5ad181308b0e2526da5d4", - "sha256:8c08da0bd238f2970230c2a0d28ff0e99961598cb2e810245d7fc5afcf1254e8", - "sha256:961e2fb0680b4f5ad63234e0bf55dfb90d302740ae9c7ed0120677a94a1590cb", - "sha256:9b3e07152b4563722be523e8cd0b209e0d1a373022cfbde395ebb6575bf6790d", - "sha256:a7f3049243783df2e6cc6deafc49ea123522b59f464831476d3d1448e30d72df", - "sha256:bf5601c33213d3cb19d17a796f8a14a9eaa5e87629a53979a5981e3e3ae166f6", - "sha256:cec3a0f75c8f1031825e19cd86ee787e87cf03e4fd2865c79c057092e69e3a3b", - "sha256:d42c549a8f41dc103a8004b9f0c433e2086add8a719da00e246e17cbe4056f72", - "sha256:d67d44996140af8b84284e5e7d398e589574b376fb4de8ccd28d82ad8e3bea13", - "sha256:d9c80df769f5ec05ad21ea34be7458d1dc51ff1fb4b2219e77fe24edf462d6df", - "sha256:e57816f8ffe46b1df8f12e1b348f06d164fd5219beba7d9433ba79608ef011cc", - "sha256:ee2ddcac99b2d2aec413e36d7a429ae9ebcadf912946b13ffa88e7d4c9b712d6", - "sha256:f02cbbf8119db68455b9d763f2f8737bb7db7e43720afa07d8eb1604e5c5ae28", - "sha256:f1d5aa2703e1dab4ae6cf416eb0095304f49d004c39e9db1d86f57924f43006b", - "sha256:f5b66caa62922531059bc5ac04f836860412f7f88d38a476eda0a6f11d4724f4", - "sha256:f69718750eaae75efe506406c490d6fc5a6161d047206cc63ce25527e8a3adad", - "sha256:fb73e0011b8793c053bfa85e53129ba5f0250fdc0392c1591fd35d915ec75c46", - "sha256:fd180ed867e289964404051a958f7cccabdeed423f91a899829264bb7974d3d3", - "sha256:fdb6f7bd51c2d1714cea40718f6149ad9be6a2ee7d93b19e9f00934c0f2a74d9", - "sha256:ffa9297c3a453fba4717d06df579af42ab9a28022444cae7fa605af4df612d54" + "extras": [], + "hashes": [ + "sha256:004d1880bed2d97151facef49f08e255a20ceb6f9432df75f4eef018fdd5a78c", + "sha256:01d84219b5cdbfc8122223b39a954820929497a1cb1422824bb86b07b74594b6", + "sha256:040af6c32813fa3eae5305d53f18875bedd079960822ef8ec067a66dd8afcd45", + "sha256:06191eb60f8d8a5bc046f3799f8a07a2d7aefb9504b0209aff0b47298333302a", + "sha256:13034c4409db851670bc9acd836243aeee299949bd5673e11844befcb0149f03", + "sha256:13c4ee887eca0f4c5a247b75398d4114c37882658300e153113dafb1d76de529", + "sha256:184a47bbe0aa6400ed2d41d8e9ed868b8205046518c52464fde713ea06e3a74a", + "sha256:18ba8bbede96a2c3dde7b868de9dcbd55670690af0988713f0603f037848418a", + "sha256:1aa846f56c3d49205c952d8318e76ccc2ae23303351d9270ab220004c580cfe2", + "sha256:217658ec7187497e3f3ebd901afdca1af062b42cfe3e0dafea4cced3983739f6", + "sha256:24d4a7de75446be83244eabbff746d66b9240ae020ced65d060815fac3423759", + "sha256:2910f4d36a6a9b4214bb7038d537f015346f413a975d57ca6b43bf23d6563b53", + "sha256:2949cad1c5208b8298d5686d5a85b66aae46d73eec2c3e08c817dd3513e5848a", + "sha256:2a3859cb82dcbda1cfd3e6f71c27081d18aa251d20a17d87d26d4cd216fb0af4", + "sha256:2cafbbb3af0733db200c9b5f798d18953b1a304d3f86a938367de1567f4b5bff", + "sha256:2e0d881ad471768bf6e6c2bf905d183543f10098e3b3640fc029509530091502", + "sha256:30c77c1dc9f253283e34c27935fded5015f7d1abe83bc7821680ac444eaf7793", + "sha256:3487286bc29a5aa4b93a072e9592f22254291ce96a9fbc5251f566b6b7343cdb", + "sha256:372da284cfd642d8e08ef606917846fa2ee350f64994bebfbd3afb0040436905", + "sha256:41179b8a845742d1eb60449bdb2992196e211341818565abded11cfa90efb821", + "sha256:44d654437b8ddd9eee7d1eaee28b7219bec228520ff809af170488fd2fed3e2b", + "sha256:4a7697d8cb0f27399b0e393c0b90f0f1e40c82023ea4d45d22bce7032a5d7b81", + "sha256:51cb9476a3987c8967ebab3f0fe144819781fca264f57f89760037a2ea191cb0", + "sha256:52596d3d0e8bdf3af43db3e9ba8dcdaac724ba7b5ca3f6358529d56f7a166f8b", + "sha256:53194af30d5bad77fcba80e23a1441c71abfb3e01192034f8246e0d8f99528f3", + "sha256:5fec2d43a2cc6965edc0bb9e83e1e4b557f76f843a77a2496cbe719583ce8184", + "sha256:6c90e11318f0d3c436a42409f2749ee1a115cd8b067d7f14c148f1ce5574d701", + "sha256:74d881fc777ebb11c63736622b60cb9e4aee5cace591ce274fb69e582a12a61a", + "sha256:7501140f755b725495941b43347ba8a2777407fc7f250d4f5a7d2a1050ba8e82", + "sha256:796c9c3c79747146ebd278dbe1e5c5c05dd6b10cc3bcb8389dfdf844f3ead638", + "sha256:869a64f53488f40fa5b5b9dcb9e9b2962a66a87dab37790f3fcfb5144b996ef5", + "sha256:8963a499849a1fc54b35b1c9f162f4108017b2e6db2c46c1bed93a72262ed083", + "sha256:8d0a0725ad7c1a0bcd8d1b437e191107d457e2ec1084b9f190630a4fb1af78e6", + "sha256:900fbf7759501bc7807fd6638c947d7a831fc9fdf742dc10f02956ff7220fa90", + "sha256:92b017ce34b68a7d67bd6d117e6d443a9bf63a2ecf8567bb3d8c6c7bc5014465", + "sha256:970284a88b99673ccb2e4e334cfb38a10aab7cd44f7457564d11898a74b62d0a", + "sha256:972c85d205b51e30e59525694670de6a8a89691186012535f9d7dbaa230e42c3", + "sha256:9a1ef3b66e38ef8618ce5fdc7bea3d9f45f3624e2a66295eea5e57966c85909e", + "sha256:af0e781009aaf59e25c5a678122391cb0f345ac0ec272c7961dc5455e1c40066", + "sha256:b6d534e4b2ab35c9f93f46229363e17f63c53ad01330df9f2d6bd1187e5eaacf", + "sha256:b7895207b4c843c76a25ab8c1e866261bcfe27bfaa20c192de5190121770672b", + "sha256:c0891a6a97b09c1f3e073a890514d5012eb256845c451bd48f7968ef939bf4ae", + "sha256:c2723d347ab06e7ddad1a58b2a821218239249a9e4365eaff6649d31180c1669", + "sha256:d1f8bf7b90ba55699b3a5e44930e93ff0189aa27186e96071fac7dd0d06a1873", + "sha256:d1f9ce122f83b2305592c11d64f181b87153fc2c2bbd3bb4a3dde8303cfb1a6b", + "sha256:d314ed732c25d29775e84a960c3c60808b682c08d86602ec2c3008e1202e3bb6", + "sha256:d636598c8305e1f90b439dbf4f66437de4a5e3c31fdf47ad29542478c8508bbb", + "sha256:deee1077aae10d8fa88cb02c845cfba9b62c55e1183f52f6ae6a2df6a2187160", + "sha256:ebe78fe9a0e874362175b02371bdfbee64d8edc42a044253ddf4ee7d3c15212c", + "sha256:f030f8873312a16414c0d8e1a1ddff2d3235655a2174e3648b4fa66b3f2f1079", + "sha256:f0b278ce10936db1a37e6954e15a3730bea96a0997c26d7fee88e6c396c2086d", + "sha256:f11642dddbb0253cc8853254301b51390ba0081750a8ac03f20ea8103f0c56b6" ], - "markers": "python_version >= '3.7'", - "version": "==6.4.1" + "index": "pypi", + "version": "==5.5" }, "decorator": { "hashes": [ @@ -614,11 +507,11 @@ }, "django-extensions": { "hashes": [ - "sha256:28e1e1bf49f0e00307ba574d645b0af3564c981a6dfc87209d48cb98f77d0b1a", - "sha256:9238b9e016bb0009d621e05cf56ea8ce5cce9b32e91ad2026996a7377ca28069" + "sha256:4c234a7236e9e41c17d9036f6dae7a3a9b212527105b8a0d24b2459b267825f0", + "sha256:7dc7cd1da50d83b76447a58f5d7e5c8e6cd83f21e9b7e5f97e6b644f4d4e21a6" ], "index": "pypi", - "version": "==3.1.5" + "version": "==3.2.0" }, "dodgy": { "hashes": [ @@ -645,11 +538,11 @@ }, "importlib-metadata": { "hashes": [ - "sha256:5d26852efe48c0a32b0509ffbc583fda1a2266545a78d104a6f4aff3db17d700", - "sha256:c58c8eb8a762858f49e18436ff552e83914778e50e9d2f1660535ffb364552ec" + "sha256:637245b8bab2b6502fcbc752cc4b7a6f6243bb02b31c5c26156ad103d3d45670", + "sha256:7401a975809ea1fdc658c3aa4f78cc2195a0e019c5cbc4c06122884e9ae80c23" ], "markers": "python_version < '3.8'", - "version": "==4.11.4" + "version": "==4.12.0" }, "iniconfig": { "hashes": [ @@ -842,11 +735,11 @@ }, "prompt-toolkit": { "hashes": [ - "sha256:62291dad495e665fca0bda814e342c69952086afb0f4094d0893d357e5c78752", - "sha256:bd640f60e8cecd74f0dc249713d433ace2ddc62b65ee07f96d358e0b152b6ea7" + "sha256:859b283c50bde45f5f97829f77a4674d1c1fcd88539364f1b28a37805cfd89c0", + "sha256:d8916d3f62a7b67ab353a952ce4ced6a1d2587dfe9ef8ebc30dd7c386751f289" ], "markers": "python_full_version >= '3.6.2'", - "version": "==3.0.29" + "version": "==3.0.30" }, "prospector": { "hashes": [ @@ -949,7 +842,7 @@ "sha256:13d0e3ccfc2b6e26be000cb6568c832ba67ba32e719443bfe725814d3c42433c", "sha256:a06a0425453864a270bc45e71f783330a7428defb4230fb5e6a731fde06ecd45" ], - "markers": "python_version >= '3.7'", + "index": "pypi", "version": "==7.1.2" }, "pytest-cov": { @@ -1032,11 +925,11 @@ }, "setuptools": { "hashes": [ - "sha256:5a844ad6e190dccc67d6d7411d119c5152ce01f7c76be4d8a1eaa314501bba77", - "sha256:bf8a748ac98b09d32c9a64a995a6b25921c96cc5743c1efa82763ba80ff54e91" + "sha256:16923d366ced322712c71ccb97164d07472abeecd13f3a6c283f6d5d26722793", + "sha256:db3b8e2f922b2a910a29804776c643ea609badb6a32c4bcc226fd4fd902cce65" ], "markers": "python_version >= '3.7'", - "version": "==62.4.0" + "version": "==63.1.0" }, "six": { "hashes": [ @@ -1090,16 +983,16 @@ "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" ], - "markers": "python_version >= '3.7'", + "markers": "python_version < '3.11'", "version": "==2.0.1" }, "traitlets": { "hashes": [ - "sha256:1530d04badddc6a73d50b7ee34667d4b96914da352109117b4280cb56523a51b", - "sha256:74803a1baa59af70f023671d86d5c7a834c931186df26d50d362ee6a1ff021fd" + "sha256:0bb9f1f9f017aa8ec187d8b1b2a7a6626a2a1d877116baba52a129bfa124f8e2", + "sha256:65fa18961659635933100db8ca120ef6220555286949774b9cfc106f941d1c7a" ], "markers": "python_version >= '3.7'", - "version": "==5.2.2.post1" + "version": "==5.3.0" }, "typed-ast": { "hashes": [ @@ -1139,11 +1032,11 @@ }, "typing-extensions": { "hashes": [ - "sha256:6657594ee297170d19f67d55c05852a874e7eb634f4f753dbd667855e07c1708", - "sha256:f1c24655a0da0d1b67f07e17a5e6b2a105894e6824b92096378bb3668ef02376" + "sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02", + "sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6" ], "markers": "python_version < '3.8'", - "version": "==4.2.0" + "version": "==4.3.0" }, "wcwidth": { "hashes": [ @@ -1224,11 +1117,11 @@ }, "zipp": { "hashes": [ - "sha256:56bf8aadb83c24db6c4b577e13de374ccfb67da2078beba1d037c17980bf43ad", - "sha256:c4f6e5bbf48e74f7a38e7cc5b0480ff42b0ae5178957d564d18932525d5cf099" + "sha256:05b45f1ee8f807d0cc928485ca40a07cb491cf092ff587c0df9cb1fd154848d2", + "sha256:47c40d7fe183a6f21403a199b3e4192cca5774656965b0a4988ad2f8feb5f009" ], "markers": "python_version >= '3.7'", - "version": "==3.8.0" + "version": "==3.8.1" } } } From e7c759b6ce6af26c9595ee9edfdb22198fa6157f Mon Sep 17 00:00:00 2001 From: Arun Siluvery Date: Wed, 13 Jul 2022 11:46:35 +0100 Subject: [PATCH 5/6] Re-install django-jsonfield as it is required for intial migrations But it is not used in the models. We can probably remove it altogether if we can squash migrations later. --- Pipfile | 1 + Pipfile.lock | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Pipfile b/Pipfile index d22ac417..d709315b 100644 --- a/Pipfile +++ b/Pipfile @@ -32,6 +32,7 @@ django-log-formatter-ecs = "==0.0.5" gunicorn = "*" django = "==3.2.14" elastic-apm = "==6.7.2" +django-jsonfield = "==1.4" [requires] python_version = "3.7" diff --git a/Pipfile.lock b/Pipfile.lock index 7fb9a6b6..02ed2d30 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "c42485ee36357152138e8a5e0b0fc516260b4b5af2a40041e96ae94abacb93b1" + "sha256": "d0050a437ba1404efb1eea01b403e99e487c49b7b75285abf9a31e7ece98ef74" }, "pipfile-spec": 6, "requires": { @@ -79,6 +79,14 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", "version": "==3.0.7" }, + "django-jsonfield": { + "hashes": [ + "sha256:7bdd0ea75ad842b9e33decdf343398c91fbb7bd664fde0648ef83e78b0453b6e", + "sha256:9b3dac9f7352a6d37e9cfe0126c5b58ac7abf1cb20c0da294a00269a725223f1" + ], + "index": "pypi", + "version": "==1.4" + }, "django-log-formatter-ecs": { "hashes": [ "sha256:1e8731dd25a11ac64e789f19931e12fe7ef8ad1a172b7bceb2ea5cab185a583e", From ebe54c42daa8f98b84a0b2b90f3e6bea59c3283b Mon Sep 17 00:00:00 2001 From: Arun Siluvery Date: Wed, 13 Jul 2022 12:43:25 +0100 Subject: [PATCH 6/6] Add tests for healthcheck view v2: Address review comments - use request object from self instead of passing it --- conf/tests/test_healthcheck.py | 65 ++++++++++++++++++++++++++++++++++ conf/urls.py | 2 +- conf/views.py | 7 ++-- 3 files changed, 69 insertions(+), 5 deletions(-) create mode 100644 conf/tests/test_healthcheck.py diff --git a/conf/tests/test_healthcheck.py b/conf/tests/test_healthcheck.py new file mode 100644 index 00000000..5f0ab259 --- /dev/null +++ b/conf/tests/test_healthcheck.py @@ -0,0 +1,65 @@ +from datetime import timedelta + +from background_task.models import Task +from django.conf import settings +from django.test import testcases +from django.urls import reverse +from django.utils import timezone +from rest_framework import status + +from mail.enums import ReceptionStatusEnum, ReplyStatusEnum +from mail.models import Mail +from mail.tasks import LICENCE_DATA_TASK_QUEUE, MANAGE_INBOX_TASK_QUEUE + + +class TestHealthcheck(testcases.TestCase): + def setUp(self): + self.url = reverse("healthcheck") + + def test_healthcheck_return_ok(self): + response = self.client.get(self.url) + self.assertEqual(response.context["message"], "OK") + self.assertEqual(response.context["status"], status.HTTP_200_OK) + + def test_healthcheck_service_unavailable_pending_mail(self): + sent_at = timezone.now() - timedelta(seconds=settings.EMAIL_AWAITING_REPLY_TIME) + Mail.objects.create( + edi_filename="filename", + edi_data="1\\fileHeader\\CHIEF\\SPIRE\\", + status=ReplyStatusEnum.PENDING, + sent_at=sent_at, + ) + response = self.client.get(self.url) + self.assertEqual(response.context["message"], "not OK") + self.assertEqual(response.context["status"], status.HTTP_503_SERVICE_UNAVAILABLE) + + def test_healthcheck_service_unavailable_rejected_mail(self): + sent_at = timezone.now() - timedelta(seconds=settings.EMAIL_AWAITING_CORRECTIONS_TIME) + Mail.objects.create( + edi_filename="filename", + edi_data="1\\fileHeader\\CHIEF\\SPIRE\\", + response_data="1\\line1\\rejected\\", + status=ReceptionStatusEnum.REPLY_SENT, + sent_at=sent_at, + ) + response = self.client.get(self.url) + self.assertEqual(response.context["message"], "not OK") + self.assertEqual(response.context["status"], status.HTTP_503_SERVICE_UNAVAILABLE) + + def test_healthcheck_service_unavailable_inbox_task_not_responsive(self): + run_at = timezone.now() + timedelta(minutes=settings.INBOX_POLL_INTERVAL) + task, _ = Task.objects.get_or_create(queue=MANAGE_INBOX_TASK_QUEUE) + task.run_at = run_at + task.save() + response = self.client.get(self.url) + self.assertEqual(response.context["message"], "not OK") + self.assertEqual(response.context["status"], status.HTTP_503_SERVICE_UNAVAILABLE) + + def test_healthcheck_service_unavailable_licence_update_task_not_responsive(self): + run_at = timezone.now() + timedelta(minutes=settings.LITE_LICENCE_DATA_POLL_INTERVAL) + task, _ = Task.objects.get_or_create(queue=LICENCE_DATA_TASK_QUEUE) + task.run_at = run_at + task.save() + response = self.client.get(self.url) + self.assertEqual(response.context["message"], "not OK") + self.assertEqual(response.context["status"], status.HTTP_503_SERVICE_UNAVAILABLE) diff --git a/conf/urls.py b/conf/urls.py index 74eb57aa..ec6f86ca 100644 --- a/conf/urls.py +++ b/conf/urls.py @@ -22,7 +22,7 @@ urlpatterns = [ path("admin/", admin.site.urls), path("mail/", include("mail.urls")), - path("healthcheck/", HealthCheck.as_view()), + path("healthcheck/", HealthCheck.as_view(), name="healthcheck"), ] if settings.ENABLE_MOCK_HMRC_SERVICE: diff --git a/conf/views.py b/conf/views.py index c441608b..eb62fd19 100644 --- a/conf/views.py +++ b/conf/views.py @@ -82,10 +82,9 @@ def _get_rejected_mail() -> []: ).values_list("id", flat=True) ) - @staticmethod - def _build_response(status, message, start_time): + def _build_response(self, status, message, start_time): duration_ms = (time.time() - start_time) * 1000 response_time = "{:.3f}".format(duration_ms) - context = {"message": message, "response_time": response_time} + context = {"message": message, "response_time": response_time, "status": status} - return render("healthcheck.xml", context, content_type="application/xml", status=status) + return render(self.request, "healthcheck.xml", context, content_type="application/xml", status=status)