Details
- I created a Phabricator leaderboard thread in my local environment
- I changed phabLeaderboardChannel with the value of that thread ID
- I patched postLeaderboard to test the behavior on January 2024
- yarn script dist/scripts/phab-leaderboard.js
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
keyserver/src/cron/phab-leaderboard.js | ||
---|---|---|
150–161 ↗ | (On Diff #35047) | This is arguably the most complex query here because the double nesting. The innermost query here is necessary because we want one row for each "action". Phabricator creates multiple rows when you eg. add a comment AND request changes, but we need to be able to see those combined so we can differentiate from somebody resigning with a review, versus just resigning (without reviewing) JSON_ARRAYAGG lets us create an array with a list of the actions that were taken |
164–172 ↗ | (On Diff #35047) | In the second inner query, we try to filter to only those actions that constitute a proper review. The first condition excludes "simple resignations", which are when somebody resigns without any inline comments. The second condition looks to see if a review was made. Phabricator's transactions table includes entries for eg. referencing this diff in another diff, so we have to exclude those. The three actions we're looking for in the second condition are:
I should also check to see if eg. accepting a diff when you're not blocking yields a "differential.revision.status". If not, I'll need to add some more ORs here for accepting or rejecting |
keyserver/src/cron/phab-leaderboard.js | ||
---|---|---|
148–161 ↗ | (On Diff #35048) | This is arguably the most complex query here because the double nesting. The innermost query here is necessary because we want one row for each "action". Phabricator creates multiple rows when you eg. add a comment AND request changes, but we need to be able to see those combined so we can differentiate from somebody resigning with a review, versus just resigning (without reviewing) JSON_ARRAYAGG lets us create an array with a list of the actions that were taken |
164–174 ↗ | (On Diff #35048) | In the second inner query, we try to filter to only those actions that constitute a proper review. The first condition excludes "simple resignations", which are when somebody resigns without any inline comments. The second condition looks to see if a review was made. Phabricator's transactions table includes entries for eg. referencing this diff in another diff, so we have to exclude those. The five actions we're looking for in the second condition are:
|
keyserver/src/cron/phab-leaderboard.js | ||
---|---|---|
164–174 ↗ | (On Diff #35048) | Open to removing differential.revision.status, actually... it barely changes the numbers, and arguably a status change without an accompanying comment / accept / reject doesn't really count as a review |
Looks good
(FWIW, you can get an array of transactions for any differential revision with transaction.search endpoint):