diff --git a/graphql/schema.graphql b/graphql/schema.graphql index 19fe0e7558..b8b414e6e4 100644 --- a/graphql/schema.graphql +++ b/graphql/schema.graphql @@ -319,6 +319,9 @@ interface Comment { # Errors why the current viewer can not edit this comment. viewerCannotEditReasons: [CommentCannotEditReason!]! + + # Did the viewer author this comment. + viewerDidAuthor: Boolean! } # The possible errors that will prevent a user from editting a comment. @@ -440,7 +443,7 @@ type Commit implements Node, GitObject { } # Represents a comment on a given Commit. -type CommitComment implements Node, Comment, Reactable { +type CommitComment implements Node, Comment, Reactable, RepositoryNode { # Identifies the user who created the comment. author: User @@ -519,6 +522,9 @@ type CommitComment implements Node, Comment, Reactable { # Errors why the current viewer can not edit this comment. viewerCannotEditReasons: [CommentCannotEditReason!]! + + # Did the viewer author this comment. + viewerDidAuthor: Boolean! } # The connection type for CommitComment. @@ -923,6 +929,9 @@ type GistComment implements Node, Comment { # Errors why the current viewer can not edit this comment. viewerCannotEditReasons: [CommentCannotEditReason!]! + + # Did the viewer author this comment. + viewerDidAuthor: Boolean! } # The connection type for Gist. @@ -1161,7 +1170,7 @@ type HeadRefRestoredEvent implements Node, IssueEvent { scalar HTML # An Issue is a place to discuss ideas, enhancements, tasks, and bugs for a project. -type Issue implements Node, Comment, Issueish, Reactable, Timeline, UniformResourceLocatable { +type Issue implements Node, Comment, Issueish, Reactable, RepositoryNode, Timeline, UniformResourceLocatable { # A list of Users assigned to the Issue. assignees( # Returns the first _n_ elements from the list. @@ -1325,6 +1334,9 @@ type Issue implements Node, Comment, Issueish, Reactable, Timeline, UniformResou # Errors why the current viewer can not edit this comment. viewerCannotEditReasons: [CommentCannotEditReason!]! + # Did the viewer author this comment. + viewerDidAuthor: Boolean! + # The websocket channel ID for live updates. websocket( # The channel to use. @@ -1333,7 +1345,7 @@ type Issue implements Node, Comment, Issueish, Reactable, Timeline, UniformResou } # Represents a comment on an Issue. -type IssueComment implements Node, Comment, Reactable { +type IssueComment implements Node, Comment, Reactable, RepositoryNode { # Identifies the author of the comment. author: User @@ -1386,8 +1398,8 @@ type IssueComment implements Node, Comment, Reactable { # The websocket channel ID for reaction live updates. reactionsWebsocket: String! - # The repository associated with this reaction subject. - repository: Repository! @deprecated(reason: "Future reaction subjects may not be scoped under repositories.") + # The repository associated with this node. + repository: Repository! # Identifies the date and time when the object was last updated. updatedAt: DateTime! @@ -1404,6 +1416,9 @@ type IssueComment implements Node, Comment, Reactable { # Errors why the current viewer can not edit this comment. viewerCannotEditReasons: [CommentCannotEditReason!]! + # Did the viewer author this comment. + viewerDidAuthor: Boolean! + # The websocket channel ID for live updates. websocket( # The channel to use. @@ -2565,7 +2580,7 @@ interface ProjectOwner { } # A repository pull request. -type PullRequest implements Node, Comment, Issueish, Reactable, Timeline, UniformResourceLocatable { +type PullRequest implements Node, Comment, Issueish, Reactable, RepositoryNode, Timeline, UniformResourceLocatable { # The user associated with this pull request. author: User @@ -2750,6 +2765,9 @@ type PullRequest implements Node, Comment, Issueish, Reactable, Timeline, Unifor # Errors why the current viewer can not edit this comment. viewerCannotEditReasons: [CommentCannotEditReason!]! + # Did the viewer author this comment. + viewerDidAuthor: Boolean! + # The websocket channel ID for live updates. websocket( # The channel to use. @@ -2791,7 +2809,7 @@ enum PullRequestPubSubTopic { } # A review object for a given pull request. -type PullRequestReview implements Node, Comment { +type PullRequestReview implements Node, Comment, RepositoryNode { # Identifies the author associated with this pull request review. author: User! @@ -2838,6 +2856,9 @@ type PullRequestReview implements Node, Comment { # Identifies the pull request associated with this pull request review. pullRequest: PullRequest! + # The repository associated with this node. + repository: Repository! + # Identifies the current state of the pull request review. state: PullRequestReviewState! @@ -2858,10 +2879,13 @@ type PullRequestReview implements Node, Comment { # Errors why the current viewer can not edit this comment. viewerCannotEditReasons: [CommentCannotEditReason!]! + + # Did the viewer author this comment. + viewerDidAuthor: Boolean! } # A review comment associated with a given repository pull request. -type PullRequestReviewComment implements Node, Comment, Reactable { +type PullRequestReviewComment implements Node, Comment, Reactable, RepositoryNode { # The user associated with this review comment. author: User @@ -2959,6 +2983,9 @@ type PullRequestReviewComment implements Node, Comment, Reactable { # Errors why the current viewer can not edit this comment. viewerCannotEditReasons: [CommentCannotEditReason!]! + # Did the viewer author this comment. + viewerDidAuthor: Boolean! + # The websocket channel ID for live updates. websocket( # The channel to use. @@ -4099,6 +4126,12 @@ enum RepositoryLockReason { MIGRATING } +# Represents a object that belongs to a repository. +interface RepositoryNode { + # The repository associated with this node. + repository: Repository! +} + # Ordering options for repository connections input RepositoryOrder { # The field to order repositories by. diff --git a/graphql/schema.json b/graphql/schema.json index 3fe5d080f8..2300458a6a 100644 --- a/graphql/schema.json +++ b/graphql/schema.json @@ -1126,6 +1126,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "websocket", "description": "The websocket channel ID for live updates.", @@ -1180,6 +1196,11 @@ "name": "Reactable", "ofType": null }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null + }, { "kind": "INTERFACE", "name": "Timeline", @@ -5905,6 +5926,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "websocket", "description": "The websocket channel ID for live updates.", @@ -5959,6 +5996,11 @@ "name": "Reactable", "ofType": null }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null + }, { "kind": "INTERFACE", "name": "Timeline", @@ -9387,6 +9429,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -9405,6 +9463,11 @@ "kind": "INTERFACE", "name": "Reactable", "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null } ], "enumValues": null, @@ -9562,6 +9625,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -9605,6 +9684,64 @@ } ] }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "description": "Represents a object that belongs to a repository.", + "fields": [ + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "CommitComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Issue", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "IssueComment", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequest", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReview", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "PullRequestReviewComment", + "ofType": null + } + ] + }, { "kind": "INTERFACE", "name": "GitSignature", @@ -10439,6 +10576,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "repository", + "description": "The repository associated with this node.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Repository", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "state", "description": "Identifies the current state of the pull request review.", @@ -10554,6 +10707,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -10567,6 +10736,11 @@ "kind": "INTERFACE", "name": "Comment", "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null } ], "enumValues": null, @@ -11225,6 +11399,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "websocket", "description": "The websocket channel ID for live updates.", @@ -11273,6 +11463,11 @@ "kind": "INTERFACE", "name": "Reactable", "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null } ], "enumValues": null, @@ -11663,7 +11858,7 @@ }, { "name": "repository", - "description": "The repository associated with this reaction subject.", + "description": "The repository associated with this node.", "args": [], "type": { "kind": "NON_NULL", @@ -11674,8 +11869,8 @@ "ofType": null } }, - "isDeprecated": true, - "deprecationReason": "Future reaction subjects may not be scoped under repositories." + "isDeprecated": false, + "deprecationReason": null }, { "name": "updatedAt", @@ -11765,6 +11960,22 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "websocket", "description": "The websocket channel ID for live updates.", @@ -11813,6 +12024,11 @@ "kind": "INTERFACE", "name": "Reactable", "ofType": null + }, + { + "kind": "INTERFACE", + "name": "RepositoryNode", + "ofType": null } ], "enumValues": null, @@ -18701,116 +18917,12 @@ ] }, { - "kind": "OBJECT", - "name": "OrganizationConnection", - "description": "The connection type for Organization.", - "fields": [ - { - "name": "edges", - "description": "A list of edges.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrganizationEdge", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nodes", - "description": "A list of nodes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Organization", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pageInfo", - "description": "Information to aid in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": "Identifies the total count of items in the connection.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrganizationEdge", - "description": "An edge in a connection.", - "fields": [ - { - "name": "cursor", - "description": "A cursor for use in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "node", - "description": "The item at the end of the edge.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Organization", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], + "kind": "SCALAR", + "name": "Float", + "description": "Represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).", + "fields": null, "inputFields": null, - "interfaces": [], + "interfaces": null, "enumValues": null, "possibleTypes": null }, @@ -20003,6 +20115,120 @@ ], "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "OrganizationConnection", + "description": "The connection type for Organization.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrganizationEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A list of nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": "Identifies the total count of items in the connection.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrganizationEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Organization", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "StarredRepositoryConnection", @@ -20435,6 +20661,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "viewerDidAuthor", + "description": "Did the viewer author this comment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, diff --git a/script/cibuild b/script/cibuild index dda437d192..03af6759f7 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,20 +1,41 @@ #!/bin/sh +function updateStatus { + STATUS=$1 + CTX=$2 + DESC=$3 + + SHA=$TRAVIS_COMMIT + if [ ! -z "$TRAVIS_PULL_REQUEST_SHA" ]; then + SHA=$TRAVIS_PULL_REQUEST_SHA + fi + + TRAVIS_JOB_URL="https://travis-ci.com/atom/github/jobs/$TRAVIS_JOB_ID" + GH_API_URL="https://api.github.com/repos/atom/github/statuses/$SHA" + curl -H "Authorization: token $GITHUB_TOKEN" --data "{\"state\": \"$STATUS\", \"target_url\": \"$TRAVIS_JOB_URL\", \"description\": \"$DESC\", \"context\": \"schema/$CTX\"}" $GH_API_URL +} + function checkForSchemaChanges { + CTX="$TRAVIS_EVENT_TYPE" + + updateStatus "pending" $CTX "Checking for GraphQL Schema Changes" time npm install echo "Fetching schema..." time npm run fetch-schema sleep 2 echo "Checking for schema changes..." + git status > /dev/null if ! git diff-index HEAD --quiet -- graphql/schema.graphql then + updateStatus "failure" $CTX "GraphQL Schema out of date" echo "Schema is out of date:" echo git --no-pager diff -- graphql/schema.graphql - exit 1 + exit fi + updateStatus "success" $CTX "GraphQL Schema up to date" echo "Schema is up to date" exit }