fix: narrow binding validation to not change diagnostic contract for non-platform sources
This commit is contained in:
@@ -29,9 +29,6 @@ def validate_deployment_dependencies(
|
|||||||
else:
|
else:
|
||||||
bound_source_id = bindings.get(required.logical_source)
|
bound_source_id = bindings.get(required.logical_source)
|
||||||
if bound_source_id is None:
|
if bound_source_id is None:
|
||||||
if not sources_by_id:
|
|
||||||
bound_source_id = required.logical_source
|
|
||||||
else:
|
|
||||||
diagnostics.append(
|
diagnostics.append(
|
||||||
_diagnostic(
|
_diagnostic(
|
||||||
code="binding_missing",
|
code="binding_missing",
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ def test_platform_source_requirement_does_not_need_binding() -> None:
|
|||||||
assert diagnostics == []
|
assert diagnostics == []
|
||||||
|
|
||||||
|
|
||||||
def test_missing_platform_source_still_reports_source_missing() -> None:
|
def test_missing_platform_source_still_reports_binding_missing() -> None:
|
||||||
artifact = artifact_with(
|
artifact = artifact_with(
|
||||||
required_capability(logical_source="wf.std", capability_name="replace")
|
required_capability(logical_source="wf.std", capability_name="replace")
|
||||||
)
|
)
|
||||||
@@ -251,5 +251,4 @@ def test_missing_platform_source_still_reports_source_missing() -> None:
|
|||||||
sources=[],
|
sources=[],
|
||||||
)
|
)
|
||||||
|
|
||||||
assert [diagnostic.code for diagnostic in diagnostics] == ["source_missing"]
|
assert [diagnostic.code for diagnostic in diagnostics] == ["binding_missing"]
|
||||||
assert diagnostics[0].bound_source == "wf.std"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user