You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: circular bug - decouple MappingFilesRegistry from notice, package
There was a hidden circular dependency in the metadata resource
migration to MS Config via MSSDK.
The previous design required a notice with `mapping_package_identifier`
to load resources, but this created a circular dependency: normalisation
needs resources, yet eligibility checking (which returns a package
identifier but does not set one on the notice) needs normalised
metadata.
Initial assumptions may have been anchored on the resources being
project-specific. However, this is problematic as not all projects may
be updated with the mapping suite configuration. Therefore, resource
files (country.json, languages.json, etc.) can be interpreted to be
global for now during the transition period.
Once all currently known production projects are updated with the
configuration, a more dynamic method to select the mapping suite can be
implemented, for e.g. via the `document_probing` conditions specified in
the config, which defines what XPaths must and must not be available to
be compatible with the project.
Changes:
- MappingFilesRegistry now loads resources from any available MappingSuite
- Removed notice parameter from DefaultNoticeMetadataNormaliser and
EformsNoticeMetadataNormaliser constructors
- Updated find_metadata_normaliser_based_on_xml_manifestation() and
extract_and_normalise_notice_metadata() to not require notice
- Added MappingSuiteConfigError for when no MappingSuite is available
- Updated all test fixtures to use the new API
- Remove all traces and dependence on a Notice
mapping_package_identifier
TODO: The mapping suite must be made mandatory and be fetched from a
default known project with the configuration if not given.
0 commit comments