From 381e21952e825270cd48950675bc5d0cf6b51752 Mon Sep 17 00:00:00 2001 From: richtier Date: Wed, 22 Apr 2020 10:27:51 +0100 Subject: [PATCH 1/5] Post deployment changelog --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3933d297..187de00e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,18 @@ ## Pre-release +### Implemented enhancements +## Fixed bugs + + +## [2020.04.22](https://github.com/uktrade/directory-cms/releases/tag/2020.04.22) +[Full Changelog](https://github.com/uktrade/directory-cms/compare/2020.03.23...2020.04.22) + ### Implemented enhancements - CI-677 - Add CTA link field to Capital Investment homepage hero - no ticket - Add cache supoort to draft pages -## Hotfix +## Fixed bugs - No ticket - v3-cipipeline manifest.yml file fix ## [2020.03.23](https://github.com/uktrade/directory-cms/releases/tag/2020.03.23) From 9e3589119ee71c1c9d4128e7a458d82c637c0df0 Mon Sep 17 00:00:00 2001 From: richtier Date: Thu, 30 Apr 2020 16:34:39 +0100 Subject: [PATCH 2/5] no ticked - Add APM support --- CHANGELOG.md | 2 ++ conf/settings.py | 13 ++++++++++++- requirements.in | 1 + requirements.txt | 5 +++-- requirements_test.txt | 5 +++-- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 187de00e..c928cac7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## Pre-release ### Implemented enhancements +- no ticked - Add APM support + ## Fixed bugs diff --git a/conf/settings.py b/conf/settings.py index 2398af12..10ebba62 100644 --- a/conf/settings.py +++ b/conf/settings.py @@ -91,7 +91,8 @@ 'activitystream.apps.ActivityStreamConfig', 'django_filters', 'authbroker_client', - 'django_celery_beat' + 'django_celery_beat', + 'elasticapm.contrib.django', ] MIDDLEWARE = [ @@ -479,3 +480,13 @@ # Activity Stream API ACTIVITY_STREAM_ACCESS_KEY_ID = env.str('ACTIVITY_STREAM_ACCESS_KEY_ID') ACTIVITY_STREAM_SECRET_ACCESS_KEY = env.str('ACTIVITY_STREAM_SECRET_ACCESS_KEY') + +# Application Performance Monitoring +if env.str('ELASTIC_APM_SERVER_URL', ''): + ELASTIC_APM = { + 'SERVICE_NAME': env.str('ELASTIC_APM_SERVICE_NAME', 'directory-cms'), + 'SECRET_TOKEN': env.str('ELASTIC_APM_SECRET_TOKEN'), + 'SERVER_URL': env.str('ELASTIC_APM_SERVER_URL'), + 'ENVIRONMENT': env.str('SENTRY_ENVIRONMENT'), + 'DEBUG': DEBUG, + } diff --git a/requirements.in b/requirements.in index 8a37d141..7dd17218 100644 --- a/requirements.in +++ b/requirements.in @@ -36,3 +36,4 @@ notifications-python-client==5.3.* pillow>=6.2.0 # for security fix. check compatibility on next wagtail upgrade num2words==0.5.10 pycountry==19.8.18 +elastic-apm>=5.5.2,<6.0.0 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index f5ed2c6b..97413aae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,7 +13,7 @@ bleach==3.1.1 # via -r requirements.in boto3==1.6.3 # via -r requirements.in botocore==1.9.23 # via boto3, s3transfer celery[redis]==4.3.0 # via -r requirements.in, django-celery-beat -certifi==2019.11.28 # via requests, sentry-sdk +certifi==2019.11.28 # via elastic-apm, requests, sentry-sdk chardet==3.0.4 # via requests directory-components==20.0.0 # via -r requirements.in directory-constants==18.6.0 # via -r requirements.in, directory-components @@ -39,6 +39,7 @@ djangorestframework==3.9.4 # via -r requirements.in, sigauth, wagtail docopt==0.6.2 # via notifications-python-client, num2words docutils==0.15.2 # via botocore draftjs-exporter==2.1.7 # via wagtail +elastic-apm==5.5.2 # via -r requirements.in future==0.18.2 # via notifications-python-client gevent==1.2.2 # via -r requirements.in greenlet==0.4.15 # via gevent @@ -76,7 +77,7 @@ sigauth==4.1.0 # via -r requirements.in six==1.13.0 # via bleach, html5lib, jsonschema, mohawk, pyrsistent, python-dateutil, w3lib, wagtail sqlparse==0.3.0 # via django unidecode==1.1.1 # via wagtail -urllib3==1.24.3 # via -r requirements.in, requests, sentry-sdk +urllib3==1.24.3 # via -r requirements.in, elastic-apm, requests, sentry-sdk vine==1.3.0 # via amqp, celery w3lib==1.21.0 # via -r requirements.in wagtail-modeltranslation==0.10.2 # via -r requirements.in diff --git a/requirements_test.txt b/requirements_test.txt index f7921bdc..1c38aef2 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -14,7 +14,7 @@ bleach==3.1.1 # via -r requirements.in boto3==1.6.3 # via -r requirements.in botocore==1.9.23 # via boto3, s3transfer celery[redis]==4.2.1 # via -r requirements.in, django-celery-beat -certifi==2018.11.29 # via requests, sentry-sdk +certifi==2018.11.29 # via elastic-apm, requests, sentry-sdk chardet==3.0.4 # via requests click==7.0 # via pip-tools coverage==4.5.2 # via coveralls, pytest-cov @@ -44,6 +44,7 @@ djangorestframework==3.9.4 # via -r requirements.in, sigauth, wagtail docopt==0.6.2 # via coveralls, notifications-python-client, num2words docutils==0.14 # via botocore draftjs-exporter==2.1.5 # via wagtail +elastic-apm==5.5.2 # via -r requirements.in factory-boy==2.8.1 # via -r requirements_test.in, wagtail-factories faker==1.0.1 # via factory-boy flake8==3.6.0 # via -r requirements_test.in @@ -100,7 +101,7 @@ sqlparse==0.2.4 # via django, django-debug-toolbar termcolor==1.1.0 # via pytest-sugar text-unidecode==1.2 # via faker unidecode==1.0.23 # via wagtail -urllib3==1.24.2 # via -r requirements.in, requests, sentry-sdk +urllib3==1.24.2 # via -r requirements.in, elastic-apm, requests, sentry-sdk vine==1.1.4 # via amqp w3lib==1.20.0 # via -r requirements.in wagtail-factories==2.0.0 # via -r requirements_test.in From db6ea96c031c29f16378d020e986f4a366c827d6 Mon Sep 17 00:00:00 2001 From: gatwal Date: Mon, 18 May 2020 10:40:30 +0100 Subject: [PATCH 3/5] change model --- CHANGELOG.md | 1 + .../migrations/0074_auto_20200518_0916.py | 34 +++++++++++++++++++ export_readiness/models.py | 20 ++++++++--- 3 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 export_readiness/migrations/0074_auto_20200518_0916.py diff --git a/CHANGELOG.md b/CHANGELOG.md index c928cac7..6b3dd9b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Implemented enhancements - no ticked - Add APM support +- XOT-1341 - Make fields 3* optional fields ## Fixed bugs diff --git a/export_readiness/migrations/0074_auto_20200518_0916.py b/export_readiness/migrations/0074_auto_20200518_0916.py new file mode 100644 index 00000000..ca324426 --- /dev/null +++ b/export_readiness/migrations/0074_auto_20200518_0916.py @@ -0,0 +1,34 @@ +# Generated by Django 2.2.10 on 2020-05-18 09:16 + +import core.model_fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('export_readiness', '0073_auto_20200203_1333'), + ] + + operations = [ + migrations.AlterField( + model_name='performancedashboardpage', + name='data_description_row_three', + field=core.model_fields.MarkdownField(blank=True, null=True), + ), + migrations.AlterField( + model_name='performancedashboardpage', + name='data_number_row_three', + field=models.CharField(blank=True, max_length=15, null=True), + ), + migrations.AlterField( + model_name='performancedashboardpage', + name='data_period_row_three', + field=models.CharField(blank=True, max_length=100, null=True), + ), + migrations.AlterField( + model_name='performancedashboardpage', + name='data_title_row_three', + field=models.CharField(blank=True, max_length=100, null=True), + ), + ] diff --git a/export_readiness/models.py b/export_readiness/models.py index 202a387e..25eb6c10 100644 --- a/export_readiness/models.py +++ b/export_readiness/models.py @@ -137,10 +137,22 @@ class PerformanceDashboardPage(panels.PerformanceDashboardPagePanels, BaseDomest data_period_row_two = models.CharField(max_length=100) data_description_row_two = MarkdownField() # row 3 - data_title_row_three = models.CharField(max_length=100) - data_number_row_three = models.CharField(max_length=15) - data_period_row_three = models.CharField(max_length=100) - data_description_row_three = MarkdownField() + data_title_row_three = models.CharField( + max_length=100, + blank=True, + null=True, + ) + data_number_row_three = models.CharField( + max_length=15, + blank=True, + null=True, + ) + data_period_row_three = models.CharField( + max_length=100, + blank=True, + null=True, + ) + data_description_row_three = MarkdownField(blank=True, null=True) # row 4 data_title_row_four = models.CharField( max_length=100, From 99f0e93eb6af8b73426a59d360621c560f1d1ac1 Mon Sep 17 00:00:00 2001 From: gatwal Date: Mon, 18 May 2020 10:50:53 +0100 Subject: [PATCH 4/5] fix f8 --- core/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/views.py b/core/views.py index 33b63367..730992c2 100644 --- a/core/views.py +++ b/core/views.py @@ -117,7 +117,7 @@ def detail_view(self, request, **kwargs): # Reuse the already-fetched object to populate the cache cache.CachePopulator.populate_async(self.get_object()) - logger.warn(f'Page cache miss') + logger.warn('Page cache miss') # No etag is set for this response because creating one is expensive. # If API caching is enabled, one will be added to the cached version # created above. From 1ea12eaf814c187514199ebe1205c88da28a96b4 Mon Sep 17 00:00:00 2001 From: gatwal Date: Mon, 18 May 2020 13:53:26 +0100 Subject: [PATCH 5/5] make optional fields --- .../migrations/0075_auto_20200518_1253.py | 34 +++++++++++++++++++ export_readiness/models.py | 20 ++++++++--- 2 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 export_readiness/migrations/0075_auto_20200518_1253.py diff --git a/export_readiness/migrations/0075_auto_20200518_1253.py b/export_readiness/migrations/0075_auto_20200518_1253.py new file mode 100644 index 00000000..e98b4302 --- /dev/null +++ b/export_readiness/migrations/0075_auto_20200518_1253.py @@ -0,0 +1,34 @@ +# Generated by Django 2.2.10 on 2020-05-18 12:53 + +import core.model_fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('export_readiness', '0074_auto_20200518_0916'), + ] + + operations = [ + migrations.AlterField( + model_name='performancedashboardpage', + name='data_description_row_two', + field=core.model_fields.MarkdownField(blank=True, null=True), + ), + migrations.AlterField( + model_name='performancedashboardpage', + name='data_number_row_two', + field=models.CharField(blank=True, max_length=15, null=True), + ), + migrations.AlterField( + model_name='performancedashboardpage', + name='data_period_row_two', + field=models.CharField(blank=True, max_length=100, null=True), + ), + migrations.AlterField( + model_name='performancedashboardpage', + name='data_title_row_two', + field=models.CharField(blank=True, max_length=100, null=True), + ), + ] diff --git a/export_readiness/models.py b/export_readiness/models.py index 25eb6c10..81747880 100644 --- a/export_readiness/models.py +++ b/export_readiness/models.py @@ -132,10 +132,22 @@ class PerformanceDashboardPage(panels.PerformanceDashboardPagePanels, BaseDomest data_period_row_one = models.CharField(max_length=100) data_description_row_one = MarkdownField() # row 2 - data_title_row_two = models.CharField(max_length=100) - data_number_row_two = models.CharField(max_length=15) - data_period_row_two = models.CharField(max_length=100) - data_description_row_two = MarkdownField() + data_title_row_two = models.CharField( + max_length=100, + blank=True, + null=True, + ) + data_number_row_two = models.CharField( + max_length=15, + blank=True, + null=True, + ) + data_period_row_two = models.CharField( + max_length=100, + blank=True, + null=True, + ) + data_description_row_two = MarkdownField(blank=True, null=True) # row 3 data_title_row_three = models.CharField( max_length=100,