Return total lines changed in the PR (additions + deletions).
(pr_number, repo, token)
| 126 | |
| 127 | |
| 128 | def get_pr_total_changes(pr_number, repo, token): |
| 129 | """Return total lines changed in the PR (additions + deletions).""" |
| 130 | total_changes = 0 |
| 131 | page = 1 |
| 132 | while True: |
| 133 | results = github_request( |
| 134 | "GET", |
| 135 | f"/pulls/{pr_number}/files", |
| 136 | token, |
| 137 | repo, |
| 138 | params={"per_page": GITHUB_PER_PAGE, "page": page}, |
| 139 | ) |
| 140 | if not results: |
| 141 | break |
| 142 | total_changes += sum(f["changes"] for f in results) |
| 143 | if len(results) < GITHUB_PER_PAGE: |
| 144 | break |
| 145 | page += 1 |
| 146 | return total_changes |
| 147 | |
| 148 | |
| 149 | def get_comment_ids_to_delete(pr_number, repo, token): |
no test coverage detected