data/data_collection.py
def _get_check_run_results(
            self, commits: List[dict]) -> List[str]:
        """Retrieves the check run results given a list of commit dicts.

        Args:
            commits: A list of dicts. Each dict is a commit information.
        Returns:
            A list of strs. Each str stands for the final check run status.
            The status can be 'none', 'passed', 'failed'.
        """
        failed_status = {'failure', 'cancelled', 'timed_out', 'action_required'}
        check_run_results = []
        for commit in commits:
            commit_ref = commit['sha']
            commit_check_run_results = get_commit_check_runs(
                self._repo_name, commit_ref, self._auth)
            if not commit_check_run_results:
                continue
            num_check_runs = commit_check_run_results['total_count']
            if num_check_runs == 0:
                check_run_results.append('none')
                continue
            status = 'passed'
            for commit_check_run_result in commit_check_run_results[
                    'check_runs']:
                conclusion = commit_check_run_result['conclusion']
                if conclusion in failed_status:
                    status = 'failed'
                    break
            check_run_results.append(status)
        return check_run_results
Retrieves the check run results given a list of commit dicts.

        Args:
            commits: A list of dicts. Each dict is a commit information.
        Returns:
            A list of strs. Each str stands for the final check run status.
            The status can be 'none', 'passed', 'failed'.
        
Retrieves the check run results given a list of commit dicts.
Retrieves the check run results given a list of commit dicts .
def _get_check_run_results(
            self, commits: List[dict]) -> List[str]:
        failed_status = {'failure', 'cancelled', 'timed_out', 'action_required'}
        check_run_results = []
        for commit in commits:
            commit_ref = commit['sha']
            commit_check_run_results = get_commit_check_runs(
                self._repo_name, commit_ref, self._auth)
            if not commit_check_run_results:
                continue
            num_check_runs = commit_check_run_results['total_count']
            if num_check_runs == 0:
                check_run_results.append('none')
                continue
            status = 'passed'
            for commit_check_run_result in commit_check_run_results[
                    'check_runs']:
                conclusion = commit_check_run_result['conclusion']
                if conclusion in failed_status:
                    status = 'failed'
                    break
            check_run_results.append(status)
        return check_run_results
def _get_check_run_results ( self , commits : List [ dict ] ) -> List [ str ] : failed_status = { 'failure' , 'cancelled' , 'timed_out' , 'action_required' } check_run_results = [ ] for commit in commits : commit_ref = commit [ 'sha' ] commit_check_run_results = get_commit_check_runs ( self . _repo_name , commit_ref , self . _auth ) if not commit_check_run_results : continue num_check_runs = commit_check_run_results [ 'total_count' ] if num_check_runs == 0 : check_run_results . append ( 'none' ) continue status = 'passed' for commit_check_run_result in commit_check_run_results [ 'check_runs' ] : conclusion = commit_check_run_result [ 'conclusion' ] if conclusion in failed_status : status = 'failed' break check_run_results . append ( status ) return check_run_results
Retrieves the check run results given a list of commit dicts.
Retrieves the check run results given a list of commit dicts .
"""Retrieves the check run results given a list of commit dicts.

        Args:
            commits: A list of dicts. Each dict is a commit information.
        Returns:
            A list of strs. Each str stands for the final check run status.
            The status can be 'none', 'passed', 'failed'.
        """
A list of strs. Each str stands for the final check run status.
The status can be 'none', 'passed', 'failed'.
A list of strs . Each str stands for the final check run status . The status can be ' none ' ' passed ' ' failed ' .
self
commits
List[dict]
A list of dicts. Each dict is a commit information.
A list of dicts . Each dict is a commit information .