Skip to content

feat(want_lgtm): add GitHub check run writer and Firestore cache - #5181

Open
jtmcdole wants to merge 2 commits into
want-lgtm-07-graphqlfrom
want-lgtm-08-check-writer
Open

jtmcdole wants to merge 2 commits into
want-lgtm-07-graphqlfrom
want-lgtm-08-check-writer

Conversation

@jtmcdole

@jtmcdole jtmcdole commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Adds WantLgtmCheckWriter to write GitHub Check Runs and persist WantLgtmState. Skips unchanged PATCH calls, recreates completed runs when reopened to pending, and writes neutral waivers.

WANT_LGTM Stack (RFC 610.0001)

Breaks the WANT_LGTM implementation into small, reviewable steps:

# PR Focus
1 #5174 Merge-group & check-run prep
2 #5175 Rollout flags & dynamic config
3 #5176 Directive, verdict & snapshot models
4 #5177 WANT_LGTM= body parser
5 #5178 Review cohort evaluator
6 #5179 Firestore state & review webhook models
7 #5180 Paginated GraphQL snapshot client
8 #5181 GitHub check-run writer & cache ← you are here
9 #5182 PR & merge-group reconciler
10 #5183 Webhook routing & Gold bypass
11 #5188 Firestore not-in query filter
12 #5184 Rollback check-run sweeper

Stack created with GitHub Stacks CLI • Give Feedback 💬

@jtmcdole
jtmcdole added this pull request to stack #5185 November 9, 2026 19:28

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the WantLgtmCheckWriter class to translate WANT_LGTM evaluation verdicts into GitHub Check Runs and persist their state in Firestore, along with comprehensive unit tests. Feedback on the implementation highlights a few key issues: first, started_at should be omitted when referencing an existing check run by ID to avoid resetting the check run's start time on GitHub; second, both writeWaivedCheckRun and writeRolledBackCheckRun should explicitly update the checkRunId and headSha fields when mutating an existingState in place to prevent Firestore from storing outdated values.

@jtmcdole
jtmcdole force-pushed the want-lgtm-08-check-writer branch from bea4f1a to 8d46796 Compare November 9, 2026 21:56
@jtmcdole
jtmcdole force-pushed the want-lgtm-08-check-writer branch from 8d46796 to 262e88c Compare November 9, 2026 22:10
@jtmcdole
jtmcdole force-pushed the want-lgtm-08-check-writer branch from 262e88c to e33ff49 Compare November 9, 2026 22:41
- Adds WantLgtmCheckWriter mapping verdicts to GitHub CheckRun status/conclusions.
- Suppresses redundant PATCH requests and Firestore writes on unchanged verdicts.
- Spawns a fresh check run on same-SHA completed -> in_progress reopens.
- Supports merge-group, directive-removed, closed-PR, and rollback neutral waivers.
@jtmcdole
jtmcdole force-pushed the want-lgtm-08-check-writer branch from e33ff49 to be90fd0 Compare November 9, 2026 23:39
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.

1 participant