def isNewRelease()

in check-release-notes/main.py [0:0]


def isNewRelease(latest_release_note, stored_release_note):
    """
    Check if anything in the release notes is new by comparing the sha256 hash of the release notes
    taken from the release notes page and the stored release notes which are stored in
    the Firestore database.
    Args:
        latest_release_notes: The latest release notes for all products
        stored_release_notes: The stored release notes for all products
    Returns:
        True if the release notes are new, False otherwise
    """
    stored_release_note_text_only = BeautifulSoup(
        stored_release_note.get("html"), "html.parser"
    ).get_text()
    latest_release_note_text_only = BeautifulSoup(
        latest_release_note.get("html"), "html.parser"
    ).get_text()
    return (
        sha256(latest_release_note_text_only.encode("utf-8")).digest()
        != sha256(stored_release_note_text_only.encode("utf-8")).digest()
    )