(pr_nodes: list[PullRequestNode])
| 173 | |
| 174 | |
| 175 | def get_contributors(pr_nodes: list[PullRequestNode]) -> ContributorsResults: |
| 176 | contributors = Counter[str]() |
| 177 | translation_reviewers = Counter[str]() |
| 178 | translators = Counter[str]() |
| 179 | authors: dict[str, Author] = {} |
| 180 | |
| 181 | for pr in pr_nodes: |
| 182 | if pr.author: |
| 183 | authors[pr.author.login] = pr.author |
| 184 | is_lang = False |
| 185 | for label in pr.labels.nodes: |
| 186 | if label.name == "lang-all": |
| 187 | is_lang = True |
| 188 | break |
| 189 | for review in pr.reviews.nodes: |
| 190 | if review.author: |
| 191 | authors[review.author.login] = review.author |
| 192 | if is_lang: |
| 193 | translation_reviewers[review.author.login] += 1 |
| 194 | if pr.state == "MERGED" and pr.author: |
| 195 | if is_lang: |
| 196 | translators[pr.author.login] += 1 |
| 197 | else: |
| 198 | contributors[pr.author.login] += 1 |
| 199 | return ContributorsResults( |
| 200 | contributors=contributors, |
| 201 | translation_reviewers=translation_reviewers, |
| 202 | translators=translators, |
| 203 | authors=authors, |
| 204 | ) |
| 205 | |
| 206 | |
| 207 | def get_users_to_write( |
no test coverage detected
searching dependent graphs…