Skip to content

Resolve non-noreply co-author emails in verifyPeerReview - #107

Merged
roryabraham merged 3 commits into
mainfrom
nicolas/verify-peer-review-resolve-non-noreply-coauthors
Sep 9, 2026
Merged

roryabraham merged 3 commits into
mainfrom
nicolas/verify-peer-review-resolve-non-noreply-coauthors

Conversation

@NicolasBonet

@NicolasBonet NicolasBonet commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Details

getCommitAuthors only resolved users.noreply.github.com co-author emails, so a trailer like Co-authored-by: RachCHopkins <rachael@expensify.com> threw Unresolved co-author and failed the check.

The noreply pattern stays as the fast path. For any other email, a new getCommitAuthorLoginsByEmail helper queries the GraphQL Commit.authors connection, which GitHub resolves against every verified email on an account, private ones included. Emails GitHub still can't match fail the check as before, so the security posture is unchanged.

Related Issues

$ https://github.com/Expensify/Expensify/issues/680362

Manual Tests

Unit tests cover the noreply fast path, the GraphQL fallback, case-insensitive matching, and the unresolved-email failure.

Live check against the failing PR:

  1. Call evaluatePeerReview for Expensify/Integration-Server#9322 with a real client and GITHUB_TOKEN set.
  2. Confirm the log shows Resolved co-author email through GitHub commit authors for rachael@expensify.comRachCHopkins.
  3. Confirm the result is pass with 1/1 independent eligible reviewer approval(s).

Linked PRs

N/A

Co-authored-by trailers on bot commits don't always use a
users.noreply.github.com address, e.g.
`Co-authored-by: RachCHopkins <rachael@expensify.com>`. The check threw
on the first such trailer, even when a second noreply trailer named the
same person.

Keep the noreply pattern as the fast path and fall back to the GraphQL
Commit.authors connection, which GitHub resolves against every verified
email on an account, including private ones. Emails GitHub can't match
still fail the check.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T23:25:00.610857Z b0af3e7 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8be8b66813

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/libs/GitHubUtils/getCommitAuthorLoginsByEmail.ts
GraphQL Commit.authors returns at most 100 entries per page, so a
co-author past the first page would have been reported as unresolved.
Follow pageInfo cursors, capped at three pages so a pathological commit
message can't turn into unbounded API requests.
Comment thread scripts/libs/GitHubUtils/getCommitAuthorLoginsByEmail.ts Outdated
One page of 100 covers every real commit; note the limit in the doc
comment.
@roryabraham
roryabraham merged commit 1aab1a2 into main Sep 9, 2026
9 of 11 checks passed
@roryabraham
roryabraham deleted the nicolas/verify-peer-review-resolve-non-noreply-coauthors branch September 9, 2026 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants