Date: Wed, 20 Apr 2016 18:29:36 -0700
Subject: [PATCH 014/109] Sync changes from upstream repository
---
content/v3/oauth.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/content/v3/oauth.md b/content/v3/oauth.md
index ea9c935b0f..03182ab6fe 100644
--- a/content/v3/oauth.md
+++ b/content/v3/oauth.md
@@ -37,6 +37,7 @@ Name | Type | Description
`redirect_uri`|`string` | The URL in your app where users will be sent after authorization. See details below about [redirect urls](#redirect-urls).
`scope`|`string` | A comma separated list of [scopes](#scopes). If not provided, `scope` defaults to an empty list of scopes for users that don't have a valid token for the app. For users who do already have a valid token for the app, the user won't be shown the OAuth authorization page with the list of scopes. Instead, this step of the flow will automatically complete with the same scopes that were used last time the user completed the flow.
`state`|`string` | An unguessable random string. It is used to protect against cross-site request forgery attacks.
+`allow_signup`|`string` | Whether or not unauthenticated users will be offered an option to sign up for GitHub during the OAuth flow. The default is `true`. Use `false` in the case that a policy prohibits signups.
### 2. GitHub redirects back to your site
From c5df1ce6c0663450484f05fc618f7e0f0fa9f7e8 Mon Sep 17 00:00:00 2001
From: Hubot
Date: Thu, 21 Apr 2016 07:34:35 -0700
Subject: [PATCH 015/109] Sync changes from upstream repository
---
...oauth-authorizations-grants-api-preview.md | 29 +++++++++
content/v3/oauth_authorizations.md | 62 +++++++++++++++++--
lib/responses/oauth.rb | 13 ++++
3 files changed, 100 insertions(+), 4 deletions(-)
create mode 100644 content/changes/2016-04-21-oauth-authorizations-grants-api-preview.md
diff --git a/content/changes/2016-04-21-oauth-authorizations-grants-api-preview.md b/content/changes/2016-04-21-oauth-authorizations-grants-api-preview.md
new file mode 100644
index 0000000000..7e60f4baec
--- /dev/null
+++ b/content/changes/2016-04-21-oauth-authorizations-grants-api-preview.md
@@ -0,0 +1,29 @@
+---
+title: Preview support for OAuth authorizations grants API
+author_name: ptoomey3
+---
+
+GitHub recently made changes to [the application authorizations settings screen within GitHub][authorized-application-listing] to display one entry for each OAuth application a user has authorized. Previously this screen showed one entry for each OAuth token that was generated by an OAuth application. For example, if you installed two instances of GitHub Desktop, you would see one entry for each installation. To simplify OAuth application management, we now show a single entry for each OAuth application. For OAuth applications that use the [web flow][web-flow] this was not a problem, since the web flow never generates more than one token for a given OAuth application and user. However, going forward, GitHub would like to allow all OAuth applications, including those that use the web flow, to generate more than one token.
+
+In preparation for that change, we are adding API support to simplify management of OAuth applications that matches what is available on GitHub.com. You can enable these changes during the preview period by providing a custom [media type][media-type] in the `Accept` header:
+
+ application/vnd.github.damage-preview
+
+For example:
+
+``` command-line
+curl -u username "https://api.github.com/applications/grants" \
+ -H "Accept: application/vnd.github.damage-preview"
+```
+
+You can learn more about the new APIs in the [OAuth authorizations][oauth-authorizations-api] documentation.
+
+During the preview period, we may change aspects of these APIs based on developer feedback. We will announce the changes here on the developer blog, but we will not provide advance notice.
+
+If you have any questions or feedback, please [let us know][contact].
+
+[media-type]: /v3/media
+[oauth-authorizations-api]: /v3/oauth_authorizations
+[authorized-application-listing]: https://github.com/settings/applications#authorized
+[contact]: https://github.com/contact?form%5Bsubject%5D=OAuth+Authorizations+Grants+API+Preview
+[web-flow]: /v3/oauth/#web-application-flow
diff --git a/content/v3/oauth_authorizations.md b/content/v3/oauth_authorizations.md
index 1e415e2908..785a6f0e9a 100644
--- a/content/v3/oauth_authorizations.md
+++ b/content/v3/oauth_authorizations.md
@@ -2,14 +2,25 @@
title: Authorizations
---
-# OAuth Authorizations API
+{% if page.version == 'dotcom' or page.version > 2.6 %}
-{:toc}
+{{#tip}}
-You can use this API to manage your OAuth applications. You can only access this API via [Basic Authentication](/v3/auth#basic-authentication) using your username and password, not tokens.
+
-Make sure you understand how to [work with two-factor authentication](/v3/auth/#working-with-two-factor-authentication) if you or your users have two-factor authentication enabled.
+ APIs for managing OAuth grants are currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-04-21-oauth-authorizations-grants-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.damage-preview
+{{/tip}}
+
+{% endif %}
+
+
Deprecation Notice
@@ -51,6 +62,48 @@ Make sure you understand how to [work with two-factor authentication](/v3/auth/#
+# OAuth Authorizations API
+
+{:toc}
+
+You can use this API to manage the access OAuth applications have to your account. You can only access this API via [Basic Authentication](/v3/auth#basic-authentication) using your username and password, not tokens.
+
+Make sure you understand how to [work with two-factor authentication](/v3/auth/#working-with-two-factor-authentication) if you or your users have two-factor authentication enabled.
+
+{% if page.version == 'dotcom' or page.version > 2.6 %}
+
+## List your grants
+
+You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](/v3/oauth_authorizations/#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub][authorized-application-listing]. The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `["repo", "user"]`.
+
+ GET /applications/grants
+
+### Response
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json(:oauth_authorization) { |h| [h] } %>
+
+## Get a single grant
+
+ GET /applications/grants/:id
+
+### Response
+
+<%= headers 200 %>
+<%= json(:oauth_authorization) %>
+
+## Delete a grant
+
+Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub][authorized-application-listing].
+
+ DELETE /applications/grants/:id
+
+### Response
+
+<%= headers 204 %>
+
+{% endif %}
+
## List your authorizations
GET /authorizations
@@ -267,4 +320,5 @@ links that might be of help:
[app-listing]: https://github.com/settings/developers
[tokens-listing]: https://github.com/settings/tokens
+[authorized-application-listing]: https://github.com/settings/applications#authorized
[basics auth guide]: /guides/basics-of-authentication/
diff --git a/lib/responses/oauth.rb b/lib/responses/oauth.rb
index 04584b0562..286b26a729 100644
--- a/lib/responses/oauth.rb
+++ b/lib/responses/oauth.rb
@@ -23,6 +23,19 @@ module Responses
}
OAUTH_ACCESS_WITH_USER ||= OAUTH_ACCESS.merge(:user => USER)
+
+ OAUTH_AUTHORIZATION ||= {
+ "id" => 1,
+ "url" => "https://api.github.com/applications/grants/1",
+ "app" => {
+ "url" => "http://my-github-app.com",
+ "name" => "my github app",
+ "client_id" => "abcde12345fghij67890"
+ },
+ "created_at" => "2011-09-06T17:26:27Z",
+ "updated_at" => "2011-09-06T20:39:23Z",
+ "scopes" => ["public_repo"],
+ }
end
end
end
From b1ddfb54e9fcc994ec2c4bae3b5e3488bc598ccd Mon Sep 17 00:00:00 2001
From: Ruben Dijkstra
Date: Sat, 23 Apr 2016 20:29:20 +0200
Subject: [PATCH 016/109] Fixup for the 'new webhook actions are live' count
---
content/changes/2016-04-18-new-webhook-actions-are-live.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/changes/2016-04-18-new-webhook-actions-are-live.md b/content/changes/2016-04-18-new-webhook-actions-are-live.md
index 10684c6908..40c28b16ce 100644
--- a/content/changes/2016-04-18-new-webhook-actions-are-live.md
+++ b/content/changes/2016-04-18-new-webhook-actions-are-live.md
@@ -27,7 +27,7 @@ The new values will be present in the `issue` object itself, as detailed above.
## List of comprehensive changes
-New actions were added to four events, all of which are detailed below.
+New actions were added to five events, all of which are detailed below.
### [RepositoryEvent][repository-event]
From 5d350f06a03d2db151e856853ed192c027e6d003 Mon Sep 17 00:00:00 2001
From: Hubot
Date: Sat, 23 Apr 2016 22:36:23 -0700
Subject: [PATCH 017/109] Sync changes from upstream repository
---
content/v3/repos.md | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/content/v3/repos.md b/content/v3/repos.md
index 10562eb1eb..e4f1240ddf 100644
--- a/content/v3/repos.md
+++ b/content/v3/repos.md
@@ -306,6 +306,8 @@ Name | Type | Description
<%= headers 200 %>
<%= json(:branch) %>
+{% if page.version == 'dotcom' or page.version >= 2.5 %}
+
## Enabling and disabling branch protection
{{#tip}}
@@ -362,6 +364,8 @@ Name | Description
}
%>
+{% endif %}
+
## Delete a Repository
Deleting a repository requires admin access. If OAuth is used, the
From b21657e5cd93f93747ade5674a85d4539ba780f7 Mon Sep 17 00:00:00 2001
From: Steve Peak
Date: Sun, 24 Apr 2016 13:42:13 -0400
Subject: [PATCH 018/109] incorrect key for commit head
---
content/v3/activity/events/types.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/v3/activity/events/types.md b/content/v3/activity/events/types.md
index 800987ad3b..ff1cb5d116 100644
--- a/content/v3/activity/events/types.md
+++ b/content/v3/activity/events/types.md
@@ -421,7 +421,7 @@ The Events API `PushEvent` payload is described in the table below. The example
Key | Type | Description
----|------|-------------
`ref`|`string` | The full Git ref that was pushed. Example: `"refs/heads/master"`.
-`head`|`string` | The SHA of the most recent commit on `ref` after the push.
+`after`|`string` | The SHA of the most recent commit on `ref` after the push.
`before`|`string` | The SHA of the most recent commit on `ref` before the push.
`size`|`integer` | The number of commits in the push.
`distinct_size`|`integer` | The number of distinct commits in the push.
From f983df3f8bd004ffeb60a825fc10c4d0e6946dba Mon Sep 17 00:00:00 2001
From: David Celis
Date: Sun, 24 Apr 2016 15:52:51 -0700
Subject: [PATCH 019/109] Revert "incorrect key for commit head"
---
content/v3/activity/events/types.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/v3/activity/events/types.md b/content/v3/activity/events/types.md
index ff1cb5d116..800987ad3b 100644
--- a/content/v3/activity/events/types.md
+++ b/content/v3/activity/events/types.md
@@ -421,7 +421,7 @@ The Events API `PushEvent` payload is described in the table below. The example
Key | Type | Description
----|------|-------------
`ref`|`string` | The full Git ref that was pushed. Example: `"refs/heads/master"`.
-`after`|`string` | The SHA of the most recent commit on `ref` after the push.
+`head`|`string` | The SHA of the most recent commit on `ref` after the push.
`before`|`string` | The SHA of the most recent commit on `ref` before the push.
`size`|`integer` | The number of commits in the push.
`distinct_size`|`integer` | The number of distinct commits in the push.
From af35a811ed51cef0d744d7ef56f2ad6218994879 Mon Sep 17 00:00:00 2001
From: Hubot
Date: Tue, 26 Apr 2016 10:03:31 -0700
Subject: [PATCH 020/109] Sync changes from upstream repository
---
nanoc.yaml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/nanoc.yaml b/nanoc.yaml
index 040d002c1c..5dc691517e 100644
--- a/nanoc.yaml
+++ b/nanoc.yaml
@@ -12,7 +12,8 @@ pipeline_config:
asset_root: https://a248.e.akamai.net/assets.github.com/images/icons
versions:
- - &latest_enterprise_version 2.5
+ - &latest_enterprise_version 2.6
+ - 2.5
- 2.4
- 2.3
- 2.2
From 538c5e56ec323c372d71fac025b1673a34268112 Mon Sep 17 00:00:00 2001
From: Joe Bottigliero
Date: Wed, 27 Apr 2016 13:21:11 -0500
Subject: [PATCH 021/109] Update issue.md
Updates issue.md examples to be a bit more obvious due to the default value of the `filter` parameter.
---
content/v3/issues.md | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/content/v3/issues.md b/content/v3/issues.md
index b3c3280452..f1cf60a11c 100644
--- a/content/v3/issues.md
+++ b/content/v3/issues.md
@@ -17,13 +17,19 @@ List all issues across all the authenticated user's visible repositories
including owned repositories, member repositories, and organization
repositories:
+ GET /issues?filter=all
+
+List all issues across all the authenticated user's visible repositories
+including owned repositories, member repositories, and organization
+repositories *assigned* to the authenticated user:
+
GET /issues
-List all issues across owned and member repositories for the authenticated user:
+List all issues across owned and member repositories assigned to the authenticated user:
GET /user/issues
-List all issues for a given organization for the authenticated user:
+List all issues for a given organization assigned to the authenticated user:
GET /orgs/:org/issues
From 3666db2a58a1a8c03fa5b81100319bb08e81be22 Mon Sep 17 00:00:00 2001
From: Joe Bottigliero
Date: Wed, 27 Apr 2016 16:49:50 -0500
Subject: [PATCH 022/109] Update issue.md
Removes `?filter` from examples, adds a `{{#tip}}` to point people in the right direction.
---
content/v3/issues.md | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/content/v3/issues.md b/content/v3/issues.md
index f1cf60a11c..8c9889e01e 100644
--- a/content/v3/issues.md
+++ b/content/v3/issues.md
@@ -13,17 +13,17 @@ read more about the use of media types in the API [here](/v3/media/).
<%= fetch_content(:prs_as_issues) %>
-List all issues across all the authenticated user's visible repositories
+List all *assigned* issues across all the authenticated user's visible repositories
including owned repositories, member repositories, and organization
repositories:
- GET /issues?filter=all
+ GET /issues
-List all issues across all the authenticated user's visible repositories
-including owned repositories, member repositories, and organization
-repositories *assigned* to the authenticated user:
+{{#tip}}
- GET /issues
+You can use the `filter` query parameter to fetch issues that are not necessarily assigned to you. See the table below for more information.
+
+{{/tip}}
List all issues across owned and member repositories assigned to the authenticated user:
From 457806833edc55a262d24a4d52d5a86078c5758f Mon Sep 17 00:00:00 2001
From: Joe Bottigliero
Date: Wed, 27 Apr 2016 16:53:38 -0500
Subject: [PATCH 023/109] issues.md copy updates
---
content/v3/issues.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/v3/issues.md b/content/v3/issues.md
index 8c9889e01e..046606cc3e 100644
--- a/content/v3/issues.md
+++ b/content/v3/issues.md
@@ -13,7 +13,7 @@ read more about the use of media types in the API [here](/v3/media/).
<%= fetch_content(:prs_as_issues) %>
-List all *assigned* issues across all the authenticated user's visible repositories
+List all issues **assigned** to the authenticated user across all visible repositories
including owned repositories, member repositories, and organization
repositories:
From 218f6d14b4bf64adcecdc2e52cab118b00859c47 Mon Sep 17 00:00:00 2001
From: Hubot
Date: Thu, 28 Apr 2016 11:49:27 -0700
Subject: [PATCH 024/109] Sync changes from upstream repository
---
content/v3/enterprise/orgs.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/v3/enterprise/orgs.md b/content/v3/enterprise/orgs.md
index 1decb5336c..cc6013e48e 100644
--- a/content/v3/enterprise/orgs.md
+++ b/content/v3/enterprise/orgs.md
@@ -6,7 +6,7 @@ title: Organization Administration
{:toc}
-The Organization Administration API allows you to create organizations on a GitHub Enterprise appliance. *It is only available to [authenticated](/v3/#authentication) site administrators.* Normal users will receive a `403` response if they try to access it.
+The Organization Administration API allows you to create organizations on a GitHub Enterprise appliance. *It is only available to [authenticated](/v3/#authentication) site administrators.* Normal users will receive a `404` response if they try to access it.
Prefix all the endpoints for this API with the following URL:
From ead0f50a4f41ec6234eea99c48f79531c17544e5 Mon Sep 17 00:00:00 2001
From: Hubot
Date: Thu, 28 Apr 2016 13:14:18 -0700
Subject: [PATCH 025/109] Sync changes from upstream repository
---
spec/content/blog_date_spec.rb | 6 +-----
spec/spec_helper.rb | 15 +++++++++++++++
2 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/spec/content/blog_date_spec.rb b/spec/content/blog_date_spec.rb
index c02ac1545a..e437ebf8ca 100644
--- a/spec/content/blog_date_spec.rb
+++ b/spec/content/blog_date_spec.rb
@@ -1,12 +1,8 @@
require 'spec_helper'
describe 'Blog Date' do
- before do
- @posts = `git diff --name-only --diff-filter=ACMRTUXB master... | grep .md`.split("\n")
- end
-
it 'is not in the past' do
- @posts.each do |post|
+ posts.each do |post|
matches = post.match(%r{(\d{4}-\d{2}-\d{2})-})
next unless matches
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index ce3eef69ba..9902a40952 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -11,6 +11,21 @@
Dir.glob('tasks/*.rake').each { |r| load r}
+# All the blog posts we're interested in checking. This means we're looking at
+# files that have changed on this particular branch we're on.
+#
+# Returns an Array of String filenames.
+def posts
+ return @posts if defined? @posts
+
+ diffable_files = `git diff -z --name-only --diff-filter=ACMRTUXB origin/master`.split("\0")
+
+ @posts = diffable_files.select do |filename|
+ ext = File.extname(filename)
+ ext == ".md" || ext == ".html"
+ end
+end
+
# this does the file serving
class ImplictIndex
def initialize(root)
From adffd8444862ff9548f2f6ad59eded077911bcfb Mon Sep 17 00:00:00 2001
From: Pierre Dal-Pra
Date: Mon, 2 May 2016 14:41:28 +0200
Subject: [PATCH 026/109] Add missing "commit_url" to issues events payload
---
content/v3/issues/events.md | 3 +++
lib/responses/issues_and_prs.rb | 1 +
2 files changed, 4 insertions(+)
diff --git a/content/v3/issues/events.md b/content/v3/issues/events.md
index 739490af3e..e285264f3a 100644
--- a/content/v3/issues/events.md
+++ b/content/v3/issues/events.md
@@ -25,6 +25,9 @@ determine who should be notified of comments.
commit_id
The String SHA of a commit that referenced this Issue
+ commit_url
+ The GitHub API link to a commit that referenced this Issue
+
event
Identifies the actual type of Event that occurred.
diff --git a/lib/responses/issues_and_prs.rb b/lib/responses/issues_and_prs.rb
index 83ec998f0b..f254f45c18 100644
--- a/lib/responses/issues_and_prs.rb
+++ b/lib/responses/issues_and_prs.rb
@@ -148,6 +148,7 @@ module Responses
"actor" => USER,
"event" => "closed",
"commit_id" => "6dcb09b5b57875f334f61aebed695e2e4193db5e",
+ "commit_url" => "https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e",
"created_at" => "2011-04-14T16:00:49Z"
}
From a8b5eb78ac5a849e9ab1cc57a65b8a07f6a07731 Mon Sep 17 00:00:00 2001
From: Hubot
Date: Tue, 3 May 2016 11:24:39 -0700
Subject: [PATCH 027/109] Sync changes from upstream repository
---
...i-enhancements-for-working-with-git-lfs.md | 40 ++++++
content/v3/migration/source_imports.md | 127 ++++++++++++++++--
lib/responses/source_imports.rb | 59 ++++++++
3 files changed, 214 insertions(+), 12 deletions(-)
create mode 100644 content/changes/2016-05-03-source-import-api-enhancements-for-working-with-git-lfs.md
diff --git a/content/changes/2016-05-03-source-import-api-enhancements-for-working-with-git-lfs.md b/content/changes/2016-05-03-source-import-api-enhancements-for-working-with-git-lfs.md
new file mode 100644
index 0000000000..4f7f8bb308
--- /dev/null
+++ b/content/changes/2016-05-03-source-import-api-enhancements-for-working-with-git-lfs.md
@@ -0,0 +1,40 @@
+---
+title: Source Import API enhancements for working with Git LFS
+author_name: lizzhale
+---
+
+Today we're introducing enhancements to the [Source Import API][docs] to support importing repositories with files larger than 100MB.
+
+**Changes to parameters for starting an import**
+
+[Starting an import][start-an-import] no longer requires a `vcs` parameter. Please be aware that without this parameter, the import job will take additional time to detect the vcs type before beginning the import. This detection step will be reflected in the response.
+
+**New methods**
+
+We've added 3 new methods that will enable API consumers to:
+
+ * [update][update-existing-import] the authentication or project choice for an import. If no parameters are provided during the request, the import will be restarted. Please note that this is a **breaking change**. Updating authentication for the originating URL is no longer supported through the [start an import][start-an-import] method. Please update your applications to use the new method.
+
+ * [set their preference][set-git-lfs-preference] for using Git LFS to import files larger than 100MB.
+
+ * [list all the files larger than 100MB][get-large-files] that were found during the import.
+
+**New attributes for Git LFS**
+
+Several new response attributes (`use_lfs`, `has_large_files`, `large_files_size`, `large_files`) were added to provide details regarding the large files found during the import. You can read more about the attributes [here][git-lfs-related-fields].
+
+As before, to access the API during the preview period, you must provide a custom [media type][media-type] in the `Accept` header:
+
+ application/vnd.github.barred-rock-preview
+
+For more information, see the [Source Import API documentation][docs], and if you have any questions or feedback, please [let us know][contact].
+
+
+[docs]: /v3/migration/source_imports/
+[start-an-import]: /v3/migration/source_imports/#start-an-import
+[update-existing-import]: /v3/migration/source_imports/#update-existing-import
+[set-git-lfs-preference]: /v3/migration/source_imports/#set-git-lfs-preference
+[get-large-files]: /v3/migration/source_imports/#get-large-files
+[git-lfs-related-fields]: /v3/migration/source_imports/#git-lfs-related-fields
+[media-type]: /v3/media
+[contact]: https://github.com/contact?form%5Bsubject%5D=Source+Import+API
diff --git a/content/v3/migration/source_imports.md b/content/v3/migration/source_imports.md
index 6afea7211b..80d1e6acdf 100644
--- a/content/v3/migration/source_imports.md
+++ b/content/v3/migration/source_imports.md
@@ -26,7 +26,7 @@ This API is not currently available on GitHub Enterprise.
The Source Import API lets you start an import from a Git, Subversion, Mercurial, or Team Foundation Server source repository. This is the same functionality as [the GitHub Importer](https://import.github.com/).
-A typical source import would [start the import](#start-an-import) and then (optionally) [update the authors](#map-a-commit-author). A more detailed example can be seen in this diagram:
+A typical source import would [start the import](#start-an-import) and then (optionally) [update the authors](#map-a-commit-author) and/or [set the preference](#set-git-lfs-preference) for using Git LFS if large files exist in the import. A more detailed example can be seen in this diagram:
```
+---------+ +--------+ +---------------------+
@@ -78,6 +78,21 @@ A typical source import would [start the import](#start-an-import) and then (opt
| | | |
| |<-----+ |
| | |
+ | Get large files | |
+ |----------------------------->| |
+ | | |
+ | opt_in to Git LFS | |
+ |----------------------------->| |
+ | | Rewrite commits for large files |
+ | |------+ |
+ | | | |
+ | |<-----+ |
+ | | |
+ | | Update repository on GitHub |
+ | |------+ |
+ | | | |
+ | |<-----+ |
+ | | |
| Get import progress | |
|----------------------------->| |
| "status": "complete" | |
@@ -96,8 +111,8 @@ Start a source import to a GitHub repository using GitHub Importer.
Name | Type | Description
-----|------|--------------
-`vcs`|`string`|**Required** The originating VCS type. Can be one of "subversion", "git", "mercurial", or "tfvc".
`vcs_url`|`url`|**Required** The URL of the originating repository.
+`vcs`|`string`|The originating VCS type. Can be one of `subversion`, `git`, `mercurial`, or `tfvc`. Please be aware that without this parameter, the import job will take additional time to detect the VCS type before beginning the import. This detection step will be reflected in the response.
`vcs_username`|`string`|If authentication is required, the username to provide to `vcs_url`.
`vcs_password`|`string`|If authentication is required, the password to provide to `vcs_url`.
`tfvc_project`|`string`|For a tfvc import, the name of the project that is being imported.
@@ -121,7 +136,7 @@ Name | Type | Description
View the progress of an import.
GET /repos/:owner/:repo/import
-
+
### Response
<%= headers 200 %>
@@ -133,6 +148,7 @@ This section includes details about the possible values of the `status` field of
An import that does not have errors will progress through these steps:
+* `detecting` - the "detection" step of the import is in progress because the request did not include a `vcs` parameter. The import is identifying the type of source control present at the URL.
* `importing` - the "raw" step of the import is in progress. This is where commit data is fetched from the original repository. The import progress response will include `commit_count` (the total number of raw commits that will be imported) and `percent` (0 - 100, the current progress through the import).
* `mapping` - the "rewrite" step of the import is in progress. This is where SVN branches are converted to Git branches, and where author updates are applied. The import progress response does not include progress information.
* `pushing` - the "push" step of the import is in progress. This is where the importer updates the repository on GitHub. The import progress response will include `push_percent`, which is the percent value reported by `git push` when it is "Writing objects".
@@ -140,16 +156,69 @@ An import that does not have errors will progress through these steps:
If there are problems, you will see one of these in the `status` field:
-* `auth_failed` - the import requires authentication in order to connect to the original repository. Make another "Start Import" request, and include `vcs_username` and `vcs_password`.
+* `auth_failed` - the import requires authentication in order to connect to the original repository. Make an "Update Existing Import" request, and include `vcs_username` and `vcs_password`.
* `error` - the import encountered an error. The import progress response will include the `failed_step` and an error message. [Contact support](https://github.com/contact?form%5Bsubject%5D=Source+Import+API+error) for more information.
+* `detection_needs_auth` - the importer requires authentication for the originating repository to continue detection. Make an "Update Existing Import" request, and include `vcs_username` and `vcs_password`.
+* `detection_found_nothing` - the importer didn't recognize any source control at the URL.
+* `detection_found_multiple` - the importer found several projects or repositories at the provided URL. When this is the case, the Import Progress response will also include a `project_choices` field with the possible project choices as values. Make an "Update Existing Import" request, and include `vcs` and (if applicable) `tfvc_project`.
+
+### Git LFS related fields
+
+This section includes details about Git LFS related fields that may be present in the Import Progress response.
+
+* `use_lfs` - describes whether the import has been opted in or out of using Git LFS. The value can be `opt_in`, `opt_out`, or `undecided` if no action has been taken.
+* `has_large_files` - the boolean value describing whether files larger than 100MB were found during the `importing` step.
+* `large_files_size` - the total size in gigabytes of files larger than 100MB found in the originating repository.
+* `large_files_count` - the total number of of files larger than 100MB found in the originating repository. To see a list of these files, make a "Get Large Files" request.
+
+## Update existing import
+
+An import can be updated with credentials or a `project_choice` by passing in the appropriate parameters in this API request. If no parameters are provided, the import will be restarted.
+
+ PATCH /repos/:owner/:repo/import
+
+### Response
+
+<%= headers 200, :Location => "https://api.github.com/repos/spraints/socm/import" %>
+<%= json :source_import %>
+
+### Parameters for updating authentication
+
+Name | Type | Description
+-----|------|--------------
+`vcs_username`|`string`|The username to provide to the originating repository.
+`vcs_password`|`string`|The password to provide to the originating repository.
+
+### Example
+
+<%= json \
+ :vcs_username => "octocat",
+ :vcs_password => "secret"
+%>
+
+### Response
+
+<%= headers 200 %>
+<%= json :source_import_update_auth %>
-If you query import status for an import started via the web UI, you may also see these states:
+### Parameters for updating project choice
-* `detecting` - you've entered a URL via the web UI, and the importer is figuring out what type of source control is present at the URL.
-* `detection_needs_auth` - you've entered a URL via the web UI, and the importer needs you to enter authentication credentials in the web UI in order to continue detection.
-* `detection_found_nothing` - the importer didn't recognize any source control at the URL entered via the web UI.
-* `detection_found_multiple` - the importer found several projects or repositories at the provided URL.
-* `waiting_to_push` - the raw and rewrite steps are complete, but a destination GitHub repository hasn't been created yet.
+Name | Type | Description
+-----|------|--------------
+`vcs`|`string`|The chosen project's VCS type.
+`tfvc_project`|`string`|For a tfvc import, the name of the project that is being imported.
+
+### Example
+
+<%= json\
+ :vcs => "tfvc",
+ :tfvc_project => "project"
+%>
+
+### Response
+
+<%= headers 200 %>
+<%= json :source_import_update_project_choice %>
## Get commit authors
@@ -158,7 +227,7 @@ Each type of source control system represents authors in a different way. For ex
This API method and the "Map a commit author" method allow you to provide correct Git author information.
GET /repos/:owner/:repo/import/authors
-
+
### Parameters
Name | Type | Description
@@ -175,7 +244,7 @@ Name | Type | Description
Update an author's identity for the import. Your application can continue updating authors any time before you push new commits to the repository.
PATCH /repos/:owner/:repo/import/authors/:author_id
-
+
### Parameters
Name | Type | Description
@@ -195,6 +264,40 @@ Name | Type | Description
<%= headers 200 %>
<%= json :source_import_author %>
+## Set Git LFS preference
+
+You can import repositories from Subversion, Mercurial, and TFS that include files larger than 100MB. This ability is powered by [Git LFS](https://git-lfs.github.com). You can learn more about our LFS feature and working with large files [on our help site](https://help.github.com/articles/versioning-large-files/).
+
+ PATCH /:owner/:name/import/lfs
+
+### Parameters
+
+Name | Type | Description
+-----|------|--------------
+`use_lfs`|`string`|**Required** Can be one of `opt_in` (large files will be stored using Git LFS) or `opt_out` (large files will be removed during the import).
+
+### Example
+
+<%= json \
+ :use_lfs => "opt_in"
+%>
+
+### Response
+
+<%= headers 200 %>
+<%= json :source_import_complete %>
+
+## Get large files
+
+List files larger than 100MB found during the import
+
+ GET /:owner/:name/import/large_files
+
+### Response
+
+<%= headers 200 %>
+<%= json :source_import_large_files %>
+
## Cancel an import
Stop an import for a repository.
diff --git a/lib/responses/source_imports.rb b/lib/responses/source_imports.rb
index 7c64420ae3..4aab1913a3 100644
--- a/lib/responses/source_imports.rb
+++ b/lib/responses/source_imports.rb
@@ -4,9 +4,13 @@ module Resources
module Responses
SOURCE_IMPORT ||= {
"vcs" => "subversion",
+ "use_lfs" => "undecided",
"vcs_url" => "http://svn.mycompany.com/svn/myproject",
"status" => "importing",
"status_text" => "Importing...",
+ "has_large_files" => false,
+ "large_files_size" => 0,
+ "large_files_count" => 0,
"authors_count" => 0,
"percent" => 42,
"commit_count" => 1042,
@@ -18,9 +22,13 @@ module Responses
SOURCE_IMPORT_COMPLETE ||= {
"vcs" => "subversion",
+ "use_lfs" => "opt_in",
"vcs_url" => "http://svn.mycompany.com/svn/myproject",
"status" => "complete",
"status_text" => "Done",
+ "has_large_files" => true,
+ "large_files_size" => 132331036,
+ "large_files_count" => 1,
"authors_count" => 4,
"url" => "https://api.github.com/repos/octocat/socm/import",
"html_url" => "https://import.github.com/octocat/socm/import",
@@ -28,6 +36,36 @@ module Responses
"repository_url" => "https://api.github.com/repos/octocat/socm"
}
+ SOURCE_IMPORT_UPDATE_AUTH ||= {
+ "vcs": "subversion",
+ "use_lfs": "undecided",
+ "vcs_url": "http://svn.mycompany.com/svn/myproject",
+ "status": "detecting",
+ "url" => "https://api.github.com/repos/octocat/socm/import",
+ "html_url" => "https://import.github.com/octocat/socm/import",
+ "authors_url" => "https://api.github.com/repos/octocat/socm/import/authors",
+ "repository_url" => "https://api.github.com/repos/octocat/socm"
+ }
+
+ SOURCE_IMPORT_UPDATE_PROJECT_CHOICE ||= {
+ "vcs" => "tfvc",
+ "use_lfs": "undecided",
+ "vcs_url" => "http://tfs.mycompany.com/tfs/myproject",
+ "tfvc_project": "project",
+ "status" => "importing",
+ "status_text" => "Importing...",
+ "has_large_files" => false,
+ "large_files_size" => 0,
+ "large_files_count" => 0,
+ "authors_count" => 0,
+ "percent" => 42,
+ "commit_count" => 1042,
+ "url" => "https://api.github.com/repos/octocat/socm/import",
+ "html_url" => "https://import.github.com/octocat/socm/import",
+ "authors_url" => "https://api.github.com/repos/octocat/socm/import/authors",
+ "repository_url" => "https://api.github.com/repos/octocat/socm"
+ }
+
SOURCE_IMPORT_AUTHOR ||= {
"id" => 2268557,
"remote_id" => "nobody@fc7da526-431c-80fe-3c8c-c148ff18d7ef",
@@ -59,6 +97,27 @@ module Responses
"import_url" => "https://api.github.com/repos/octocat/socm/import"
}
]
+
+ SOURCE_IMPORT_LARGE_FILES ||= [
+ {
+ "ref_name": "refs/heads/master",
+ "path": "foo/bar/1",
+ "oid": "d3d9446802a44259755d38e6d163e820",
+ "size": 10485760
+ },
+ {
+ "ref_name": "refs/heads/master",
+ "path": "foo/bar/2",
+ "oid": "6512bd43d9caa6e02c990b0a82652dca",
+ "size": 11534336
+ },
+ {
+ "ref_name": "refs/heads/master",
+ "path": "foo/bar/3",
+ "oid": "c20ad4d76fe97759aa27a0c99bff6710",
+ "size": 12582912
+ }
+ ]
end
end
end
From 48eaeac018cae76e04dbb93f33efa56c4268abd7 Mon Sep 17 00:00:00 2001
From: Hubot
Date: Tue, 3 May 2016 14:02:15 -0700
Subject: [PATCH 028/109] Sync changes from upstream repository
---
content/webhooks/index.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/content/webhooks/index.md b/content/webhooks/index.md
index 76cef41707..bd109cf2d1 100644
--- a/content/webhooks/index.md
+++ b/content/webhooks/index.md
@@ -48,7 +48,7 @@ Name | Description
[`deployment_status`][event-types-deployment_status] | Any time a deployment for a Repository has a status update from the API.
[`fork`][event-types-fork] | Any time a Repository is forked.
[`gollum`][event-types-gollum] | Any time a Wiki page is updated.
-[`issue_comment`][event-types-issue_comment] | Any time a [comment on an issue](/v3/issues/comments/) is created or edited
+[`issue_comment`][event-types-issue_comment] | Any time a [comment on an issue](/v3/issues/comments/) is created, edited, or deleted.
[`issues`][event-types-issues] | Any time an Issue is assigned, unassigned, labeled, unlabeled, opened, edited, closed, or reopened.
[`member`][event-types-member] | Any time a User is added as a collaborator to a non-Organization Repository.
[`membership`][event-types-membership] | Any time a User is added or removed from a team. **Organization hooks only**.
From 5963e53abbae890a6e7e8da8214c3bf711f539da Mon Sep 17 00:00:00 2001
From: Pierre DAL-PRA
Date: Thu, 5 May 2016 23:46:04 +0200
Subject: [PATCH 029/109] No field is required when updating an issue label
---
content/v3/issues/labels.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/content/v3/issues/labels.md b/content/v3/issues/labels.md
index 5830e0bbf1..718a0c6339 100644
--- a/content/v3/issues/labels.md
+++ b/content/v3/issues/labels.md
@@ -51,8 +51,8 @@ Name | Type | Description
Name | Type | Description
-----|------|--------------
-`name`|`string` | **Required**. The name of the label.
-`color`|`string` |**Required**. A 6 character hex code, without the leading `#`, identifying the color.
+`name`|`string` | The name of the label.
+`color`|`string` | A 6 character hex code, without the leading `#`, identifying the color.
<%= json :name => "bug", :color => "f29513" %>
From 0e61e5f2f2da13f22a5ca111a73b894176f397d6 Mon Sep 17 00:00:00 2001
From: Hubot
Date: Fri, 6 May 2016 15:32:22 -0700
Subject: [PATCH 030/109] Sync changes from upstream repository
---
content/v3/activity/events/types.md | 38 +++++++++++++++++------------
content/webhooks/index.md | 10 ++++----
2 files changed, 28 insertions(+), 20 deletions(-)
diff --git a/content/v3/activity/events/types.md b/content/v3/activity/events/types.md
index 800987ad3b..9504e2de89 100644
--- a/content/v3/activity/events/types.md
+++ b/content/v3/activity/events/types.md
@@ -239,15 +239,19 @@ Key | Type | Description
## IssueCommentEvent
+{% if page.version == 'dotcom' or page.version > 2.6 %}
Triggered when an [issue comment](/v3/issues/comments/) is created, edited, or deleted.
+{% else %}
+Triggered when an [issue is commented on](/v3/issues/comments/).
+{% endif %}
### Events API payload
Key | Type | Description
----|------|-------------
-`action`|`string` | The action that was performed on the comment. Can be one of "created", "edited", or "deleted".
+`action`|`string` | The action that was performed on the comment. {% if page.version == 'dotcom' or page.version > 2.6 %}Can be one of "created", "edited", or "deleted".
`changes`|`object` | The changes to the comment if the action was "edited".
-`changes[body][from]` |`string` | The previous version of the body if the action was "edited".
+`changes[body][from]` |`string` | The previous version of the body if the action was "edited".{% else %}Currently, can only be "created".{% endif %}
`issue`|`object` | The [issue](/v3/issues/) the comment belongs to.
`comment`|`object` | The [comment](/v3/issues/comments/) itself.
@@ -261,17 +265,17 @@ Key | Type | Description
## IssuesEvent
-Triggered when an [issue](/v3/issues) is assigned, unassigned, labeled, unlabeled, opened, edited, closed, or reopened.
+Triggered when an [issue](/v3/issues) is assigned, unassigned, labeled, unlabeled, opened, {% if page.version == 'dotcom' or page.version > 2.6 %}edited, {% endif %}closed, or reopened.
### Events API payload
Key | Type | Description
----|------|-------------
-`action`|`string` | The action that was performed. Can be one of "assigned", "unassigned", "labeled", "unlabeled", "opened", "edited", "closed", or "reopened".
-`issue`|`object` | The [issue](/v3/issues) itself.
+`action`|`string` | The action that was performed. Can be one of "assigned", "unassigned", "labeled", "unlabeled", "opened", {% if page.version == 'dotcom' or page.version > 2.6 %}"edited", {% endif %}"closed", or "reopened".
+`issue`|`object` | The [issue](/v3/issues) itself.{% if page.version == 'dotcom' or page.version > 2.6 %}
`changes`|`object`| The changes to the issue if the action was "edited".
`changes[title][from]`|`string` | The previous version of the title if the action was "edited".
-`changes[body][from]`|`string` | The previous version of the body if the action was "edited".
+`changes[body][from]`|`string` | The previous version of the body if the action was "edited".{% endif %}
`assignee`|`object` | The optional user who was assigned or unassigned from the issue.
`label`|`object` | The optional label that was added or removed from the issue.
@@ -363,17 +367,17 @@ Triggered when a private repository is [open sourced](/v3/repos/#edit). Without
## PullRequestEvent
-Triggered when a [pull request](/v3/pulls) is assigned, unassigned, labeled, unlabeled, opened, edited, closed, reopened, or synchronized.
+Triggered when a [pull request](/v3/pulls) is assigned, unassigned, labeled, unlabeled, opened, {% if page.version == 'dotcom' or page.version > 2.6 %}edited, {% endif %}closed, reopened, or synchronized.
### Events API payload
Key | Type | Description
----|------|-------------
-`action`|`string` | The action that was performed. Can be one of "assigned", "unassigned", "labeled", "unlabeled", "opened", "edited", "closed", or "reopened", or "synchronize". If the action is "closed" and the `merged` key is `false`, the pull request was closed with unmerged commits. If the action is "closed" and the `merged` key is `true`, the pull request was merged.
-`number`|`integer` | The pull request number.
+`action`|`string` | The action that was performed. Can be one of "assigned", "unassigned", "labeled", "unlabeled", "opened", {% if page.version == 'dotcom' or page.version > 2.6 %}"edited", {% endif %}"closed", or "reopened", or "synchronize". If the action is "closed" and the `merged` key is `false`, the pull request was closed with unmerged commits. If the action is "closed" and the `merged` key is `true`, the pull request was merged.
+`number`|`integer` | The pull request number.{% if page.version == 'dotcom' or page.version > 2.6 %}
`changes`|`object`| The changes to the comment if the action was "edited".
`changes[title][from]`|`string` | The previous version of the title if the action was "edited".
-`changes[body][from]`|`string` | The previous version of the body if the action was "edited".
+`changes[body][from]`|`string` | The previous version of the body if the action was "edited".{% endif %}
`pull_request`|`object` | The [pull request](/v3/pulls) itself.
### Webhook event name
@@ -386,15 +390,19 @@ Key | Type | Description
## PullRequestReviewCommentEvent
+{% if page.version == 'dotcom' or page.version > 2.6 %}
Triggered when a [comment on a Pull Request's unified diff](/v3/pulls/comments) is created, edited, or deleted (in the Files Changed tab).
+{% else %}
+Triggered when a [Pull Request's unified diff is commented on](/v3/pulls/comments) (in the Files Changed tab).
+{% endif %}
### Events API payload
Key | Type | Description
----|------|-------------
-`action`|`string` | The action that was performed on the comment. Can be one of `created`, `edited`, or `deleted`.
+`action`|`string` | The action that was performed on the comment. {% if page.version == 'dotcom' or page.version > 2.6 %}Can be one of "created", "edited", or "deleted".
`changes`|`object`| The changes to the comment if the action was "edited".
-`changes[body][from]`|`string` | The previous version of the body if the action was "edited".
+`changes[body][from]`|`string` | The previous version of the body if the action was "edited".{% else %}Currently, can only be "created".{% endif %}
`pull_request`|`object` | The [pull request](/v3/pulls/) the comment belongs to.
`comment`|`object` | The [comment](/v3/pulls/comments) itself.
@@ -463,15 +471,15 @@ Key | Type | Description
## RepositoryEvent
-Triggered when a repository is created, deleted, made public, or made private.
+Triggered when a repository is created{% if page.version == 'dotcom' or page.version > 2.6 %}, deleted, made public, or made private{% endif %}.
-Events of this type are not visible in timelines. These events are only used to trigger hooks.
+Events of this type are not visible in timelines. These events are only used to trigger {% if page.version != 'dotcom' and page.version <= 2.6 %}organization {% endif %}hooks.
### Events API payload
Key | Type | Description
----|------|-------------
-`action` |`string` | The action that was performed. This can be one of `created`, `deleted`, `publicized`, or `privatized`.
+`action` |`string` | The action that was performed. {% if page.version == 'dotcom' or page.version > 2.6 %}This can be one of "created", "deleted", "publicized", or "privatized".{% else %}Currently, can only be "created".{% endif %}
`repository`|`object` | The [repository](/v3/repos/) itself.
### Webhook event name
diff --git a/content/webhooks/index.md b/content/webhooks/index.md
index bd109cf2d1..76fea2de20 100644
--- a/content/webhooks/index.md
+++ b/content/webhooks/index.md
@@ -48,16 +48,16 @@ Name | Description
[`deployment_status`][event-types-deployment_status] | Any time a deployment for a Repository has a status update from the API.
[`fork`][event-types-fork] | Any time a Repository is forked.
[`gollum`][event-types-gollum] | Any time a Wiki page is updated.
-[`issue_comment`][event-types-issue_comment] | Any time a [comment on an issue](/v3/issues/comments/) is created, edited, or deleted.
-[`issues`][event-types-issues] | Any time an Issue is assigned, unassigned, labeled, unlabeled, opened, edited, closed, or reopened.
+[`issue_comment`][event-types-issue_comment] | {% if page.version == 'dotcom' or page.version > 2.6 %}Any time a [comment on an issue](/v3/issues/comments/) is created, edited, or deleted.{% else %}Any time an [issue is commented on](/v3/issues/comments).{% endif %}
+[`issues`][event-types-issues] | Any time an Issue is assigned, unassigned, labeled, unlabeled, opened, {% if page.version == 'dotcom' or page.version > 2.6 %}edited, {% endif %}closed, or reopened.
[`member`][event-types-member] | Any time a User is added as a collaborator to a non-Organization Repository.
[`membership`][event-types-membership] | Any time a User is added or removed from a team. **Organization hooks only**.
[`page_build`][event-types-page_build] | Any time a Pages site is built or results in a failed build.
[`public`][event-types-public] | Any time a Repository changes from private to public.
-[`pull_request_review_comment`][event-types-pull_request_review_comment] | Any time a [comment on a pull request's unified diff](/v3/pulls/comments) is created, edited, or deleted (in the Files Changed tab).
-[`pull_request`][event-types-pull_request] | Any time a Pull Request is assigned, unassigned, labeled, unlabeled, opened, edited, closed, reopened, or synchronized (updated due to a new push in the branch that the pull request is tracking).
+[`pull_request_review_comment`][event-types-pull_request_review_comment] | {% if page.version == 'dotcom' or page.version > 2.6 %}Any time a [comment on a Pull Request's unified diff](/v3/pulls/comments) is created, edited, or deleted{% else %}Any time a [Pull Request's unified diff is commented on](/v3/pulls/comments){% endif %} (in the Files Changed tab).
+[`pull_request`][event-types-pull_request] | Any time a Pull Request is assigned, unassigned, labeled, unlabeled, opened, {% if page.version == 'dotcom' or page.version > 2.6 %}edited, {% endif %}closed, reopened, or synchronized (updated due to a new push in the branch that the pull request is tracking).
[`push`][event-types-push] | Any Git push to a Repository, including editing tags or branches. Commits via API actions that update references are also counted. **This is the default event.**
-[`repository`][event-types-repository] | Any time a Repository is created, deleted, made public, or made private.
+[`repository`][event-types-repository] | Any time a Repository is created{% if page.version == 'dotcom' or page.version > 2.6 %}, deleted, made public, or made private{% else %}. **Organization hooks only**{% endif %}.
[`release`][event-types-release] | Any time a Release is published in a Repository.
[`status`][event-types-status] | Any time a Repository has a status update from the API
[`team_add`][event-types-team_add] | Any time a team is added or modified on a Repository.
From 23dd0abcc9e17e2251d7c5c956f6297360f5eecf Mon Sep 17 00:00:00 2001
From: Edward Jiang
Date: Fri, 6 May 2016 17:29:45 -0700
Subject: [PATCH 031/109] changed comma to space in accordance with OAuth spec
---
content/v3/oauth.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/content/v3/oauth.md b/content/v3/oauth.md
index 03182ab6fe..f1eef51017 100644
--- a/content/v3/oauth.md
+++ b/content/v3/oauth.md
@@ -35,7 +35,7 @@ Name | Type | Description
-----|------|--------------
`client_id`|`string` | **Required**. The client ID you received from GitHub when you [registered](https://github.com/settings/applications/new).
`redirect_uri`|`string` | The URL in your app where users will be sent after authorization. See details below about [redirect urls](#redirect-urls).
-`scope`|`string` | A comma separated list of [scopes](#scopes). If not provided, `scope` defaults to an empty list of scopes for users that don't have a valid token for the app. For users who do already have a valid token for the app, the user won't be shown the OAuth authorization page with the list of scopes. Instead, this step of the flow will automatically complete with the same scopes that were used last time the user completed the flow.
+`scope`|`string` | A space delimited list of [scopes](#scopes). If not provided, `scope` defaults to an empty list of scopes for users that don't have a valid token for the app. For users who do already have a valid token for the app, the user won't be shown the OAuth authorization page with the list of scopes. Instead, this step of the flow will automatically complete with the same scopes that were used last time the user completed the flow.
`state`|`string` | An unguessable random string. It is used to protect against cross-site request forgery attacks.
`allow_signup`|`string` | Whether or not unauthenticated users will be offered an option to sign up for GitHub during the OAuth flow. The default is `true`. Use `false` in the case that a policy prohibits signups.
@@ -204,11 +204,11 @@ Name | Description
{% if page.version == 'dotcom' %}`admin:gpg_key`| Fully manage GPG keys.{% endif %}
NOTE: Your application can request the scopes in the initial redirection. You
-can specify multiple scopes by separating them with a comma:
+can specify multiple scopes by separating them with a space:
https://github.com/login/oauth/authorize?
client_id=...&
- scope=user,public_repo
+ scope=user%20public_repo
## Common errors for the authorization request
From 1d6a85f070fd62cc705843dcc88f4f3c4eaa7331 Mon Sep 17 00:00:00 2001
From: Hubot
Date: Thu, 12 May 2016 12:47:07 -0700
Subject: [PATCH 032/109] Sync changes from upstream repository
---
.../2016-05-12-reactions-api-preview.md | 33 +++
content/v3/issues.md | 62 ++++++
content/v3/issues/comments.md | 63 ++++++
content/v3/pulls/comments.md | 63 ++++++
content/v3/reactions.md | 208 ++++++++++++++++++
content/v3/repos/comments.md | 63 ++++++
layouts/sidebar.html | 9 +
lib/responses/git.rb | 11 +
lib/responses/issues_and_prs.rb | 9 +
lib/responses/reactions.rb | 21 ++
10 files changed, 542 insertions(+)
create mode 100644 content/changes/2016-05-12-reactions-api-preview.md
create mode 100644 content/v3/reactions.md
create mode 100644 lib/responses/reactions.rb
diff --git a/content/changes/2016-05-12-reactions-api-preview.md b/content/changes/2016-05-12-reactions-api-preview.md
new file mode 100644
index 0000000000..fbf93d1aa7
--- /dev/null
+++ b/content/changes/2016-05-12-reactions-api-preview.md
@@ -0,0 +1,33 @@
+---
+title: Preview support for Reactions API
+author_name: kneemer
+---
+
+GitHub recently added [Reactions to Pull Requests, Issues, and Comments][reactions-blog-post] to help people express their feelings more simply and effectively in conversations. We are adding endpoints for Reactions so that you can now react and unreact via the API. You can enable these changes during the preview period by providing a custom [media type][media-type] in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+For example:
+
+To view reactions on an issue:
+
+``` command-line
+$ curl "https://api.github.com/repos/github/hubot/issues/1/reactions" \
+ -H "Accept: application/vnd.github.squirrel-girl-preview"
+```
+
+
+You can learn more about the new reaction response objects in the updated [Commit comment][commit-comment-doc], [Issue][issue-doc], [Issue comment][issue-comment-doc], and [Review Comment][review-comment-doc] documentation. There is also new [Reaction][reaction-doc] documentation.
+
+During the preview period, we may change aspects of these APIs based on developer feedback. We will announce the changes here on the developer blog, but we will not provide advance notice.
+
+If you have any questions or feedback, please [let us know][contact].
+
+[media-type]: /v3/media
+[reaction-doc]: /v3/reactions
+[issue-doc]: /v3/issues#preview-period-org-issues
+[issue-comment-doc]: /v3/issues/comments#preview-period-issue-comments
+[review-comment-doc]: /v3/pulls/comments#preview-period-pull-comments
+[commit-comment-doc]: /v3/repos/comments#preview-period-commits-comments
+[contact]: https://github.com/contact?form%5Bsubject%5D=Reactions+API+Preview
+[reactions-blog-post]: https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments
diff --git a/content/v3/issues.md b/content/v3/issues.md
index 046606cc3e..63f3f65a22 100644
--- a/content/v3/issues.md
+++ b/content/v3/issues.md
@@ -49,6 +49,26 @@ Name | Type | Description
<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:issue) { |h| [h] } %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the issue payload is currently available for developers to preview. During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :issue_reaction_summary %>
+{% endif %}
+
## List issues for a repository
<%= fetch_content(:prs_as_issues) %>
@@ -74,6 +94,27 @@ Name | Type | Description
<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:issue) { |h| [h] } %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the issue payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :issue_reaction_summary %>
+{% endif %}
+
## Get a single issue
<%= fetch_content(:prs_as_issues) %>
@@ -85,6 +126,27 @@ Name | Type | Description
<%= headers 200 %>
<%= json :full_issue %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the issue payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :issue_reaction_summary %>
+{% endif %}
+
## Create an issue
Any user with pull access to a repository can create an issue.
diff --git a/content/v3/issues/comments.md b/content/v3/issues/comments.md
index 23ab84be33..b9d077b4a0 100644
--- a/content/v3/issues/comments.md
+++ b/content/v3/issues/comments.md
@@ -30,6 +30,27 @@ Name | Type | Description
<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:issue_comment) { |h| [h] } %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the issue comment payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :issue_comment_reaction_summary %>
+{% endif %}
+
## List comments in a repository
GET /repos/:owner/:repo/issues/comments
@@ -50,6 +71,27 @@ Name | Type | Description
<%= headers 200 %>
<%= json(:issue_comment) { |h| [h] } %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the issue comment payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :issue_comment_reaction_summary %>
+{% endif %}
+
## Get a single comment
GET /repos/:owner/:repo/issues/comments/:id
@@ -59,6 +101,27 @@ Name | Type | Description
<%= headers 200, :pagination => default_pagination_rels %>
<%= json :issue_comment %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the issue comment payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :issue_comment_reaction_summary %>
+{% endif %}
+
## Create a comment
POST /repos/:owner/:repo/issues/:number/comments
diff --git a/content/v3/pulls/comments.md b/content/v3/pulls/comments.md
index bd22d27864..fa543427ab 100644
--- a/content/v3/pulls/comments.md
+++ b/content/v3/pulls/comments.md
@@ -24,6 +24,27 @@ types](#custom-media-types). You can read more about the use of media types in t
<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:pull_comment) { |h| [h] } %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the review comment payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :pull_comment_reaction_summary %>
+{% endif %}
+
## List comments in a repository
GET /repos/:owner/:repo/pulls/comments
@@ -44,6 +65,27 @@ Name | Type | Description
<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:pull_comment) { |h| [h] } %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the review comment payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :pull_comment_reaction_summary %>
+{% endif %}
+
## Get a single comment
GET /repos/:owner/:repo/pulls/comments/:id
@@ -53,6 +95,27 @@ Name | Type | Description
<%= headers 200 %>
<%= json :pull_comment %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the review comment payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :pull_comment_reaction_summary %>
+{% endif %}
+
## Create a comment
POST /repos/:owner/:repo/pulls/:number/comments
diff --git a/content/v3/reactions.md b/content/v3/reactions.md
new file mode 100644
index 0000000000..a492093f4c
--- /dev/null
+++ b/content/v3/reactions.md
@@ -0,0 +1,208 @@
+---
+title: Reactions
+---
+
+{% if page.version == 'dotcom' %}
+
+# Reactions
+
+{{#tip}}
+
+
+
+ APIs for managing reactions are currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+{{/tip}}
+
+{:toc}
+
+
+## Reaction types
+
+ When creating a reaction, the allowed values for the `content` parameter are as follows (with the corresponding emoji for reference):
+
+content | emoji
+-----|------
+`+1` | :+1:
+`-1` | :-1:
+`laugh` | :smile:
+`confused` | :confused:
+`heart` | :heart:
+`hooray` | :tada:
+
+
+## List reactions for a commit comment
+
+ GET /repos/:owner/:repo/comments/:id/reactions
+
+### Parameters
+
+Name | Type | Description
+-----|------|--------------
+`content`|`string` | Indicates which type of reaction to return.
+
+### Response
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json(:reaction) { |h| [h] } %>
+
+
+## Create reaction for a commit comment
+
+ POST /repos/:owner/:repo/comments/:id/reactions
+
+### Parameters
+
+Name | Type | Description
+-----|------|--------------
+`content`|`string` | **Required**. The reaction type
+
+<%= json :content => 'heart' %>
+
+### Response
+
+{{#tip}}
+
+ If you have already created a reaction of type `content`, the previously created reaction will be returned with `Status: 200 OK`.
+
+{{/tip}}
+
+<%= headers 201 %>
+<%= json :reaction %>
+
+
+## List reactions for an issue
+
+ GET /repos/:owner/:repo/issues/:number/reactions
+
+### Parameters
+
+Name | Type | Description
+-----|------|--------------
+`content`|`string` | Indicates which type of reaction to return.
+
+### Response
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json(:reaction) { |h| [h] } %>
+
+
+## Create reaction for an issue
+
+ POST /repos/:owner/:repo/issues/:number/reactions
+
+### Parameters
+
+Name | Type | Description
+-----|------|--------------
+`content`|`string` | **Required**. The reaction type
+
+<%= json :content => 'heart' %>
+
+### Response
+
+{{#tip}}
+
+ If you have already created a reaction of type `content`, the previously created reaction will be returned with `Status: 200 OK`.
+
+{{/tip}}
+
+<%= headers 201 %>
+<%= json :reaction %>
+
+
+## List reactions for an issue comment
+
+ GET /repos/:owner/:repo/issues/comments/:id/reactions
+
+### Parameters
+
+Name | Type | Description
+-----|------|--------------
+`content`|`string` | Indicates which type of reaction to return.
+
+### Response
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json(:reaction) { |h| [h] } %>
+
+
+## Create reaction for an issue comment
+
+ POST /repos/:owner/:repo/issues/comments/:id/reactions
+
+### Parameters
+
+Name | Type | Description
+-----|------|--------------
+`content`|`string` | **Required**. The reaction type
+
+<%= json :content => 'heart' %>
+
+### Response
+
+{{#tip}}
+
+ If you have already created a reaction of type `content`, the previously created reaction will be returned with `Status: 200 OK`.
+
+{{/tip}}
+
+<%= headers 201 %>
+<%= json :reaction %>
+
+
+## List reactions for a pull request review comment
+
+ GET /repos/:owner/:repo/pulls/comments/:id/reactions
+
+### Parameters
+
+Name | Type | Description
+-----|------|--------------
+`content`|`string` | Indicates which type of reaction to return.
+
+### Response
+
+<%= headers 200, :pagination => default_pagination_rels %>
+<%= json(:reaction) { |h| [h] } %>
+
+
+## Create reaction for a pull request review comment
+
+ POST /repos/:owner/:repo/pulls/comments/:id/reactions
+
+### Parameters
+
+Name | Type | Description
+-----|------|--------------
+`content`|`string` | **Required**. The reaction type
+
+<%= json :content => 'heart' %>
+
+### Response
+
+{{#tip}}
+
+ If you have already created a reaction of type `content`, the previously created reaction will be returned with `Status: 200 OK`.
+
+{{/tip}}
+
+<%= headers 201 %>
+<%= json :reaction %>
+
+
+## Delete a reaction
+
+ DELETE /reactions/:id
+
+### Response
+
+<%= headers 204 %>
+
+{% endif %}
diff --git a/content/v3/repos/comments.md b/content/v3/repos/comments.md
index 82959fa925..e6f9bb5050 100644
--- a/content/v3/repos/comments.md
+++ b/content/v3/repos/comments.md
@@ -20,6 +20,27 @@ Comments are ordered by ascending ID.
<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:commit_comment) { |h| [h] } %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the commit comment payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :commit_comment_reaction_summary %>
+{% endif %}
+
## List comments for a single commit
GET /repos/:owner/:repo/commits/:ref/comments
@@ -29,6 +50,27 @@ Comments are ordered by ascending ID.
<%= headers 200, :pagination => default_pagination_rels %>
<%= json(:commit_comment) { |h| [h] } %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the commit comment payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :commit_comment_reaction_summary %>
+{% endif %}
+
## Create a commit comment
POST /repos/:owner/:repo/commits/:sha/comments
@@ -66,6 +108,27 @@ Name | Type | Description
<%= headers 200 %>
<%= json :commit_comment %>
+{% if page.version == 'dotcom' %}
+#### Reactions summary
+
+{{#tip}}
+
+
+
+ An additional `reactions` object in the commit comment payload is currently available for developers to preview.
+ During the preview period, the APIs may change without advance notice.
+ Please see the [blog post](/changes/2016-05-12-reactions-api-preview) for full details.
+
+ To access the API you must provide a custom [media type](/v3/media) in the `Accept` header:
+
+ application/vnd.github.squirrel-girl-preview
+
+ The `reactions` key will have the following payload where `url` can be used to construct the API location for [listing and creating](/v3/reactions) reactions.
+
+{{/tip}}
+<%= json :commit_comment_reaction_summary %>
+{% endif %}
+
## Update a commit comment
PATCH /repos/:owner/:repo/comments/:id
diff --git a/layouts/sidebar.html b/layouts/sidebar.html
index d239c196c2..c179fd3fc7 100644
--- a/layouts/sidebar.html
+++ b/layouts/sidebar.html
@@ -83,6 +83,15 @@