Add url to author payloads (#137)

We have urls for all the author types, so for consistency across GitHub
payloads, I am adding urls to the author paylods.

Test plan:
Check that snapshot changes consist entirely of adding urls, and that
the urls are appropraite.
This commit is contained in:
Dandelion Mané 2018-04-23 18:30:19 -04:00 committed by GitHub
parent e191614dd4
commit 01634aabcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 1 deletions

View File

@ -157,6 +157,7 @@ https://github.com/sourcecred/example-repo/issues/6#issuecomment-373768538",
"id": "MDQ6VXNlcjE0MDAwMjM=", "id": "MDQ6VXNlcjE0MDAwMjM=",
"payload": Object { "payload": Object {
"login": "decentralion", "login": "decentralion",
"url": "https://github.com/decentralion",
}, },
"rendered": <div> "rendered": <div>
type: type:
@ -170,6 +171,7 @@ https://github.com/sourcecred/example-repo/issues/6#issuecomment-373768538",
"id": "MDQ6VXNlcjQzMTc4MDY=", "id": "MDQ6VXNlcjQzMTc4MDY=",
"payload": Object { "payload": Object {
"login": "wchargin", "login": "wchargin",
"url": "https://github.com/wchargin",
}, },
"rendered": <div> "rendered": <div>
type: type:

View File

@ -23,6 +23,7 @@ Object {
"{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object { "{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object {
"payload": Object { "payload": Object {
"login": "decentralion", "login": "decentralion",
"url": "https://github.com/decentralion",
}, },
}, },
"{\\"id\\":\\"MDU6SXNzdWUzMDA5MzQ4MTg=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"ISSUE\\"}": Object { "{\\"id\\":\\"MDU6SXNzdWUzMDA5MzQ4MTg=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"ISSUE\\"}": Object {
@ -132,6 +133,7 @@ Object {
"{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object { "{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object {
"payload": Object { "payload": Object {
"login": "decentralion", "login": "decentralion",
"url": "https://github.com/decentralion",
}, },
}, },
"{\\"id\\":\\"MDU6SXNzdWUzMDU5OTM3NzM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"ISSUE\\"}": Object { "{\\"id\\":\\"MDU6SXNzdWUzMDU5OTM3NzM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"ISSUE\\"}": Object {
@ -291,11 +293,13 @@ Object {
"{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object { "{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object {
"payload": Object { "payload": Object {
"login": "decentralion", "login": "decentralion",
"url": "https://github.com/decentralion",
}, },
}, },
"{\\"id\\":\\"MDQ6VXNlcjQzMTc4MDY=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object { "{\\"id\\":\\"MDQ6VXNlcjQzMTc4MDY=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object {
"payload": Object { "payload": Object {
"login": "wchargin", "login": "wchargin",
"url": "https://github.com/wchargin",
}, },
}, },
}, },
@ -369,6 +373,7 @@ Object {
"{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object { "{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object {
"payload": Object { "payload": Object {
"login": "decentralion", "login": "decentralion",
"url": "https://github.com/decentralion",
}, },
}, },
}, },
@ -814,11 +819,13 @@ https://github.com/sourcecred/example-repo/issues/6#issuecomment-373768538",
"{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object { "{\\"id\\":\\"MDQ6VXNlcjE0MDAwMjM=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object {
"payload": Object { "payload": Object {
"login": "decentralion", "login": "decentralion",
"url": "https://github.com/decentralion",
}, },
}, },
"{\\"id\\":\\"MDQ6VXNlcjQzMTc4MDY=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object { "{\\"id\\":\\"MDQ6VXNlcjQzMTc4MDY=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"USER\\"}": Object {
"payload": Object { "payload": Object {
"login": "wchargin", "login": "wchargin",
"url": "https://github.com/wchargin",
}, },
}, },
"{\\"id\\":\\"MDU6SXNzdWUzMDA5MzQ4MTg=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"ISSUE\\"}": Object { "{\\"id\\":\\"MDU6SXNzdWUzMDA5MzQ4MTg=\\",\\"pluginName\\":\\"sourcecred/github-beta\\",\\"repositoryName\\":\\"sourcecred/example-repo\\",\\"type\\":\\"ISSUE\\"}": Object {

View File

@ -57,16 +57,19 @@ export type PullRequestReviewCommentNodePayload = {|
export const USER_NODE_TYPE: "USER" = "USER"; export const USER_NODE_TYPE: "USER" = "USER";
export type UserNodePayload = {| export type UserNodePayload = {|
+login: string, +login: string,
+url: string,
|}; |};
export const BOT_NODE_TYPE: "BOT" = "BOT"; export const BOT_NODE_TYPE: "BOT" = "BOT";
export type BotNodePayload = {| export type BotNodePayload = {|
+login: string, +login: string,
+url: string,
|}; |};
export const ORGANIZATION_NODE_TYPE: "ORGANIZATION" = "ORGANIZATION"; export const ORGANIZATION_NODE_TYPE: "ORGANIZATION" = "ORGANIZATION";
export type OrganizationNodePayload = {| export type OrganizationNodePayload = {|
+login: string, +login: string,
+url: string,
|}; |};
export type AuthorNodeType = export type AuthorNodeType =
@ -208,7 +211,10 @@ export class GithubParser {
>, >,
authorJson: * authorJson: *
) { ) {
let authorPayload: AuthorNodePayload = {login: authorJson.login}; let authorPayload: AuthorNodePayload = {
login: authorJson.login,
url: authorJson.url,
};
let authorType: NodeType; let authorType: NodeType;
switch (authorJson.__typename) { switch (authorJson.__typename) {
case "User": case "User":