Example #1
0
    def get_release_notes(cls, file_path, data):  # pylint: disable=unused-argument
        """
        Return the release notes relevant to the added yml file.

        :param file_path: yml/json (or package yml)
        :param data: object data
        :return: raw release notes or None in case of an error.
        """
        release_note_path = get_release_notes_file_path(file_path)

        return get_latest_release_notes_text(release_note_path)
Example #2
0
    def get_release_notes(self, file_path, data):
        """
        Return the release notes relevant to the added yml file.

        :param file_path: yml/json (or package yml)
        :param data: object data
        :return: raw release notes or None in case of an error.
        """
        rn_path = get_release_notes_file_path(file_path)

        return get_latest_release_notes_text(rn_path)
Example #3
0
    def validate_file_release_notes(self):
        """Validate that the file has proper release notes when modified.

        This function updates the class attribute self._is_valid instead of passing it back and forth.
        """
        if self.is_renamed:
            print_warning("You might need RN please make sure to check that.")
            return

        if os.path.isfile(self.file_path):
            rn_path = get_release_notes_file_path(self.file_path)
            rn = get_latest_release_notes_text(rn_path)

            # check rn file exists and contain text
            if rn is None:
                print_error(
                    'File {} is missing releaseNotes, Please add it under {}'.
                    format(self.file_path, rn_path))
                self._is_valid = False