Records breaking changes from major version bumps
PR: #266
Logs will be written to a file or stdout/stderr based on the value of DM_LOG_PATH
, even for environments with DEBUG = True
.
To write logs to stderr DM_LOG_PATH
should be set to a falsy value (eg None
or empty string). Currently, most app configs
set DM_LOG_PATH
to /var/log/...
in the shared config. This declaration should be moved to Preview/Staging/Production configs,
with the shared default set to None
.
Old:
class Config(object):
DM_LOG_PATH = '/var/log/digitalmarketplace/application.log'
class Live(object):
pass
New:
class Config(object):
DM_LOG_PATH = None
class Live(object):
DM_LOG_PATH = '/var/log/digitalmarketplace/application.log'
PR: #264
Removed content_loader.py to a separate package which can be found here. The associated tests were
moved too. Any app which imported the content loader form dmutils will need to be updated to import
from it's new location. To import the new package, add git+https://github.com/alphagov/[email protected]#egg=digitalmarketplace-content-loader==1.0.0
to it's requirements.txt
.
Removed a couple of functions from formats.py
. format_price
was only used by content_loader
so it made sense to move it to the new package. format_service_price
is a dependency of format_price
and so was also moved. It is imported by the front end apps however so they will need updating to import
from it's new location before they can use this version of dmutils.
Mocked a dependency on ContentSection
from test_documents.py
. As ContentSection
is part of the
content loader and has been moved to the new package, it made sense to mock the dependency.
Old:
from dmutils.content_loader import ContentSection
New:
from dmcontent.content_loader import ContentSection
PR: #248
Removed the lot
parameter from the .get_error_messages()
method of a ContentSection
. It wasn't
being used for anything, so the logic remains unaffected. Calling .get_error_messages()
with
the lot slug will from this point forward throw an error.
Old:
section.get_error_messages(errors, lot['slug'])
New:
section.get_error_messages(errors)
PR: #247
The ContentLoader
now takes the question id
from the contents of the YAML file if it is there.
It still falls back to the file name if there is no id
in the file. The reason this is a breaking
change is that the serviceTypes
id is now expected to be taken from the id
field.
Upgrade digitalmarketplace-frameworks to version 0.20.0 or above.
PR: #238
documents.get_agreement_document_path
no longer takes supplier_name
argument since uploaded
file paths are constructed using supplier_id
and document_name
only.
documents.get_countersigned_agreement_document_path
has been removed.
Old:
get_agreement_document_path(framework_slug, supplier_id, legal_supplier_name, document_name)
New:
get_agreement_document_path(framework_slug, supplier_id, document_name)
Old:
get_countersigned_agreement_document_path(framework_slug, supplier_id)
New:
from dmutils.documents import COUNTERSIGNED_AGREEMENT_FILENAME
get_agreement_document_path(framework_slug, supplier_id, COUNTERSIGNED_AGREEMENT_FILENAME)
PR: #233
apiclient
and audit
were moved to the new dmapiclient package. Changes required to the apps are described in the dmapiclient changelog.
Imports from dmutils.apiclient
and dmutils.audit
modules have to be changed to
the new package name (eg from dmapiclient import ...
).
API client logger names have changed from dmutils.apiclient.*
to dmapiclient.*
.
-
Add dmapiclient package to
requirements.txt
:git+https://github.com/alphagov/[email protected]#egg=digitalmarketplace-apiclient==1.0.1
-
Replace imports from
apiclient
modules:Old
from dmutils.apiclient.errors import HTTPError from dmutils.apiclient import SearchAPIClient from dmutils.audit import AuditTypes
New
from dmapiclient import HTTPError from dmapiclient import SearchAPIClient from dmapiclient.audit import AuditTypes
-
Check that
dmapiclient
logger is configured
PR: #210
Breaking changes:
content_builder
module no longer does special handling of pricing fields. The content repository must therefore be upgraded along with this change.
Upgrade digitalmarketplace-frameworks to 0.5.0
in bower.json
PR: #211
Breaking changes:
ContentSection.id
used in edit section URLs now uses dashes instead of underscores.
Non-breaking changes:
ContentBuilder
class renamed toContentManifest
.get_builder
is renamed to.get_manifest
, but the old name is kept as an alias to give frontend apps time to update- Question fields can be now accessed as attributes of
ContentQuestion
service_attribute
is being replaced byContetManifest.summary
andContentQuestionSummary
Test URLs referencing section IDs need to be updated:
Old
res = self.client.get('/suppliers/frameworks/g-cloud-7/declaration/g_cloud_7_essentials')
New
res = self.client.get('/suppliers/frameworks/g-cloud-7/declaration/g-cloud-7-essentials')
PR: #203
The method get_agreement_document_path
in documents.py
now has supplier name as an additional parameter.
Old
path = get_agreement_document_path(framework_slug, supplier_id, document_name)
New
path = get_agreement_document_path(framework_slug, supplier_id, supplier_name, document_name)
PR: #202
- Two new parameters were added to
dmutils.apiclient.DataAPIClient.create_new_draft_service
:data
andpage_questions
- Parameter order for
dmutils.apiclient.DataAPIClient.create_new_draft_service
was changed to:create_new_draft_service(self, framework_slug, lot, supplier_id, data, user, page_questions=None)
dmutils.apiclient.DataAPIClient.get_framework_status
method was removed, use.get_framework
instead
Old
draft_service = data_api_client.create_new_draft_service(
framework_slug, supplier_id, user, lot
)
New
draft_service = data_api_client.create_new_draft_service(
framework_slug, lot, supplier_id, {},
user, page_questions=None
)
PR: #195
- Moved the creation of the
manager
instance intoinit_manager
.
Old
from flask.ext.script import Manager
manager = Manager(application)
init_manager(manager, 5003, ['./app/content/frameworks'])
New
from dmutils.flask_init import init_manager
manager = init_manager(application, 5003, ['./app/content/frameworks'])
PR: #182
dmutils.content_loader.ContentLoader
changed to support loading content from multiple frameworks.
Old
existing_service_content = ContentLoader(
'app/content/frameworks/g-cloud-6/manifests/edit_service.yml',
'app/content/frameworks/g-cloud-6/questions/services/'
)
new_service_content = ContentLoader(
'app/content/frameworks/g-cloud-7/manifests/edit_submission.yml',
'app/content/frameworks/g-cloud-7/questions/services/'
)
declaration_content = ContentLoader(
'app/content/frameworks/g-cloud-7/manifests/declaration.yml',
'app/content/frameworks/g-cloud-7/questions/declaration/'
)
New
content_loader = ContentLoader('app/content')
content_loader.load_manifest('g-cloud-6', 'services', 'edit_service')
content_loader.load_manifest('g-cloud-7', 'services', 'edit_submission')
content_loader.load_manifest('g-cloud-7', 'declaration', 'declaration')
Old
content = declaration_content.get_builder()
New
content = content_loader.get_builder(framework_slug, 'declaration')
PR: #178
dmutils.apiclient.DataAPIClient.get_selection_answers
was renamed todmutils.apiclient.DataAPIClient.get_supplier_declaration
dmutils.apiclient.DataAPIClient.answer_selection_questions
was renamed todmutils.apiclient.DataAPIClient.set_supplier_declaration
- The response format for
get_supplier_declaration
is different from that ofget_selection_answers
:{"selectionAnswers": {"questionAnswers": { ... }}}
was replaced with{"declaration": { ... }}
Old
answers = data_api_client.get_selection_answers(
current_user.supplier_id, 'g-cloud-7'
)['selectionAnswers']['questionAnswers']
New
declaration = data_api_client.get_supplier_declaration(
current_user.supplier_id, 'g-cloud-7'
)['declaration']