third_party/blink/tools/blinkpy/w3c/import_notifier.py
def create_bugs_from_new_failures(self, wpt_revision_start,
                                      wpt_revision_end, gerrit_url):
        """Files bug reports for new failures.

        Args:
            wpt_revision_start: The start of the imported WPT revision range
                (exclusive), i.e. the last imported revision.
            wpt_revision_end: The end of the imported WPT revision range
                (inclusive), i.e. the current imported revision.
            gerrit_url: Gerrit URL of the CL.

        Return:
            A list of MonorailIssue objects that should be filed.
        """
        imported_commits = self.local_wpt.commits_in_range(
            wpt_revision_start, wpt_revision_end)
        bugs = []
        for directory, failures in self.new_failures_by_directory.items():
            summary = '[WPT] New failures introduced in {} by import {}'.format(
                directory, gerrit_url)

            full_directory = self.host.filesystem.join(
                self.finder.web_tests_dir(), directory)
            owners_file = self.host.filesystem.join(full_directory, 'OWNERS')
            metadata_file = self.host.filesystem.join(full_directory,
                                                      'DIR_METADATA')
            is_wpt_notify_enabled = False
            try:
                is_wpt_notify_enabled = self.owners_extractor.is_wpt_notify_enabled(
                    metadata_file)
            except KeyError:
                _log.info('KeyError when parsing %s' % metadata_file)

            if not is_wpt_notify_enabled:
                _log.info("WPT-NOTIFY disabled in %s." % full_directory)
                continue

            owners = self.owners_extractor.extract_owners(owners_file)
            # owners may be empty but not None.
            cc = owners

            component = self.owners_extractor.extract_component(metadata_file)
            # component could be None.
            components = [component] if component else None

            prologue = ('WPT import {} introduced new failures in {}:\n\n'
                        'List of new failures:\n'.format(
                            gerrit_url, directory))
            failure_list = ''
            for failure in failures:
                failure_list += str(failure) + '\n'

            expectations_statement = (
                '\nExpectations or baseline files [0] have been automatically '
                'added for the failing results to keep the bots green. Please '
                'investigate the new failures and triage as appropriate.\n')

            range_statement = '\nThis import contains upstream changes from {} to {}:\n'.format(
                wpt_revision_start, wpt_revision_end)
            commit_list = self.format_commit_list(imported_commits,
                                                  full_directory)

            links_list = '\n[0]: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/web_test_expectations.md\n'

            description = (prologue + failure_list + expectations_statement +
                           range_statement + commit_list + links_list)

            bug = MonorailIssue.new_chromium_issue(summary,
                                                   description,
                                                   cc,
                                                   components,
                                                   labels=['Test-WebTest'])
            _log.info(bug)
            _log.info("WPT-NOTIFY enabled in %s; adding the bug to the pending list." % full_directory)
            bugs.append(bug)
        return bugs
Files bug reports for new failures.

        Args:
            wpt_revision_start: The start of the imported WPT revision range
                (exclusive), i.e. the last imported revision.
            wpt_revision_end: The end of the imported WPT revision range
                (inclusive), i.e. the current imported revision.
            gerrit_url: Gerrit URL of the CL.

        Return:
            A list of MonorailIssue objects that should be filed.
        
Files bug reports for new failures.
Files bug reports for new failures .
def create_bugs_from_new_failures(self, wpt_revision_start,
                                      wpt_revision_end, gerrit_url):
        imported_commits = self.local_wpt.commits_in_range(
            wpt_revision_start, wpt_revision_end)
        bugs = []
        for directory, failures in self.new_failures_by_directory.items():
            summary = '[WPT] New failures introduced in {} by import {}'.format(
                directory, gerrit_url)
            full_directory = self.host.filesystem.join(
                self.finder.web_tests_dir(), directory)
            owners_file = self.host.filesystem.join(full_directory, 'OWNERS')
            metadata_file = self.host.filesystem.join(full_directory,
                                                      'DIR_METADATA')
            is_wpt_notify_enabled = False
            try:
                is_wpt_notify_enabled = self.owners_extractor.is_wpt_notify_enabled(
                    metadata_file)
            except KeyError:
                _log.info('KeyError when parsing %s' % metadata_file)
            if not is_wpt_notify_enabled:
                _log.info("WPT-NOTIFY disabled in %s." % full_directory)
                continue
            owners = self.owners_extractor.extract_owners(owners_file)
            cc = owners
            component = self.owners_extractor.extract_component(metadata_file)
            components = [component] if component else None
            prologue = ('WPT import {} introduced new failures in {}:\n\n'
                        'List of new failures:\n'.format(
                            gerrit_url, directory))
            failure_list = ''
            for failure in failures:
                failure_list += str(failure) + '\n'
            expectations_statement = (
                '\nExpectations or baseline files [0] have been automatically '
                'added for the failing results to keep the bots green. Please '
                'investigate the new failures and triage as appropriate.\n')
            range_statement = '\nThis import contains upstream changes from {} to {}:\n'.format(
                wpt_revision_start, wpt_revision_end)
            commit_list = self.format_commit_list(imported_commits,
                                                  full_directory)
            links_list = '\n[0]: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/web_test_expectations.md\n'
            description = (prologue + failure_list + expectations_statement +
                           range_statement + commit_list + links_list)
            bug = MonorailIssue.new_chromium_issue(summary,
                                                   description,
                                                   cc,
                                                   components,
                                                   labels=['Test-WebTest'])
            _log.info(bug)
            _log.info("WPT-NOTIFY enabled in %s; adding the bug to the pending list." % full_directory)
            bugs.append(bug)
        return bugs
def create_bugs_from_new_failures ( self , wpt_revision_start , wpt_revision_end , gerrit_url ) : imported_commits = self . local_wpt . commits_in_range ( wpt_revision_start , wpt_revision_end ) bugs = [ ] for directory , failures in self . new_failures_by_directory . items ( ) : summary = '[WPT] New failures introduced in {} by import {}' . format ( directory , gerrit_url ) full_directory = self . host . filesystem . join ( self . finder . web_tests_dir ( ) , directory ) owners_file = self . host . filesystem . join ( full_directory , 'OWNERS' ) metadata_file = self . host . filesystem . join ( full_directory , 'DIR_METADATA' ) is_wpt_notify_enabled = False try : is_wpt_notify_enabled = self . owners_extractor . is_wpt_notify_enabled ( metadata_file ) except KeyError : _log . info ( 'KeyError when parsing %s' % metadata_file ) if not is_wpt_notify_enabled : _log . info ( "WPT-NOTIFY disabled in %s." % full_directory ) continue owners = self . owners_extractor . extract_owners ( owners_file ) cc = owners component = self . owners_extractor . extract_component ( metadata_file ) components = [ component ] if component else None prologue = ( 'WPT import {} introduced new failures in {}:\n\n' 'List of new failures:\n' . format ( gerrit_url , directory ) ) failure_list = '' for failure in failures : failure_list += str ( failure ) + '\n' expectations_statement = ( '\nExpectations or baseline files [0] have been automatically ' 'added for the failing results to keep the bots green. Please ' 'investigate the new failures and triage as appropriate.\n' ) range_statement = '\nThis import contains upstream changes from {} to {}:\n' . format ( wpt_revision_start , wpt_revision_end ) commit_list = self . format_commit_list ( imported_commits , full_directory ) links_list = '\n[0]: https://chromium.googlesource.com/chromium/src/+/HEAD/docs/testing/web_test_expectations.md\n' description = ( prologue + failure_list + expectations_statement + range_statement + commit_list + links_list ) bug = MonorailIssue . new_chromium_issue ( summary , description , cc , components , labels = [ 'Test-WebTest' ] ) _log . info ( bug ) _log . info ( "WPT-NOTIFY enabled in %s; adding the bug to the pending list." % full_directory ) bugs . append ( bug ) return bugs
Files bug reports for new failures.
Files bug reports for new failures .
"""Files bug reports for new failures.

        Args:
            wpt_revision_start: The start of the imported WPT revision range
                (exclusive), i.e. the last imported revision.
            wpt_revision_end: The end of the imported WPT revision range
                (inclusive), i.e. the current imported revision.
            gerrit_url: Gerrit URL of the CL.

        Return:
            A list of MonorailIssue objects that should be filed.
        """ # owners may be empty but not None. # component could be None.
self
wpt_revision_start
The start of the imported WPT revision range
(exclusive), i.e. the last imported revision.
The start of the imported WPT revision range ( exclusive ) i . e . the last imported revision .
wpt_revision_end
The end of the imported WPT revision range
(inclusive), i.e. the current imported revision.
The end of the imported WPT revision range ( inclusive ) i . e . the current imported revision .
gerrit_url
Gerrit URL of the CL.
Gerrit URL of the CL .