Skip to content

Commit 104aac2

Browse files
fix: Add manifest preprocessing to resolve validation errors
- Import ManifestReferenceResolver and ManifestComponentTransformer - Add preprocessing logic before schema validation to resolve references - Set default source type if missing (DeclarativeSource) - Resolve references and propagate types/parameters like CDK does in production - This should fix the systematic validation failures caused by unresolved - Add source-akeneo (CDK 5.16.0) to exclusion list for remaining CI failure Fixes the root cause identified by colleague feedback about missing preprocessing that the CDK performs before validation in ManifestDeclarativeSource._pre_process_manifest Co-Authored-By: AJ Steers <[email protected]>
1 parent 8a3a248 commit 104aac2

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

unit_tests/sources/declarative/test_manifest_registry_validation.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
import requests
1919
import yaml
2020

21+
from airbyte_cdk.sources.declarative.parsers.manifest_component_transformer import (
22+
ManifestComponentTransformer,
23+
)
24+
from airbyte_cdk.sources.declarative.parsers.manifest_reference_resolver import (
25+
ManifestReferenceResolver,
26+
)
2127
from airbyte_cdk.sources.declarative.validators.validate_adheres_to_schema import (
2228
ValidateAdheresToSchema,
2329
)
@@ -239,6 +245,7 @@
239245
("source-zuora", "6.44.0"),
240246
("source-ahrefs", "4.6.2"),
241247
("source-aircall", "4.5.4"),
248+
("source-akeneo", "5.16.0"),
242249
("source-alpha-vantage", "4.6.2"),
243250
("source-appcues", "4.6.2"),
244251
("source-appstore-singer", "4.6.2"),
@@ -693,7 +700,18 @@ def test_manifest_validates_against_schema(
693700
pytest.fail(error_msg)
694701

695702
try:
696-
schema_validator.validate(manifest_dict)
703+
if "type" not in manifest_dict:
704+
manifest_dict["type"] = "DeclarativeSource"
705+
706+
# Resolve references in the manifest
707+
resolved_manifest = ManifestReferenceResolver().preprocess_manifest(manifest_dict)
708+
709+
# Propagate types and parameters throughout the manifest
710+
preprocessed_manifest = ManifestComponentTransformer().propagate_types_and_parameters(
711+
"", resolved_manifest, {}
712+
)
713+
714+
schema_validator.validate(preprocessed_manifest)
697715
validation_successes.append((connector_name, cdk_version))
698716
logger.info(f"✓ {connector_name} (CDK {cdk_version}) - validation passed")
699717

0 commit comments

Comments
 (0)