From 6c532b51b61580891954bc2f4bdcaf7952b4741b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dandelion=20Man=C3=A9?= Date: Sun, 1 Mar 2020 13:24:35 -0800 Subject: [PATCH] Modify the GitHub plugin to get pulls' base refs (#1683) This will enable us to mint cred on merges to master; see #1682. Test plan: Inspect snapshot changes, `yarn test --full` passes. --- src/plugins/github/example/example-github.json | 3 +++ src/plugins/github/graphqlTypes.js | 1 + src/plugins/github/schema.js | 1 + 3 files changed, 5 insertions(+) diff --git a/src/plugins/github/example/example-github.json b/src/plugins/github/example/example-github.json index ae6e01f..16d2e1e 100644 --- a/src/plugins/github/example/example-github.json +++ b/src/plugins/github/example/example-github.json @@ -753,6 +753,7 @@ "login": "decentralion", "url": "https://github.com/decentralion" }, + "baseRefName": "master", "body": "Oh look, it's a pull request.", "comments": [ { @@ -867,6 +868,7 @@ "login": "decentralion", "url": "https://github.com/decentralion" }, + "baseRefName": "master", "body": "@wchargin could you please do the following:\r\n- add a commit comment\r\n- add a review comment requesting some trivial change\r\n- i'll change it\r\n- then approve the pr", "comments": [ { @@ -1215,6 +1217,7 @@ "login": "decentralion", "url": "https://github.com/decentralion" }, + "baseRefName": "master", "body": "Nominally paired with @wchargin", "comments": [ ], diff --git a/src/plugins/github/graphqlTypes.js b/src/plugins/github/graphqlTypes.js index 197cdf3..3bc73ab 100644 --- a/src/plugins/github/graphqlTypes.js +++ b/src/plugins/github/graphqlTypes.js @@ -77,6 +77,7 @@ export type PullRequest = {| +__typename: "PullRequest", +additions: Int, +author: null | Actor, + +baseRefName: String, +body: String, +comments: $ReadOnlyArray, +createdAt: DateTime, diff --git a/src/plugins/github/schema.js b/src/plugins/github/schema.js index 7f098ba..7fce21a 100644 --- a/src/plugins/github/schema.js +++ b/src/plugins/github/schema.js @@ -63,6 +63,7 @@ export default function schema(): Schema.Schema { reviews: s.connection("PullRequestReview"), reactions: s.connection("Reaction"), createdAt: s.primitive(s.nonNull("DateTime")), + baseRefName: s.primitive(s.nonNull("String")), }), IssueComment: s.object({ id: s.id(),