third_party/blink/tools/blinkpy/w3c/wpt_github.py
def all_pull_requests(self):
        """Fetches the most recent (open and closed) PRs with the export label.

        The maximum number of PRs is pr_history_window. Search endpoint is used
        instead of listing PRs, because we need to filter by labels. Note that
        there are already more than MAX_PR_HISTORY_WINDOW export PRs, so we
        can't really find *all* of them; we fetch the most recently updated ones
        because we only check whether recent commits have been exported.

        API doc: https://developer.github.com/v3/search/#search-issues-and-pull-requests

        Returns:
            A list of PullRequest namedtuples.
        """
        path = ('/search/issues'
                '?q=repo:{}/{}%20type:pr%20label:{}'
                '&sort=updated'
                '&page=1'
                '&per_page={}').format(
                    WPT_GH_ORG, WPT_GH_REPO_NAME, EXPORT_PR_LABEL,
                    min(MAX_PER_PAGE, self._pr_history_window))
        all_prs = []
        while path is not None and len(all_prs) < self._pr_history_window:
            response = self.request(path, method='GET')
            if response.status_code == 200:
                if response.data['incomplete_results']:
                    raise GitHubError('complete results', 'incomplete results',
                                      'fetch all pull requests', path)

                prs = [
                    self.make_pr_from_item(item)
                    for item in response.data['items']
                ]
                all_prs += prs[:self._pr_history_window - len(all_prs)]
            else:
                raise GitHubError(200, response.status_code,
                                  'fetch all pull requests', path)
            path = self.extract_link_next(response.getheader('Link'))

        # There are way more than 1000 exported PRs on GitHub, so we should
        # always get at least pr_history_window PRs. This assertion is added to
        # mitigate transient GitHub API issues (crbug.com/814617).
        if len(all_prs) < self._pr_history_window:
            raise GitHubError('at least %d commits' % self._pr_history_window,
                              len(all_prs), 'fetch all pull requests')

        _log.info('Fetched %d PRs from GitHub.', len(all_prs))
        return all_prs
Fetches the most recent (open and closed) PRs with the export label.

        The maximum number of PRs is pr_history_window. Search endpoint is used
        instead of listing PRs, because we need to filter by labels. Note that
        there are already more than MAX_PR_HISTORY_WINDOW export PRs, so we
        can't really find *all* of them; we fetch the most recently updated ones
        because we only check whether recent commits have been exported.

        API doc: https://developer.github.com/v3/search/#search-issues-and-pull-requests

        Returns:
            A list of PullRequest namedtuples.
        
Fetches the most recent (open and closed) PRs with the export label.
The maximum number of PRs is pr_history_window. Search endpoint is used
instead of listing PRs, because we need to filter by labels. Note that
there are already more than MAX_PR_HISTORY_WINDOW export PRs, so we
can't really find *all* of them; we fetch the most recently updated ones
because we only check whether recent commits have been exported.


Fetches the most recent ( open and closed ) PRs with the export label . The maximum number of PRs is pr_history_window . Search endpoint is used instead of listing PRs because we need to filter by labels . Note that there are already more than MAX_PR_HISTORY_WINDOW export PRs so we can ' t really find * all * of them ; we fetch the most recently updated ones because we only check whether recent commits have been exported .
def all_pull_requests(self):
        path = ('/search/issues'
                '?q=repo:{}/{}%20type:pr%20label:{}'
                '&sort=updated'
                '&page=1'
                '&per_page={}').format(
                    WPT_GH_ORG, WPT_GH_REPO_NAME, EXPORT_PR_LABEL,
                    min(MAX_PER_PAGE, self._pr_history_window))
        all_prs = []
        while path is not None and len(all_prs) < self._pr_history_window:
            response = self.request(path, method='GET')
            if response.status_code == 200:
                if response.data['incomplete_results']:
                    raise GitHubError('complete results', 'incomplete results',
                                      'fetch all pull requests', path)
                prs = [
                    self.make_pr_from_item(item)
                    for item in response.data['items']
                ]
                all_prs += prs[:self._pr_history_window - len(all_prs)]
            else:
                raise GitHubError(200, response.status_code,
                                  'fetch all pull requests', path)
            path = self.extract_link_next(response.getheader('Link'))
        if len(all_prs) < self._pr_history_window:
            raise GitHubError('at least %d commits' % self._pr_history_window,
                              len(all_prs), 'fetch all pull requests')
        _log.info('Fetched %d PRs from GitHub.', len(all_prs))
        return all_prs
def all_pull_requests ( self ) : path = ( '/search/issues' '?q=repo:{}/{}%20type:pr%20label:{}' '&sort=updated' '&page=1' '&per_page={}' ) . format ( WPT_GH_ORG , WPT_GH_REPO_NAME , EXPORT_PR_LABEL , min ( MAX_PER_PAGE , self . _pr_history_window ) ) all_prs = [ ] while path is not None and len ( all_prs ) < self . _pr_history_window : response = self . request ( path , method = 'GET' ) if response . status_code == 200 : if response . data [ 'incomplete_results' ] : raise GitHubError ( 'complete results' , 'incomplete results' , 'fetch all pull requests' , path ) prs = [ self . make_pr_from_item ( item ) for item in response . data [ 'items' ] ] all_prs += prs [ : self . _pr_history_window - len ( all_prs ) ] else : raise GitHubError ( 200 , response . status_code , 'fetch all pull requests' , path ) path = self . extract_link_next ( response . getheader ( 'Link' ) ) if len ( all_prs ) < self . _pr_history_window : raise GitHubError ( 'at least %d commits' % self . _pr_history_window , len ( all_prs ) , 'fetch all pull requests' ) _log . info ( 'Fetched %d PRs from GitHub.' , len ( all_prs ) ) return all_prs
Fetches the most recent (open and closed) PRs with the export label.
Fetches the most recent ( open and closed ) PRs with the export label .
"""Fetches the most recent (open and closed) PRs with the export label.

        The maximum number of PRs is pr_history_window. Search endpoint is used
        instead of listing PRs, because we need to filter by labels. Note that
        there are already more than MAX_PR_HISTORY_WINDOW export PRs, so we
        can't really find *all* of them; we fetch the most recently updated ones
        because we only check whether recent commits have been exported.

        API doc: https://developer.github.com/v3/search/#search-issues-and-pull-requests

        Returns:
            A list of PullRequest namedtuples.
        """ # There are way more than 1000 exported PRs on GitHub, so we should # always get at least pr_history_window PRs. This assertion is added to # mitigate transient GitHub API issues (crbug.com/814617).
A list of PullRequest namedtuples.
A list of PullRequest namedtuples .
self