Skip to content

Commit

Permalink
Fix RN111 (#4714)
Browse files Browse the repository at this point in the history
* fixed RN111

* added changelog

* Update .changelog/4714.yml

Co-authored-by: Judah Schwartz <[email protected]>

---------

Co-authored-by: Judah Schwartz <[email protected]>
  • Loading branch information
YuvHayun and JudahSchwartz authored Dec 16, 2024
1 parent 0cc5d75 commit 99da4ae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .changelog/4714.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

0 comments on commit 99da4ae

Please sign in to comment.