Refactor configuration with v2 and add backward compatibility#93
Open
Refactor configuration with v2 and add backward compatibility#93
Conversation
This reverts commit dd01f18.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
This PR refactors DataEngine configuration into a new “V2” grouped schema (General/Plugins/TemplateManagement/RegistrySettings) while introducing legacy V1→V2 adapters to preserve backward compatibility. It updates service wiring and tests/examples to use the new configuration layout and derived base-URL behavior.
Changes:
- Introduce V2 configuration POCOs and V1→V2 adapters/compat detection.
- Update DI + providers/health checks to consume V2 config and derive the DataEngine base URL from the current HTTP request.
- Update examples, appsettings, and module tests to exercise both V1 and V2 config shapes.
Reviewed changes
Copilot reviewed 98 out of 99 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| source/AAS.TwinEngine.Plugin.TestPlugin/Example/nginx/default.conf.template | Fix upstream host name typo for submodel registry proxying. |
| source/AAS.TwinEngine.Plugin.TestPlugin/Example/docker-compose.yml | Update example environment variables to V2 config keys and service name fixes. |
| source/AAS.TwinEngine.Plugin.TestPlugin/Example/basyx/aas-env.properties | Fix submodel registry host typo. |
| source/AAS.TwinEngine.Plugin.TestPlugin/Api/Manifest/ManifestController.cs | Minor formatting change. |
| source/AAS.TwinEngine.Plugin.TestPlugin.PlaywrightTests/ApiTestBase.cs | Import ordering/formatting cleanup. |
| source/AAS.TwinEngine.DataEngine/ServiceConfiguration/LoggingConfigurationExtension.cs | Switch OpenTelemetry settings lookup to V2 General:OpenTelemetry section. |
| source/AAS.TwinEngine.DataEngine/ServiceConfiguration/InfrastructureDependencyInjectionExtensions.cs | Register V2 config + legacy adapters; rewire HttpClient registrations for V2. |
| source/AAS.TwinEngine.DataEngine/ServiceConfiguration/Config/TemplateManagementConfig.cs | Add V2 TemplateManagement config model (endpoints, mapping rules, semantics, resilience). |
| source/AAS.TwinEngine.DataEngine/ServiceConfiguration/Config/RegistrySettingsConfig.cs | Add V2 RegistrySettings model (precomputed schedule/enabled). |
| source/AAS.TwinEngine.DataEngine/ServiceConfiguration/Config/PluginsConfig.cs | Add V2 Plugins model (instances, MLP config, resilience). |
| source/AAS.TwinEngine.DataEngine/ServiceConfiguration/Config/GeneralConfig.cs | Add V2 General config model (api config, sanitization, OTEL, customer URL, etc.). |
| source/AAS.TwinEngine.DataEngine/ServiceConfiguration/ApplicationDependencyInjectionExtensions.cs | Source ApiConfiguration from V2 GeneralConfig. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Shared/HttpRequestBaseUrlProvider.cs | Add base-url provider derived from HTTP request (with V1 fallback). |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/TemplateProvider/Services/TemplateProvider.cs | Remove dependency on configurable paths; use fixed path constants. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/TemplateProvider/Services/SubmodelTemplateMappingProvider.cs | Read mapping rules from V2 TemplateManagementConfig. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/TemplateProvider/Services/ShellTemplateMappingProvider.cs | Read mapping + extraction rules from V2 TemplateManagementConfig. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/SubmodelRegistryProvider/Services/SubmodelDescriptorProvider.cs | Remove dependency on options; use fixed path constants. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/PluginDataProvider/Services/PluginManifestProvider.cs | Switch from V1 PluginConfig to V2 PluginsConfig instances. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/PluginDataProvider/Services/PluginManifestConflictHandler.cs | Constructor parameter reorder for options/logger. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/PluginDataProvider/Services/PluginDataHandler.cs | Use IBaseUrlProvider for href generation instead of configured base URL. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/PluginDataProvider/Services/MultiPluginDataHandler.cs | Switch semantics context prefix source to V2 PluginsConfig. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/PluginDataProvider/Helper/RegisterPluginHttpClients.cs | Use RetryConfig directly instead of retry policy section keys. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/PluginDataProvider/Helper/JsonSchemaValidator.cs | Switch semantics context prefix source to V2 PluginsConfig. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/AasRegistryProvider/Services/ShellDescriptorSyncHosted.cs | Use V2 RegistrySettingsConfig for schedule/enabled. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Providers/AasRegistryProvider/Services/AasRegistryProvider.cs | Remove dependency on configurable paths; use fixed path constants. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Monitoring/TemplateRepositoryHealthCheck.cs | Remove dependency on options; use fixed path constants. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Monitoring/TemplateRegistryHealthCheck.cs | Remove dependency on options; use fixed path constants. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Monitoring/PluginAvailabilityHealthCheck.cs | Switch from V1 PluginConfig to V2 PluginsConfig instances. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Http/Policies/ResilienceHandlerExtensions.cs | Accept RetryConfig directly; remove IOptionsMonitor-based lookup. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Http/Extensions/HttpClientRegistrationExtensions.cs | Update AddHttpClientWithResilience signature to accept RetryConfig. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Http/Authorization/Headers/RequestHeaderMapper.cs | Read mappings/sanitization from V2 config models. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Http/Authorization/Config/HeaderForwardingOptions.cs | Adjust header forwarding model collection property mutability. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/LegacyV1ConfigurationExtensions.cs | Add registration extension for V1→V2 adapter implementations. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/LegacyTemplateManagementConfigAdapter.cs | Map V1 TemplateMappingRules/headers/retry into V2 TemplateManagement shape. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/LegacyRegistrySettingsConfigAdapter.cs | Map V1 precomputed registry settings into V2; handle typo section. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/LegacyPluginsConfigAdapter.cs | Map V1 plugins/MLP/semantics/retry into V2 PluginsConfig. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/LegacyGeneralConfigAdapter.cs | Map V1 general concerns into V2 GeneralConfig. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/LegacyConfigurationDetector.cs | Add schema detection (V1 vs V2) and typo-detection helper. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/ConfigV1/Semantics.cs | Move/rename legacy V1 semantics type into LegacyV1 namespace. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/ConfigV1/MultiLanguagePropertySettingsValidator.cs | Move legacy V1 validator into LegacyV1 namespace. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/ConfigV1/MultiLanguagePropertySettings.cs | Move legacy V1 MLP settings type into LegacyV1 namespace. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/ConfigV1/HttpRetryPolicyOptions.cs | Move legacy V1 retry policy options into LegacyV1 namespace. |
| source/AAS.TwinEngine.DataEngine/Infrastructure/Configuration/LegacyV1/ConfigV1/AasRegistryPreComputed.cs | Move legacy V1 precomputed registry config into LegacyV1 namespace. |
| source/AAS.TwinEngine.DataEngine/appsettings.json | Replace V1 flat config with V2 grouped config (and examples). |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/SubmodelRepository/SerializationService.cs | Remove configurable export options; use constants. |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/SubmodelRepository/SemanticId/Helpers/SubmodelElementHelper.cs | Source default languages from V2 PluginsConfig. |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/SubmodelRepository/SemanticId/Helpers/SemanticIdResolver.cs | Split semantics sources: V2 PluginsConfig + TemplateManagementConfig. |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/SubmodelRepository/Config/Helper/PluginsConfigValidator.cs | Add validator for V2 PluginsConfig (language tags). |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/SubmodelRepository/Config/AasxExportOptions.cs | Convert export options to static constants (no config binding). |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/SubmodelRegistry/SubmodelDescriptorService.cs | Use IBaseUrlProvider for href generation and fixed paths. |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/Shared/IBaseUrlProvider.cs | Introduce base URL provider abstraction. |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/Plugin/Config/AasEnvironmentConfig.cs | Make API path segments constants (no longer configurable), retain V1 URIs for adapter. |
| source/AAS.TwinEngine.DataEngine/ApplicationLogic/Services/AasRepository/AasRepositoryTemplateService.cs | Switch customer domain URL source to V2 GeneralConfig. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ServiceConfiguration/ConfigurationMigration/LegacyTemplateManagementConfigAdapterTests.cs | Add unit tests for V1→V2 TemplateManagement adapter behavior. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ServiceConfiguration/ConfigurationMigration/LegacyRegistrySettingsConfigAdapterTests.cs | Add unit tests for V1→V2 RegistrySettings adapter + typo handling. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ServiceConfiguration/ConfigurationMigration/LegacyPluginsConfigAdapterTests.cs | Add unit tests for V1→V2 Plugins adapter behavior. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ServiceConfiguration/ConfigurationMigration/LegacyGeneralConfigAdapterTests.cs | Add unit tests for V1→V2 General adapter behavior. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ServiceConfiguration/ConfigurationMigration/LegacyConfigurationDetectorTests.cs | Add unit tests for schema/typo detection. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/TemplateProvider/Services/TemplateProviderTests.cs | Update tests for TemplateProvider constructor/signature changes. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/TemplateProvider/Services/SubmodelTemplateMappingProviderTests.cs | Update tests to bind mapping rules from TemplateManagementConfig. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/TemplateProvider/Services/ShellTemplateMappingProviderTests.cs | Update tests to bind mapping+extraction rules from TemplateManagementConfig. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/SubmodelRegistryProvider/Services/SubmodelDescriptorProviderTests.cs | Update tests for provider signature/path-constant changes. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/PluginDataProvider/Services/PluginManifestProviderTests.cs | Update tests for V2 PluginsConfig usage. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/PluginDataProvider/Services/PluginManifestConflictHandlerTests.cs | Adjust tests for constructor changes + add more scenarios. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/PluginDataProvider/Services/PluginDataHandlerTests.cs | Update tests to use IBaseUrlProvider. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/PluginDataProvider/Services/MultiPluginDataHandlerTests.cs | Update tests to use V2 PluginsConfig. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/PluginDataProvider/Helper/JsonSchemaValidatorTests.cs | Update tests to use V2 PluginsConfig. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/AasRegistryProvider/ShellDescriptorSyncHostedTests.cs | Update tests for V2 RegistrySettingsConfig usage. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Providers/AasRegistryProvider/AasRegistryProviderTests.cs | Update tests for provider signature/path-constant changes. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Monitoring/TemplateRepositoryHealthCheckTests.cs | Update tests for health check signature/path-constant changes. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Monitoring/TemplateRegistryHealthCheckTests.cs | Update tests for health check signature/path-constant changes. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Monitoring/PluginAvailabilityHealthCheckTests.cs | Update tests to use V2 PluginsConfig. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Http/Policies/ResilienceHandlerExtensionsTests.cs | Update tests for RetryConfig-based resilience handler configuration. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Http/Extensions/HttpClientRegistrationExtensionsTests.cs | Update tests for RetryConfig-based HttpClient registration. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Http/Authorization/Headers/RequestHeaderMapperTests.cs | Update tests for new V2 config-based mapper construction. |
| source/AAS.TwinEngine.DataEngine.UnitTests/Infrastructure/Http/Authorization/HeaderForwardingHandlerTests.cs | Update tests to build mapper via V2 config models. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/SubmodelRepository/SerializationServiceTests.cs | Update tests for removal of configurable export options. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/SubmodelRepository/SemanticIdHandlerTests.cs | Update tests for semantics/MLP moving into V2 config. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/SubmodelRepository/SemanticId/Helpers/SubmodelElementHelperTests.cs | Update tests for V2 PluginsConfig-based default languages. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/SubmodelRepository/SemanticId/Helpers/SemanticIdResolverTests.cs | Update tests for split V2 semantics sources. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/SubmodelRepository/SemanticId/Helpers/ReferenceHelperTests.cs | Update tests for new resolver constructor signature. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/SubmodelRepository/Config/Helper/MultiLanguagePropertySettingsValidatorTests.cs | Point tests to legacy V1 validator namespace. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/SubmodelRegistry/SubmodelDescriptorServiceTests.cs | Update tests to use IBaseUrlProvider and new constructor. |
| source/AAS.TwinEngine.DataEngine.UnitTests/ApplicationLogic/Services/AasRepository/AasRepositoryTemplateServiceTests.cs | Update tests to use V2 GeneralConfig for customer URL. |
| source/AAS.TwinEngine.DataEngine.ModuleTests/TestData/v2-config/appsettings.json | Add V2 config fixture for module/integration tests. |
| source/AAS.TwinEngine.DataEngine.ModuleTests/TestData/v1-config/appsettings.json | Add V1 config fixture for module/integration tests. |
| source/AAS.TwinEngine.DataEngine.ModuleTests/Common/ConfigTestFactory.cs | Add WebApplicationFactory wrapper to boot with selected config fixture dir. |
| source/AAS.TwinEngine.DataEngine.ModuleTests/Api/Services/SubmodelRepository/SubmodelRepositoryControllerTests.cs | Split module tests to run with both V1 and V2 config fixtures. |
| source/AAS.TwinEngine.DataEngine.ModuleTests/Api/Services/SubmodelRepository/SerializationControllerTests.cs | Split module tests to run with both V1 and V2 config fixtures. |
| source/AAS.TwinEngine.DataEngine.ModuleTests/Api/Services/SubmodelRegistry/SubmodelDescriptorControllerTests.cs | Split module tests to run with both V1 and V2 config fixtures. |
| source/AAS.TwinEngine.DataEngine.ModuleTests/Api/Services/AasRepository/AasRepositoryControllerTests.cs | Split module tests to run with both V1 and V2 config fixtures. |
| source/AAS.TwinEngine.DataEngine.ModuleTests/Api/Services/AasRegistry/TestData.cs | Update expected href host to align with base-url changes. |
| source/AAS.TwinEngine.DataEngine.ModuleTests/Api/Services/AasRegistry/ShellDescriptorControllerTests.cs | Split module tests to run with both V1 and V2 config fixtures. |
| source/AAS.TwinEngine.DataEngine.ModuleTests/AAS.TwinEngine.DataEngine.ModuleTests.csproj | Copy V1/V2 appsettings fixtures to test output. |
| example/docker-compose.yml | Update public example compose to V2 env vars and corrected service naming. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...AS.TwinEngine.DataEngine/ServiceConfiguration/InfrastructureDependencyInjectionExtensions.cs
Show resolved
Hide resolved
...e/AAS.TwinEngine.DataEngine/Infrastructure/Http/Authorization/Headers/RequestHeaderMapper.cs
Outdated
Show resolved
Hide resolved
...e/AAS.TwinEngine.DataEngine/Infrastructure/Http/Authorization/Headers/RequestHeaderMapper.cs
Show resolved
Hide resolved
source/AAS.TwinEngine.DataEngine/ServiceConfiguration/LoggingConfigurationExtension.cs
Show resolved
Hide resolved
source/AAS.TwinEngine.Plugin.TestPlugin/Example/docker-compose.yml
Outdated
Show resolved
Hide resolved
...AS.TwinEngine.DataEngine/Infrastructure/Http/Authorization/Config/HeaderForwardingOptions.cs
Show resolved
Hide resolved
...ne.DataEngine/Infrastructure/Configuration/LegacyV1/LegacyTemplateManagementConfigAdapter.cs
Outdated
Show resolved
Hide resolved
Test & Coverage ReportTest Results Summary
Code CoverageUnit Tests Coverage
Minimum allowed line rate is Module Tests Coverage
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Overview
This PR refactors the DataEngine configuration by introducing a structured V2 schema organized into:
GeneralPluginsTemplateManagementRegistrySettingsTo maintain backward compatibility, it includes adapters that map legacy V1 configuration to the new V2 format.
Key Changes
appsettings, and module tests to support both V1 and V2 configurationsNotes