Skip to content

Commit f4d4ec9

Browse files
authored
Merge pull request #7497 from opsmill/pog-return-early-pc-miss
Return early when a proposed change has been deleted
2 parents 4c7c0ab + e17cd3d commit f4d4ec9

File tree

1 file changed

+6
-2
lines changed
  • backend/infrahub/proposed_change

1 file changed

+6
-2
lines changed

backend/infrahub/proposed_change/tasks.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from typing import TYPE_CHECKING
99

1010
import pytest
11-
from infrahub_sdk.exceptions import ModuleImportError
11+
from infrahub_sdk.exceptions import ModuleImportError, NodeNotFoundError
1212
from infrahub_sdk.node import InfrahubNode
1313
from infrahub_sdk.protocols import (
1414
CoreArtifactValidator,
@@ -529,7 +529,11 @@ async def run_proposed_change_user_tests(model: RequestProposedChangeUserTests)
529529
log = get_run_logger()
530530
client = get_client()
531531

532-
proposed_change = await client.get(kind=InfrahubKind.PROPOSEDCHANGE, id=model.proposed_change)
532+
try:
533+
proposed_change = await client.get(kind=CoreProposedChange, id=model.proposed_change)
534+
except NodeNotFoundError:
535+
log.warning(f"Proposed change ({model.proposed_change}) not found, skipping user tests execution")
536+
return
533537

534538
def _execute(
535539
directory: Path, repository: ProposedChangeRepository, proposed_change: InfrahubNode

0 commit comments

Comments
 (0)