From 99da4ae7934e0ef1a84244544b4b0ae7a83fb2f9 Mon Sep 17 00:00:00 2001 From: Yuval Hayun <70104171+YuvHayun@users.noreply.github.com> Date: Mon, 16 Dec 2024 16:05:53 +0200 Subject: [PATCH] Fix RN111 (#4714) * fixed RN111 * added changelog * Update .changelog/4714.yml Co-authored-by: Judah Schwartz --------- Co-authored-by: Judah Schwartz --- .changelog/4714.yml | 4 ++++ .../RN_validators/RN111_is_docker_entry_match_yml.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .changelog/4714.yml diff --git a/.changelog/4714.yml b/.changelog/4714.yml new file mode 100644 index 00000000000..876dde3fa39 --- /dev/null +++ b/.changelog/4714.yml @@ -0,0 +1,4 @@ +changes: +- description: Fixed an issue where RN111 would fail when it should not when the docker entry message was missing. + type: fix +pr_number: 4714 diff --git a/demisto_sdk/commands/validate/validators/RN_validators/RN111_is_docker_entry_match_yml.py b/demisto_sdk/commands/validate/validators/RN_validators/RN111_is_docker_entry_match_yml.py index b809a9a65c1..10acf9a7b3e 100644 --- a/demisto_sdk/commands/validate/validators/RN_validators/RN111_is_docker_entry_match_yml.py +++ b/demisto_sdk/commands/validate/validators/RN_validators/RN111_is_docker_entry_match_yml.py @@ -39,10 +39,11 @@ def obtain_invalid_content_items( and content_item.docker_image != old_obj.docker_image # type:ignore[attr-defined] and ( docker_entry := self.get_docker_image_entry( - content_item.pack.release_note.file_content, content_item.name + content_item.pack.release_note.file_content, + content_item.display_name, ) ) - and content_item.docker_image != docker_entry + and content_item.docker_image not in docker_entry ] def get_docker_image_entry(self, rn: str, content_item_name: str) -> str: @@ -52,8 +53,11 @@ def get_docker_image_entry(self, rn: str, content_item_name: str) -> str: if item.startswith(content_item_name): for entry in item.split("- "): if entry.startswith("Updated the Docker image to: "): - docker = entry.replace("Updated the Docker image to: ", "")[ - 1:-2 + docker_entry = entry.replace( + "Updated the Docker image to: ", "" + ) + docker = docker_entry[ + docker_entry.find("*") + 1 : docker_entry.rfind("*") ] break return docker