@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Extract GitHub actor IDs from GitHub events

Summary: Ref T10538. This probably gets push events where GitHub does not recognize the author wrong, but I don't have any of those yet.

Test Plan: Added and ran unit tests.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10538

Differential Revision: https://secure.phabricator.com/D15540

+44 -19
+5
src/applications/nuance/github/NuanceGitHubRawEvent.php
··· 236 236 $title); 237 237 } 238 238 239 + public function getActorGitHubUserID() { 240 + $raw = $this->raw; 241 + return (int)idxv($raw, array('actor', 'id')); 242 + } 243 + 239 244 private function getTargetObjectName() { 240 245 if ($this->isPullRequestEvent()) { 241 246 $number = $this->getRawIssueNumber();
+1
src/applications/nuance/github/__tests__/NuanceGitHubRawEventTestCase.php
··· 52 52 'uri' => $event->getURI(), 53 53 'title.full' => $event->getEventFullTitle(), 54 54 'comment' => $event->getComment(), 55 + 'actor.id' => $event->getActorGitHubUserID(), 55 56 ); 56 57 57 58 // Only verify the keys which are actually present in the test. This
+2 -1
src/applications/nuance/github/__tests__/issueevents/assigned.txt
··· 113 113 "issue.number": 1, 114 114 "id": 583217900, 115 115 "uri": "https://github.com/epriestley/poems/issues/1#event-583217900", 116 - "title.full": "GitHub epriestley/poems Issue #1 (Assigned: epriestley)" 116 + "title.full": "GitHub epriestley/poems Issue #1 (Assigned: epriestley)", 117 + "actor.id": 102631 117 118 }
+2 -1
src/applications/nuance/github/__tests__/issueevents/closed.txt
··· 75 75 "issue.number": 1, 76 76 "id": 583218864, 77 77 "uri": "https://github.com/epriestley/poems/issues/1#event-583218864", 78 - "title.full": "GitHub epriestley/poems Issue #1 (Closed)" 78 + "title.full": "GitHub epriestley/poems Issue #1 (Closed)", 79 + "actor.id": 102631 79 80 }
+2 -1
src/applications/nuance/github/__tests__/issueevents/demilestoned.txt
··· 78 78 "issue.number": 1, 79 79 "id": 583218613, 80 80 "uri": "https://github.com/epriestley/poems/issues/1#event-583218613", 81 - "title.full": "GitHub epriestley/poems Issue #1 (Removed Milestone: b)" 81 + "title.full": "GitHub epriestley/poems Issue #1 (Removed Milestone: b)", 82 + "actor.id": 102631 82 83 }
+2 -1
src/applications/nuance/github/__tests__/issueevents/labeled.txt
··· 79 79 "issue.number": 1, 80 80 "id": 583217784, 81 81 "uri": "https://github.com/epriestley/poems/issues/1#event-583217784", 82 - "title.full": "GitHub epriestley/poems Issue #1 (Added Label: bug)" 82 + "title.full": "GitHub epriestley/poems Issue #1 (Added Label: bug)", 83 + "actor.id": 102631 83 84 }
+2 -1
src/applications/nuance/github/__tests__/issueevents/milestoned.txt
··· 78 78 "issue.number": 1, 79 79 "id": 583217866, 80 80 "uri": "https://github.com/epriestley/poems/issues/1#event-583217866", 81 - "title.full": "GitHub epriestley/poems Issue #1 (Added Milestone: b)" 81 + "title.full": "GitHub epriestley/poems Issue #1 (Added Milestone: b)", 82 + "actor.id": 102631 82 83 }
+2 -1
src/applications/nuance/github/__tests__/issueevents/renamed.txt
··· 79 79 "issue.number": 1, 80 80 "id": 583218162, 81 81 "uri": "https://github.com/epriestley/poems/issues/1#event-583218162", 82 - "title.full": "GitHub epriestley/poems Issue #1 (Renamed)" 82 + "title.full": "GitHub epriestley/poems Issue #1 (Renamed)", 83 + "actor.id": 102631 83 84 }
+2 -1
src/applications/nuance/github/__tests__/issueevents/reopened.txt
··· 75 75 "issue.number": 1, 76 76 "id": 583218814, 77 77 "uri": "https://github.com/epriestley/poems/issues/1#event-583218814", 78 - "title.full": "GitHub epriestley/poems Issue #1 (Reopened)" 78 + "title.full": "GitHub epriestley/poems Issue #1 (Reopened)", 79 + "actor.id": 102631 79 80 }
+2 -1
src/applications/nuance/github/__tests__/issueevents/unassigned.txt
··· 113 113 "issue.number": 1, 114 114 "id": 583218511, 115 115 "uri": "https://github.com/epriestley/poems/issues/1#event-583218511", 116 - "title.full": "GitHub epriestley/poems Issue #1 (Unassigned: epriestley)" 116 + "title.full": "GitHub epriestley/poems Issue #1 (Unassigned: epriestley)", 117 + "actor.id": 102631 117 118 }
+2 -1
src/applications/nuance/github/__tests__/issueevents/unlabeled.txt
··· 79 79 "issue.number": 1, 80 80 "id": 583218703, 81 81 "uri": "https://github.com/epriestley/poems/issues/1#event-583218703", 82 - "title.full": "GitHub epriestley/poems Issue #1 (Removed Label: bug)" 82 + "title.full": "GitHub epriestley/poems Issue #1 (Removed Label: bug)", 83 + "actor.id": 102631 83 84 }
+2 -1
src/applications/nuance/github/__tests__/issueevents/unlocked.txt
··· 75 75 "issue.number": 1, 76 76 "id": 583218062, 77 77 "uri": "https://github.com/epriestley/poems/issues/1#event-583218062", 78 - "title.full": "GitHub epriestley/poems Issue #1 (Unlocked)" 78 + "title.full": "GitHub epriestley/poems Issue #1 (Unlocked)", 79 + "actor.id": 102631 79 80 }
+2 -1
src/applications/nuance/github/__tests__/repositoryevents/CreateEvent.tag.txt
··· 33 33 "pull.number": null, 34 34 "id": 3784548642, 35 35 "uri": "https://github.com/epriestley/poems/commits/phabricator/diff/400", 36 - "title.full": "GitHub epriestley/poems Tag phabricator/diff/400 (Created)" 36 + "title.full": "GitHub epriestley/poems Tag phabricator/diff/400 (Created)", 37 + "actor.id": 102631 37 38 }
+2 -1
src/applications/nuance/github/__tests__/repositoryevents/IssueCommentEvent.created.pull.txt
··· 161 161 "id": 3740938746, 162 162 "uri": "https://github.com/epriestley/poems/pull/2#issuecomment-194282800", 163 163 "title.full": "GitHub epriestley/poems Pull Request #2 (Comment)", 164 - "comment": "wub wub" 164 + "comment": "wub wub", 165 + "actor.id": 102631 165 166 }
+2 -1
src/applications/nuance/github/__tests__/repositoryevents/IssueCommentEvent.created.txt
··· 98 98 "id": 3733510485, 99 99 "uri": "https://github.com/epriestley/poems/issues/1#issuecomment-193528669", 100 100 "title.full": "GitHub epriestley/poems Issue #1 (Comment)", 101 - "comment": "comment on issue" 101 + "comment": "comment on issue", 102 + "actor.id": 102631 102 103 }
+2 -1
src/applications/nuance/github/__tests__/repositoryevents/IssuesEvent.closed.txt
··· 69 69 "issue.number": 1, 70 70 "id": 3740905151, 71 71 "uri": "https://github.com/epriestley/poems/issues/1#event-3740905151", 72 - "title.full": "GitHub epriestley/poems Issue #1 (Closed)" 72 + "title.full": "GitHub epriestley/poems Issue #1 (Closed)", 73 + "actor.id": 102631 73 74 }
+2 -1
src/applications/nuance/github/__tests__/repositoryevents/IssuesEvent.opened.txt
··· 69 69 "issue.number": 1, 70 70 "id": 3733509737, 71 71 "uri": "https://github.com/epriestley/poems/issues/1#event-3733509737", 72 - "title.full": "GitHub epriestley/poems Issue #1 (Created)" 72 + "title.full": "GitHub epriestley/poems Issue #1 (Created)", 73 + "actor.id": 102631 73 74 }
+2 -1
src/applications/nuance/github/__tests__/repositoryevents/IssuesEvent.reopened.txt
··· 69 69 "issue.number": 1, 70 70 "id": 3740908680, 71 71 "uri": "https://github.com/epriestley/poems/issues/1#event-3740908680", 72 - "title.full": "GitHub epriestley/poems Issue #1 (Reopened)" 72 + "title.full": "GitHub epriestley/poems Issue #1 (Reopened)", 73 + "actor.id": 102631 73 74 }
+2 -1
src/applications/nuance/github/__tests__/repositoryevents/PullRequestEvent.opened.txt
··· 333 333 "pull.number": 2, 334 334 "id": 3740936638, 335 335 "uri": "https://github.com/epriestley/poems/pull/2#event-3740936638", 336 - "title.full": "GitHub epriestley/poems Pull Request #2 (Created)" 336 + "title.full": "GitHub epriestley/poems Pull Request #2 (Created)", 337 + "actor.id": 102631 337 338 }
+2 -1
src/applications/nuance/github/__tests__/repositoryevents/PushEvent.txt
··· 44 44 "issue.number": null, 45 45 "id": 3498724127, 46 46 "uri": "https://github.com/epriestley/poems/commits/c829132d37c4c1da80d319942a5a1e500632b52f", 47 - "title.full": "GitHub epriestley/poems Branch master (Pushed: c829132d37c4)" 47 + "title.full": "GitHub epriestley/poems Branch master (Pushed: c829132d37c4)", 48 + "actor.id": 102631 48 49 }
+2 -1
src/applications/nuance/github/__tests__/repositoryevents/WatchEvent.started.txt
··· 28 28 "pull.number": null, 29 29 "id": 3740950917, 30 30 "uri": null, 31 - "title.full": "GitHub epriestley/poems User epriestley (Watched)" 31 + "title.full": "GitHub epriestley/poems User epriestley (Watched)", 32 + "actor.id": 102631 32 33 }