From ac24605c7f089d9a9f5a21d685914f3527ca4c5b Mon Sep 17 00:00:00 2001 From: Baptiste <32564248+BaptisteGi@users.noreply.github.com> Date: Wed, 28 Aug 2024 11:40:16 +0200 Subject: [PATCH] Allow generators and artifacts to run on node without name attribute (#4187) * Use display label instead of name * Add changelog shard --- .../message_bus/operations/requests/artifact_definition.py | 4 ++-- .../message_bus/operations/requests/generator_definition.py | 4 ++-- changelog/4062.fixed.md | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 changelog/4062.fixed.md diff --git a/backend/infrahub/message_bus/operations/requests/artifact_definition.py b/backend/infrahub/message_bus/operations/requests/artifact_definition.py index 4c19fa9ad5..2020d6f9d1 100644 --- a/backend/infrahub/message_bus/operations/requests/artifact_definition.py +++ b/backend/infrahub/message_bus/operations/requests/artifact_definition.py @@ -107,7 +107,7 @@ async def check(message: messages.RequestArtifactDefinitionCheck, service: Infra query=message.artifact_definition.query_name, variables=member.extract(params=artifact_definition.parameters.value), target_id=member.id, - target_name=member.name.value, + target_name=member.display_label, timeout=message.artifact_definition.timeout, validator_id=validator.id, meta=Meta(validator_execution_id=validator_execution_id, check_execution_id=check_execution_id), @@ -203,7 +203,7 @@ async def generate(message: messages.RequestArtifactDefinitionGenerate, service: query=query.name.value, variables=member.extract(params=artifact_definition.parameters.value), target_id=member.id, - target_name=member.name.value, + target_name=member.display_label, timeout=transform.timeout.value, ) ) diff --git a/backend/infrahub/message_bus/operations/requests/generator_definition.py b/backend/infrahub/message_bus/operations/requests/generator_definition.py index 6bc7a41868..92c03e839e 100644 --- a/backend/infrahub/message_bus/operations/requests/generator_definition.py +++ b/backend/infrahub/message_bus/operations/requests/generator_definition.py @@ -101,7 +101,7 @@ async def check(message: messages.RequestGeneratorDefinitionCheck, service: Infr query=message.generator_definition.query_name, variables=member.extract(params=message.generator_definition.parameters), target_id=member.id, - target_name=member.name.value, + target_name=member.display_label, validator_id=validator.id, meta=Meta(validator_execution_id=validator_execution_id, check_execution_id=check_execution_id), ) @@ -177,7 +177,7 @@ async def run(message: messages.RequestGeneratorDefinitionRun, service: Infrahub query=message.generator_definition.query_name, variables=member.extract(params=message.generator_definition.parameters), target_id=member.id, - target_name=member.name.value, + target_name=member.display_label, ) ) diff --git a/changelog/4062.fixed.md b/changelog/4062.fixed.md new file mode 100644 index 0000000000..dfbbe0e503 --- /dev/null +++ b/changelog/4062.fixed.md @@ -0,0 +1 @@ +Allow users to run artifacts and generators on nodes without name attribute \ No newline at end of file