Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airbyte/cloud/connectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1698,7 +1698,7 @@ def rename(self, name: str) -> CustomCloudSourceDefinition:
assert builder_project_id is not None
builder_project = project["builderProject"]
draft_manifest = (
_unwrap_builder_manifest(project["declarativeManifest"]["manifest"])
project["declarativeManifest"]["manifest"]
if builder_project.get("hasDraft")
else None
)
Expand Down
25 changes: 21 additions & 4 deletions tests/unit_tests/test_cloud_credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,15 +718,32 @@ def test_custom_cloud_source_definition_builder_url_uses_owner_workspace(


@pytest.mark.parametrize(
("has_draft", "expected_draft_manifest"),
("has_draft", "stored_manifest", "expected_draft_manifest"),
[
pytest.param(True, {"version": "0.1.0"}, id="preserves-draft"),
pytest.param(False, None, id="no-draft"),
pytest.param(
True, {"version": "0.1.0"}, {"version": "0.1.0"}, id="preserves-draft"
),
pytest.param(False, {"version": "0.1.0"}, None, id="no-draft"),
pytest.param(
True,
{
"manifest": {"version": "0.1.0", "streams": []},
"spec": {"connection_specification": {}},
"version": "0.1.0",
},
{
"manifest": {"version": "0.1.0", "streams": []},
"spec": {"connection_specification": {}},
"version": "0.1.0",
},
id="preserves-envelope-draft",
),
],
)
def test_custom_cloud_source_definition_rename_preserves_builder_data(
monkeypatch: pytest.MonkeyPatch,
has_draft: bool,
stored_manifest: dict[str, object],
expected_draft_manifest: dict[str, object] | None,
) -> None:
workspace = CloudWorkspace(
Expand All @@ -739,7 +756,7 @@ def test_custom_cloud_source_definition_rename_preserves_builder_data(
"hasDraft": has_draft,
"componentsFileContent": "components: []",
},
"declarativeManifest": {"manifest": {"version": "0.1.0"}},
"declarativeManifest": {"manifest": stored_manifest},
}
builder_lookup = MagicMock(
return_value={
Expand Down
Loading