Skip to content

Added Configuration Schema and Validation#529

Open
fashxp wants to merge 36 commits into2026.xfrom
schema-validation
Open

Added Configuration Schema and Validation#529
fashxp wants to merge 36 commits into2026.xfrom
schema-validation

Conversation

@fashxp
Copy link
Copy Markdown
Member

@fashxp fashxp commented Jan 9, 2026

This pull request introduces significant improvements to the extensibility, validation, and AI integration capabilities of the Data Importer bundle. The changes include enhanced documentation for custom strategy development, new developer tools for configuration validation and schema introspection, experimental support for AI agent integration via MCP, and updates to example configurations. Additionally, interfaces for schema awareness and validation are now implemented in core cleanup strategies, and minor dependency and code quality improvements are made.

Extensibility and Developer Tools

  • Expanded documentation for creating custom strategies, including code samples for implementing SchemaAwareInterface, DataTargetFieldValidatorInterface, and TransformationTypeAwareInterface to enable automatic validation, schema introspection, and AI agent support.
  • Added new documentation sections: Configuration Validation for programmatic validation and schema introspection, and MCP Server (Experimental) for AI agent integration. [1] [2]
  • Updated the extension documentation overview to highlight new extension points and developer tools.
  • Updated the main README.md to include links to new extension documentation.

Validation and Schema Awareness

  • Implemented the SchemaAwareInterface in core cleanup strategies (DeleteStrategy, UnpublishStrategy) to provide schema descriptions and enable validation tooling. [1] [2] [3]

Example Configurations

  • Added comprehensive YAML examples for basic CSV import, CSV with relations and transformations, and JSON import with advanced transformations. [1] [2] [3]

Dependency and Codebase Improvements

  • Updated composer.json to add dependencies for MCP SDK and HTTP message bridge, and to restrict plugin discovery for php-http/discovery. [1] [2]
  • Added license header and improved error messaging in phpstan-bootstrap.php. [1] [2]

fashxp added 25 commits January 9, 2026 09:58
- Extract collectServicesByType() helper method in ConfigurationDefinitionPass to eliminate 8 duplicated foreach loops
- Add validateSchemaAwareSettings() helper method in ConfigurationValidationService to reduce duplication across validation methods
- Fix line length issue in ConfigurationDefinitionPass (split long line)
- Reduces cognitive complexity and improves maintainability
Add @phpstan-ignore-next-line comments for children() method calls
that fail type inference with Symfony 6.4.0 (lowest dependencies).
The children() method returns NodeParentInterface in older versions
instead of NodeBuilder, causing PHPStan to complain about undefined
methods like scalarNode(), enumNode(), etc.
Move @phpstan-ignore-next-line comments to the correct lines where
the actual failing method calls occur (scalarNode, variableNode,
arrayNode, enumNode) instead of on the children() line. PHPStan
complains about these method calls, not about children() itself.
# Conflicts:
#	src/DataSource/Loader/HttpLoader.php
@sonarqubecloud
Copy link
Copy Markdown

kingjia90 and others added 3 commits February 24, 2026 14:57
# Conflicts:
#	composer.json
#	src/Resources/config/pimcore/routing.yml
unified tool naming
updated docs
added create and save data importer config tool
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 9, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
3 New Critical Issues (required ≤ 0)
8 New Major Issues (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@fashxp
Copy link
Copy Markdown
Member Author

fashxp commented Mar 30, 2026

@copilot can you analyse this PR and check if there are any BC breaks in it?

Copy link
Copy Markdown

Copilot AI commented Mar 30, 2026

@copilot can you analyse this PR and check if there are any BC breaks in it?

Here is the full BC break analysis for this PR:

Overall conclusion: No BC breaks for existing custom implementations.


What was checked

  1. Existing interfacesLoadStrategyInterface, CleanupStrategyInterface, LocationStrategyInterface, PublishStrategyInterface, DataLoaderInterface, InterpreterInterface, OperatorInterface, DataTargetInterfaceall unchanged. No new methods were added to any of these.

  2. SettingsAwareInterfaceunchanged.

  3. AbstractLoad abstract class — only a new protected helper method getBaseConfigTreeBuilder() was added. Existing subclasses are unaffected.

  4. New interfaces — three new interfaces were introduced:

    • SchemaAwareInterface (with getSchemaDescription() and getConfigTreeBuilder())
    • DataTargetFieldValidatorInterface
    • TransformationTypeAwareInterface

    These are optional/additive — they are not added to any existing interface and are not required by the framework. Existing custom strategy implementations continue to work without changes. Implementing them is only needed to opt into schema validation and AI agent features.

  5. Services / routing — only new services and routes added; nothing removed or renamed.

  6. Bundle config — a new optional mcp_server section was added with addDefaultsIfNotSet(), so existing config files require no changes.


One point to watch

A new required runtime dependency was added to composer.json:

  • mcp/sdk: 0.1.0
  • symfony/psr-http-message-bridge: ^6.3 || ^7.0

These are new entries in require (not require-dev), so any project consuming this bundle will need these installed. If mcp/sdk 0.1.0 is not yet widely available or causes version conflicts in the consumer's dependency graph, that could be a practical upgrade concern — even if it is not a PHP-level BC break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants