Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of https://github.com/github/developer.github.com

  • Loading branch information...
commit 9ecf01ef1cc9c2fde206e755d1e7dda2a7cfe159 2 parents 32834fc + c0a63c3
@technoweenie technoweenie authored
View
23 content/v3/pulls.md
@@ -8,6 +8,22 @@ Pull Requests leverage [these](#custom-mime-types) custom mime types. You
can read more about the use of mime types in the API
[here](/v3/mime/).
+## Link Relations
+
+Pull Requests have these possible link relations:
+
+`self`
+: The API location of this Pull Request.
+
+`html`
+: The HTML location of this Pull Request.
+
+`comments`
+: The API location of this Pull Request's Issue comments.
+
+`review_comments`
+: The API location of this Pull Request's Review comments.
+
## List pull requests
GET /repos/:user/:repo/pulls
@@ -45,10 +61,13 @@ body
: _Optional_ **string**
base
-: _Required_ **string** - The branch you want your changes pulled into.
+: _Required_ **string** - The branch (or git ref) you want your changes pulled into.
+This should be an existing branch on the current repository. You cannot
+submit a pull request to one repo that requests a merge to a base of
+another repo.
head
-: _Required_ **string** - The branch where your changes are implemented.
+: _Required_ **string** - The branch (or git ref) where your changes are implemented.
NOTE: `head` and `base` can be either a sha or a branch name. Typically you
would namespace `head` with a user like this: `username:branch`.
View
9 content/v3/pulls/comments.md
@@ -2,9 +2,14 @@
title: Pull Request Comments | GitHub API
---
-# Pull Request Comments API
+# Pull Request Review Comments API
-Pull Request Comments leverage [these](#custom-mime-types) custom mime
+Pull Request Review Comments are comments on a portion of the unified
+diff. These are separate from Commit Comments (which are applied
+directly to a commit, outside of the Pull Request view), and Issue
+Comments (which do not reference a portion of the unified diff).
+
+Pull Request Review Comments leverage [these](#custom-mime-types) custom mime
types. You can read more about the use of mime types in the API
[here](/v3/mime/).
View
4 content/v3/repos.md
@@ -168,8 +168,8 @@ in results.
<%= headers 200 %>
<%= json \
- "C" => "78769",
- "Python" => "7769",
+ "C" => 78769,
+ "Python" => 7769,
%>
## List Teams
View
62 content/v3/repos/hooks.md
@@ -8,6 +8,30 @@ The Repository Hooks API manages the post-receive web and service hooks
for a repository. There are two main APIs to manage these hooks: a JSON
HTTP API, and [PubSubHubbub](#pubsubhubbub).
+Active hooks can be configured to trigger for one or more events.
+The default event is `push`. The available events are:
+
+* `push` - Any git push to a Repository.
+* `issues` - Any time an Issue is opened or closed.
+* `issue_comment` - Any time an Issue is commented on.
+* `commit_comment` - Any time a Commit is commented on.
+* `pull_request` - Any time a Pull Request is opend, closed, or
+ synchronized (updated due to a new push in the branch that the pull
+request is tracking).
+* `gollum` - Any time a Wiki page is updated.
+* `watch` - Any time a User watches the Repository.
+* `download` - Any time a Download is added to the Repository.
+* `fork` - Any time a Repository is forked.
+* `fork_apply` - Any time a patch is applied to the Repository from the
+ Fork Queue.
+* `member` - Any time a User is added as a collaborator to a
+ non-Organization Repository.
+* `public` - Any time a Repository changes from private to public.
+
+For a Hook to go through, the Hook needs to be configured to trigger for
+an event, and the Service has to listen to it. The Services are all
+part of the open source [github-services](https://github.com/github/github-services) project.Most of the Services only listen for `push` events. However, the generic [Web Service](https://github.com/github/github-services/blob/master/services/web.rb) listens for all events. Other services like the [IRC Service](https://github.com/github/github-services/blob/master/services/irc.rb) may only listen for `push`, `issues`, and `pull_request` events.
+
## List
GET /repos/:user/:repo/hooks
@@ -24,7 +48,7 @@ HTTP API, and [PubSubHubbub](#pubsubhubbub).
### Response
<%= headers 200 %>
-<%= json :full_hook %>
+<%= json :hook %>
## Create a hook
@@ -42,24 +66,26 @@ settings for this hook. These settings vary between the services and
are defined in the
[github-services](https://github.com/github/github-services) repo.
+events
+: _Optional_ **array** - Determines what events the hook is triggered
+for. Default: `["push"]`.
+
active
: _Optional_ **boolean** - Determines whether the hook is actually
triggered on pushes.
<%= json \
- :name => "campfire",
+ :name => "web",
:active => true,
:config => {
- :subdomain => 'github',
- :room => 'Commits',
- :token => 'abc123'}
+ :url => 'http://something.com/webhook'}
%>
### Response
<%= headers 201,
:Location => 'https://api.github.com/repos/user/repo/hooks/1' %>
-<%= json :full_hook %>
+<%= json :hook %>
### Edit a hook
@@ -73,10 +99,23 @@ See [/hooks](https://api.github.com/hooks) for the possible names.
config
: _Required_ **hash** - A Hash containing key/value pairs to provide
-settings for this hook. These settings vary between the services and
+settings for this hook. Modifying this will replace the entire config
+object. These settings vary between the services and
are defined in the
[github-services](https://github.com/github/github-services) repo.
+events
+: _Optional_ **array** - Determines what events the hook is triggered
+for. This replaces the entire array of events. Default: `["push"]`.
+
+add_events
+: _Optional_ **array** - Determines a list of events to be added to the
+list of events that the Hook triggers for.
+
+remove_events
+: _Optional_ **array** - Determines a list of events to be removed from the
+list of events that the Hook triggers for.
+
active
: _Optional_ **boolean** - Determines whether the hook is actually
triggered on pushes.
@@ -93,7 +132,7 @@ triggered on pushes.
### Response
<%= headers 200 %>
-<%= json :full_hook %>
+<%= json :hook %>
## Test a hook
@@ -118,7 +157,10 @@ repository.
GitHub can also serve as a [PubSubHubbub][pubsub] hub for all repositories. PSHB is a simple publish/subscribe protocol that lets servers register to receive updates when a topic is updated. The updates are sent with an HTTP POST request to a callback URL. Topic URLs for a GitHub repository's pushes are in this format:
- https://github.com/:user/:repo/events/push
+ https://github.com/:user/:repo/events/:event
+
+The event can be any Event string that is listed at the top of this
+document.
The default format is what [existing post-receive hooks should
expect][post-receive]: A JSON body sent as the `payload` parameter in a
@@ -156,7 +198,7 @@ hub.mode
hub.topic
: _Required_ **string** - The URI of the GitHub repository to subscribe
-to. The path must be in the format of `/:user/:repo/events/push`.
+to. The path must be in the format of `/:user/:repo/events/:event`.
hub.callback
: _Required_ **string** - The URI to receive the updates to the topic.
View
2  layouts/default.html
@@ -81,7 +81,7 @@
<li class="js-topic">
<h3><a href="#" class="js-expand-btn collapsed">&nbsp;</a><a href="/v3/pulls/">Pull Requests</a></h3>
<ul class="js-guides">
- <li><a href="/v3/pulls/comments/">Comments</a></li>
+ <li><a href="/v3/pulls/comments/">Review Comments</a></li>
</ul>
</li>
<li class="js-topic">
View
17 lib/resources.rb
@@ -150,7 +150,6 @@ def json(key)
}
}
-
PULL = {
"url" => "https://api.github.com/octocat/Hello-World/pulls/1",
"html_url" => "https://github.com/octocat/Hello-World/pulls/1",
@@ -165,6 +164,16 @@ def json(key)
"updated_at" => "2011-01-26T19:01:12Z",
"closed_at" => "2011-01-26T19:01:12Z",
"merged_at" => "2011-01-26T19:01:12Z",
+ "_links" => {
+ "self" => {'_href' =>
+ "https://api.github.com/octocat/Hello-World/pulls/1"},
+ "html" => {'_href' =>
+ "https://github.com/octocat/Hello-World/pull/1"},
+ "comments" => {'_href' =>
+ "https://api.github.com/octocat/Hello-World/issues/1/comments"},
+ "review_comments" => {'_href' =>
+ "https://api.github.com/octocat/Hello-World/pulls/1/comments"}
+ }
}
FULL_PULL = PULL.merge({
@@ -645,13 +654,13 @@ def json(key)
"updated_at" => "2011-09-06T20:39:23Z",
"created_at" => "2011-09-06T17:26:27Z",
"name" => "web",
+ "events" => ["push"],
"active" => true,
+ "config" =>
+ {'url' => 'http://example.com', 'content_type' => 'json'},
"id" => 1
}
- FULL_HOOK = HOOK.merge 'config' =>
- {'url' => 'http://example.com', 'content_type' => 'json'}
-
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.