Skip to content

feat(want_lgtm): add review state evaluator - #5178

Open
jtmcdole wants to merge 2 commits into
want-lgtm-04-parserfrom
want-lgtm-05-evaluator
Open

jtmcdole wants to merge 2 commits into
want-lgtm-04-parserfrom
want-lgtm-05-evaluator

Conversation

@jtmcdole

@jtmcdole jtmcdole commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Adds evaluateWantLgtm implementing the RFC 610.0001 review verdict rules. Tracks timeline ordering when reviews are re-requested after a prior approval, excludes the PR author and roller accounts, and clamps check-run titles to 255 characters.

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 ← you are here
6 #5179 Firestore state & review webhook models
7 #5180 Paginated GraphQL snapshot client
8 #5181 GitHub check-run writer & cache
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 evaluateWantLgtm service and its corresponding unit tests to evaluate a pull request's review status against a parsed WANT_LGTM= directive. The reviewer suggests refactoring if-else blocks checking TimelineReviewAction into exhaustive switch statements in both _resolveAllCohort and _findUnremovedTimelineRequest to leverage Dart 3's exhaustiveness checking for improved safety and maintainability.

@jtmcdole
jtmcdole force-pushed the want-lgtm-05-evaluator branch from fb99d13 to 79ec8a3 Compare November 9, 2026 21:56
- Adds evaluateWantLgtm implementing RFC 610.0001 Section 3.3 truth table.
- Enforces strict timeline ordering for re-requested reviews after approval.
- Excludes PR author and roller accounts from cohorts and caps check titles at 255 chars.
@jtmcdole
jtmcdole force-pushed the want-lgtm-05-evaluator branch from 79ec8a3 to 553826d Compare November 9, 2026 22:10
- Rename _capTitle to _clampTitleLength.
- Switch TimelineReviewAction checks to exhaustive switch statements.
- Use collection-for loops instead of spread .map() calls.
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