File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
backend/infrahub/proposed_change Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 88from typing import TYPE_CHECKING
99
1010import pytest
11- from infrahub_sdk .exceptions import ModuleImportError , NodeNotFoundError
11+ from infrahub_sdk .exceptions import ModuleImportError , NodeNotFoundError , URLNotFoundError
1212from infrahub_sdk .node import InfrahubNode
1313from infrahub_sdk .protocols import (
1414 CoreArtifactValidator ,
@@ -1502,8 +1502,14 @@ async def _get_proposed_change_repositories(
15021502 destination_all = await client .execute_graphql (
15031503 query = DESTINATION_ALLREPOSITORIES , branch_name = model .destination_branch
15041504 )
1505- source_managed = await client .execute_graphql (query = SOURCE_REPOSITORIES , branch_name = model .source_branch )
1506- source_readonly = await client .execute_graphql (query = SOURCE_READONLY_REPOSITORIES , branch_name = model .source_branch )
1505+ try :
1506+ source_managed = await client .execute_graphql (query = SOURCE_REPOSITORIES , branch_name = model .source_branch )
1507+ source_readonly = await client .execute_graphql (
1508+ query = SOURCE_READONLY_REPOSITORIES , branch_name = model .source_branch
1509+ )
1510+ except URLNotFoundError :
1511+ # If the URL is not found it means that the source branch has been deleted after the proposed change was created
1512+ return []
15071513
15081514 destination_all = destination_all [InfrahubKind .GENERICREPOSITORY ]["edges" ]
15091515 source_all = (
You can’t perform that action at this time.
0 commit comments