Skip to content

Commit 6040b31

Browse files
Address AI feedback
Signed-off-by: Lukasz Gryglicki <[email protected]> Assisted by [OpenAI](https://platform.openai.com/) Assisted by [GitHub Copilot](https://github.com/features/copilot)
1 parent dfc44b7 commit 6040b31

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

cla-backend-go/github/github_repository.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1574,7 +1574,7 @@ query($owner:String!, $name:String!, $head:GitObjectID!, $first:Int!, $after:Str
15741574
break
15751575
}
15761576
if !hist.Repository.Object.History.PageInfo.HasNextPage {
1577-
return nil, false, fmt.Errorf("merge-base commit not found in PR history")
1577+
return GetPullRequestCommitAuthorsREST(ctx, usersService, installationID, pullRequestID, owner, repo, withCoAuthors)
15781578
}
15791579
cur := hist.Repository.Object.History.PageInfo.EndCursor
15801580
after = &cur

cla-backend/cla/models/github_models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2279,7 +2279,6 @@ def iter_pr_commits_full(g, owner: str, repo_name: str, number: int, page_size:
22792279
# merge-base not found — extremely rare (rebases or unusual ancestry).
22802280
# Fall back to non-GQL old approach (limited to 250 commits but still better that error)
22812281
raise ValueError("merge-base commit not found in PR commit history")
2282-
# return
22832282

22842283
after = hist["pageInfo"]["endCursor"]
22852284
safety_pages += 1
@@ -2699,7 +2698,7 @@ def update_pull_request(
26992698
repo = getattr(getattr(pull_request, "base", None), "repo", None)
27002699
commit_obj = repo.get_commit(last_commit_sha)
27012700
except (GithubException, AttributeError, TypeError) as exc:
2702-
cla.log.error(f"{fn} - PR {pull_request.number}: exception getting base.sha: {exc}")
2701+
cla.log.error(f"{fn} - PR {pull_request.number}: exception getting commit sha: {exc}")
27032702
try:
27042703
commit_obj = pull_request.get_commits().reversed[0]
27052704
last_commit_sha = commit_obj.sha

cla-backend/cla/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1054,7 +1054,7 @@ def assemble_cla_comment(
10541054
missing_user_id=no_user_id,
10551055
)
10561056
body = badge + "<br />" + comment
1057-
if len(body) > 0xFF00:
1057+
if len(body.encode('utf-8')) > 0xFF00:
10581058
body = trim_comment(body, max_items=40, head=20, tail=20, ellipsis="…")
10591059
return body
10601060

0 commit comments

Comments
 (0)