diff --git a/CHANGELOG.md b/CHANGELOG.md index 3933d297..6b3dd9b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,21 @@ ## Pre-release +### Implemented enhancements +- no ticked - Add APM support +- XOT-1341 - Make fields 3* optional fields + +## 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) 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/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. 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/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 202a387e..81747880 100644 --- a/export_readiness/models.py +++ b/export_readiness/models.py @@ -132,15 +132,39 @@ 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) - 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, 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