Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating dependencies #1240

Merged
merged 1 commit into from
Aug 4, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go
sudo: false
go:
- 1.4.2
- tip

notifications:
email: false
Expand Down
4 changes: 4 additions & 0 deletions _third_party/github.com/andybalholm/cascadia/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ func (p *parser) parseAttributeSelector() (Selector, error) {

var expectedParenthesis = errors.New("expected '(' but didn't find it")
var expectedClosingParenthesis = errors.New("expected ')' but didn't find it")
var unmatchedParenthesis = errors.New("unmatched '('")

// parsePseudoclassSelector parses a pseudoclass selector like :not(p).
func (p *parser) parsePseudoclassSelector() (Selector, error) {
Expand Down Expand Up @@ -457,6 +458,9 @@ func (p *parser) parsePseudoclassSelector() (Selector, error) {
if !p.consumeParenthesis() {
return nil, expectedParenthesis
}
if p.i == len(p.s) {
return nil, unmatchedParenthesis
}
var val string
switch p.s[p.i] {
case '\'', '"':
Expand Down
3 changes: 2 additions & 1 deletion _third_party/github.com/boltdb/bolt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ Here are a few things to note when evaluating and using Bolt:
Below is a list of public, open source projects that use Bolt:

* [Operation Go: A Routine Mission](http://gocode.io) - An online programming game for Golang using Bolt for user accounts and a leaderboard.
* [Bazil](https://github.com/bazillion/bazil) - A file system that lets your data reside where it is most convenient for it to reside.
* [Bazil](https://bazil.org/) - A file system that lets your data reside where it is most convenient for it to reside.
* [DVID](https://github.com/janelia-flyem/dvid) - Added Bolt as optional storage engine and testing it against Basho-tuned leveldb.
* [Skybox Analytics](https://github.com/skybox/skybox) - A standalone funnel analysis tool for web analytics.
* [Scuttlebutt](https://github.com/benbjohnson/scuttlebutt) - Uses Bolt to store and process all Twitter mentions of GitHub projects.
Expand All @@ -616,5 +616,6 @@ Below is a list of public, open source projects that use Bolt:
* [Prometheus Annotation Server](https://github.com/oliver006/prom_annotation_server) - Annotation server for PromDash & Prometheus service monitoring system.
* [Consul](https://github.com/hashicorp/consul) - Consul is service discovery and configuration made easy. Distributed, highly available, and datacenter-aware.
* [Kala](https://github.com/ajvb/kala) - Kala is a modern job scheduler optimized to run on a single node. It is persistant, JSON over HTTP API, ISO 8601 duration notation, and dependent jobs.
* [drive](https://github.com/odeke-em/drive) - drive is an unofficial Google Drive command line client for \*NIX operating systems.

If you are using Bolt in a project please send a pull request to add it to the list.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (s *GistsService) Get(id string) (*Gist, *Response, error) {
return gist, resp, err
}

// Get a specific revision of a gist.
// GetRevision gets a specific revision of a gist.
//
// GitHub API docs: https://developer.github.com/v3/gists/#get-a-specific-revision-of-a-gist
func (s *GistsService) GetRevision(id, sha string) (*Gist, *Response, error) {
Expand Down
5 changes: 3 additions & 2 deletions _third_party/github.com/google/go-github/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ const (
// https://developer.github.com/changes/2014-12-09-new-attributes-for-stars-api/
mediaTypeStarringPreview = "application/vnd.github.v3.star+json"

// https://developer.github.com/changes/2014-12-08-organization-permissions-api-preview/
mediaTypeOrganizationsPreview = "application/vnd.github.moondragon+json"
// https://developer.github.com/changes/2015-06-24-api-enhancements-for-working-with-organization-permissions/
mediaTypeOrgPermissionPreview = "application/vnd.github.ironman-preview+json"
mediaTypeOrgPermissionRepoPreview = "application/vnd.github.ironman-preview.repository+json"
)

// A Client manages communication with the GitHub API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ type IssueEvent struct {
//
// head_ref_restored
// The pull request’s branch was restored.
//
// labeled
// A label was added.
Event *string `json:"event,omitempty"`

// The SHA of the commit that referenced this commit, if applicable.
CommitID *string `json:"commit_id,omitempty"`

CreatedAt *time.Time `json:"created_at,omitempty"`
Issue *Issue `json:"issue,omitempty"`

// Only present on 'labeled' events
Label *Label `json:"label,omitempty"`
}

// ListIssueEvents lists events for the specified issue.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type License struct {
Name *string `json:"name,omitempty"`
URL *string `json:"url,omitempty"`

HTMLURL *string `json:"html_url",omitempty`
HTMLURL *string `json:"html_url,omitempty"`
Featured *bool `json:"featured,omitempty"`
Description *string `json:"description,omitempty"`
Category *string `json:"category,omitempty"`
Expand Down Expand Up @@ -57,7 +57,7 @@ func (s *LicensesService) List() ([]License, *Response, error) {
return *licenses, resp, err
}

// Fetch extended metadata for one license.
// Get extended metadata for one license.
//
// GitHub API docs: https://developer.github.com/v3/licenses/#get-an-individual-license
func (s *LicensesService) Get(licenseName string) (*License, *Response, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestLicensesService_List(t *testing.T) {
t.Errorf("Licenses.List returned error: %v", err)
}

want := []License{License{
want := []License{{
Key: String("mit"),
Name: String("MIT"),
URL: String("https://api.github.com/licenses/mit"),
Expand Down
73 changes: 63 additions & 10 deletions _third_party/github.com/google/go-github/github/orgs_members.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ type Membership struct {
// Possible values are: "active", "pending"
State *string `json:"state,omitempty"`

// TODO(willnorris): add docs
// Role identifies the user's role within the organization or team.
// Possible values for organization membership:
// member - non-owner organization member
// admin - organization owner
//
// Possible values for team membership are:
// member - a normal member of the team
// maintainer - a team maintainer. Able to add/remove other team
// members, promote other team members to team
// maintainer, and edit the team’s name and description
Role *string `json:"role,omitempty"`

// For organization membership, the API URL of the organization.
Expand Down Expand Up @@ -43,6 +52,15 @@ type ListMembersOptions struct {
// 2fa_disabled, all. Default is "all".
Filter string `url:"filter,omitempty"`

// Role filters memebers returned by their role in the organization.
// Possible values are:
// all - all members of the organization, regardless of role
// admin - organization owners
// member - non-organization members
//
// Default is "all".
Role string `url:"role,omitempty"`

ListOptions
}

Expand All @@ -68,6 +86,10 @@ func (s *OrganizationsService) ListMembers(org string, opt *ListMembersOptions)
return nil, nil, err
}

if opt != nil && opt.Role != "" {
req.Header.Set("Accept", mediaTypeOrgPermissionPreview)
}

members := new([]User)
resp, err := s.client.Do(req, members)
if err != nil {
Expand Down Expand Up @@ -120,7 +142,8 @@ func (s *OrganizationsService) RemoveMember(org, user string) (*Response, error)
return s.client.Do(req, nil)
}

// PublicizeMembership publicizes a user's membership in an organization.
// PublicizeMembership publicizes a user's membership in an organization. (A
// user cannot publicize the membership for another user.)
//
// GitHub API docs: http://developer.github.com/v3/orgs/members/#publicize-a-users-membership
func (s *OrganizationsService) PublicizeMembership(org, user string) (*Response, error) {
Expand Down Expand Up @@ -180,12 +203,20 @@ func (s *OrganizationsService) ListOrgMemberships(opt *ListOrgMembershipsOptions
return memberships, resp, err
}

// GetOrgMembership gets the membership for the authenticated user for the
// specified organization.
// GetOrgMembership gets the membership for a user in a specified organization.
// Passing an empty string for user will get the membership for the
// authenticated user.
//
// GitHub API docs: https://developer.github.com/v3/orgs/members/#get-organization-membership
// GitHub API docs: https://developer.github.com/v3/orgs/members/#get-your-organization-membership
func (s *OrganizationsService) GetOrgMembership(org string) (*Membership, *Response, error) {
u := fmt.Sprintf("user/memberships/orgs/%v", org)
func (s *OrganizationsService) GetOrgMembership(user, org string) (*Membership, *Response, error) {
var u string
if user != "" {
u = fmt.Sprintf("orgs/%v/memberships/%v", org, user)
} else {
u = fmt.Sprintf("user/memberships/orgs/%v", org)
}

req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
return nil, nil, err
Expand All @@ -200,12 +231,20 @@ func (s *OrganizationsService) GetOrgMembership(org string) (*Membership, *Respo
return membership, resp, err
}

// EditOrgMembership edits the membership for the authenticated user for the
// specified organization.
// EditOrgMembership edits the membership for user in specified organization.
// Passing an empty string for user will edit the membership for the
// authenticated user.
//
// GitHub API docs: https://developer.github.com/v3/orgs/members/#add-or-update-organization-membership
// GitHub API docs: https://developer.github.com/v3/orgs/members/#edit-your-organization-membership
func (s *OrganizationsService) EditOrgMembership(org string, membership *Membership) (*Membership, *Response, error) {
u := fmt.Sprintf("user/memberships/orgs/%v", org)
func (s *OrganizationsService) EditOrgMembership(user, org string, membership *Membership) (*Membership, *Response, error) {
var u string
if user != "" {
u = fmt.Sprintf("orgs/%v/memberships/%v", org, user)
} else {
u = fmt.Sprintf("user/memberships/orgs/%v", org)
}

req, err := s.client.NewRequest("PATCH", u, membership)
if err != nil {
return nil, nil, err
Expand All @@ -219,3 +258,17 @@ func (s *OrganizationsService) EditOrgMembership(org string, membership *Members

return m, resp, err
}

// RemoveOrgMembership removes user from the specified organization. If the
// user has been invited to the organization, this will cancel their invitation.
//
// GitHub API docs: https://developer.github.com/v3/orgs/members/#remove-organization-membership
func (s *OrganizationsService) RemoveOrgMembership(user, org string) (*Response, error) {
u := fmt.Sprintf("orgs/%v/memberships/%v", org, user)
req, err := s.client.NewRequest("DELETE", u, nil)
if err != nil {
return nil, err
}

return s.client.Do(req, nil)
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ func TestOrganizationsService_ListMembers(t *testing.T) {

mux.HandleFunc("/orgs/o/members", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", mediaTypeOrgPermissionPreview)
testFormValues(t, r, values{
"filter": "2fa_disabled",
"role": "admin",
"page": "2",
})
fmt.Fprint(w, `[{"id":1}]`)
Expand All @@ -29,6 +31,7 @@ func TestOrganizationsService_ListMembers(t *testing.T) {
opt := &ListMembersOptions{
PublicOnly: false,
Filter: "2fa_disabled",
Role: "admin",
ListOptions: ListOptions{Page: 2},
}
members, _, err := client.Organizations.ListMembers("o", opt)
Expand Down Expand Up @@ -239,7 +242,7 @@ func TestOrganizationsService_ListOrgMemberships(t *testing.T) {
}
}

func TestOrganizationsService_GetOrgMembership(t *testing.T) {
func TestOrganizationsService_GetOrgMembership_AuthenticatedUser(t *testing.T) {
setup()
defer teardown()

Expand All @@ -248,7 +251,7 @@ func TestOrganizationsService_GetOrgMembership(t *testing.T) {
fmt.Fprint(w, `{"url":"u"}`)
})

membership, _, err := client.Organizations.GetOrgMembership("o")
membership, _, err := client.Organizations.GetOrgMembership("", "o")
if err != nil {
t.Errorf("Organizations.GetOrgMembership returned error: %v", err)
}
Expand All @@ -259,7 +262,27 @@ func TestOrganizationsService_GetOrgMembership(t *testing.T) {
}
}

func TestOrganizationsService_EditOrgMembership(t *testing.T) {
func TestOrganizationsService_GetOrgMembership_SpecifiedUser(t *testing.T) {
setup()
defer teardown()

mux.HandleFunc("/orgs/o/memberships/u", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
fmt.Fprint(w, `{"url":"u"}`)
})

membership, _, err := client.Organizations.GetOrgMembership("u", "o")
if err != nil {
t.Errorf("Organizations.GetOrgMembership returned error: %v", err)
}

want := &Membership{URL: String("u")}
if !reflect.DeepEqual(membership, want) {
t.Errorf("Organizations.GetOrgMembership returned %+v, want %+v", membership, want)
}
}

func TestOrganizationsService_EditOrgMembership_AuthenticatedUser(t *testing.T) {
setup()
defer teardown()

Expand All @@ -277,7 +300,36 @@ func TestOrganizationsService_EditOrgMembership(t *testing.T) {
fmt.Fprint(w, `{"url":"u"}`)
})

membership, _, err := client.Organizations.EditOrgMembership("o", input)
membership, _, err := client.Organizations.EditOrgMembership("", "o", input)
if err != nil {
t.Errorf("Organizations.EditOrgMembership returned error: %v", err)
}

want := &Membership{URL: String("u")}
if !reflect.DeepEqual(membership, want) {
t.Errorf("Organizations.EditOrgMembership returned %+v, want %+v", membership, want)
}
}

func TestOrganizationsService_EditOrgMembership_SpecifiedUser(t *testing.T) {
setup()
defer teardown()

input := &Membership{State: String("active")}

mux.HandleFunc("/orgs/o/memberships/u", func(w http.ResponseWriter, r *http.Request) {
v := new(Membership)
json.NewDecoder(r.Body).Decode(v)

testMethod(t, r, "PATCH")
if !reflect.DeepEqual(v, input) {
t.Errorf("Request body = %+v, want %+v", v, input)
}

fmt.Fprint(w, `{"url":"u"}`)
})

membership, _, err := client.Organizations.EditOrgMembership("u", "o", input)
if err != nil {
t.Errorf("Organizations.EditOrgMembership returned error: %v", err)
}
Expand All @@ -287,3 +339,18 @@ func TestOrganizationsService_EditOrgMembership(t *testing.T) {
t.Errorf("Organizations.EditOrgMembership returned %+v, want %+v", membership, want)
}
}

func TestOrganizationsService_RemoveOrgMembership(t *testing.T) {
setup()
defer teardown()

mux.HandleFunc("/orgs/o/memberships/u", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "DELETE")
w.WriteHeader(http.StatusNoContent)
})

_, err := client.Organizations.RemoveOrgMembership("u", "o")
if err != nil {
t.Errorf("Organizations.RemoveOrgMembership returned error: %v", err)
}
}
Loading