Skip to content

Add installation webhook events - #434

Closed
cyberdelia wants to merge 5 commits into
google:masterfrom
cyberdelia:installation-events
Closed

cyberdelia wants to merge 5 commits into
google:masterfrom
cyberdelia:installation-events

Conversation

@cyberdelia

Copy link
Copy Markdown
Contributor

Add support for the new webhooks event for installations.

See for details:

@googlebot

Copy link
Copy Markdown

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@cyberdelia

Copy link
Copy Markdown
Contributor Author

I signed it!

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

Add support for the new webhooks event for installations.
See: https://developer.github.com/early-access/integrations/webhooks/
Comment thread github/event_types.go Outdated
type IntegrationEvent struct {
Action *string `json:"action,omitempty"`
Installation *Installation `json:"installation,omitempty"`
RepositoryAdded []*Repository `json:"repositories_added,omitempty"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/RepositoryAdded/RepositoriesAdded/

Comment thread github/event_types.go Outdated
Action *string `json:"action,omitempty"`
Installation *Installation `json:"installation,omitempty"`
RepositoryAdded []*Repository `json:"repositories_added,omitempty"`
RepositoryRemoved []*Repository `json:"repositories_removed,omitempty"`

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/RepositoryRemoved/RepositoriesRemoved/

Comment thread github/installation.go Outdated
@@ -0,0 +1,14 @@
// Copyright 2013 The go-github AUTHORS. All rights reserved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/2013/2016/

Comment thread github/event_types.go
Installation *Installation `json:"installation,omitempty"`
RepositoryAdded []*Repository `json:"repositories_added,omitempty"`
RepositoryRemoved []*Repository `json:"repositories_removed,omitempty"`
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add:

Sender *User `json:"sender,omitempty"`

to this struct?

Comment thread github/event_types.go Outdated
//
// GitHub docs: https://developer.github.com/early-access/integrations/webhooks/
type IntegrationEvent struct {
Action *string `json:"action,omitempty"`

@gmlewis gmlewis Sep 26, 2016 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please document this field? For example:

// The action that was performed. Possible values for an "integration_installation"
// event are: "created", "deleted". Possible values for an "integration_installation_repositories"
// event are: "added", "removed".
Action ...

(Following the style of the documentation found in other files in this repo.)

@cyberdelia

Copy link
Copy Markdown
Contributor Author

@gmlewis I addressed your feedback, thanks!

Comment thread github/installation.go Outdated
@@ -0,0 +1,14 @@
// Copyright 2016 The go-github AUTHORS. All rights reserved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, does this need its own separate file?
How about defining the Installation struct with the IntegrationEvent in event_types.go?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was merely trying to follow the structure of the other events, but that's a fairly special case, so maybe?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, let's see what @shurcooL says.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this seems to fit really nicely right under the definition of IntegrationEvent that first mentions it. It doesn't seem like a win to break it out into a separate tiny file.

I was merely trying to follow the structure of the other events

I don't quite see where that's the case, can you point it out please?

@gmlewis

gmlewis commented Sep 26, 2016

Copy link
Copy Markdown
Collaborator

@shurcooL - whenever you have time to check this out, that would be greatly appreciated.
Thanks!

Comment thread github/installation.go Outdated
@@ -0,0 +1,14 @@
// Copyright 2016 The go-github AUTHORS. All rights reserved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree this seems to fit really nicely right under the definition of IntegrationEvent that first mentions it. It doesn't seem like a win to break it out into a separate tiny file.

I was merely trying to follow the structure of the other events

I don't quite see where that's the case, can you point it out please?

Comment thread github/event_types.go
RepositoriesRemoved []*Repository `json:"repositories_removed,omitempty"`
Sender *User `json:"sender,omitempty"`
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I.e., Installation could go right here.

Comment thread github/messages.go Outdated
"fork": "ForkEvent",
"gollum": "GollumEvent",
"integration_installation": "IntegrationEvent",
"integration_installation_repositories": "IntegrationEvent",

@dmitshur dmitshur Sep 27, 2016 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I'm missing something, but why are these two events/webhook types combined into a single shared struct type? According to https://developer.github.com/early-access/integrations/webhooks/, they have different fields.

Why not have IntegrationInstallationEvent and IntegrationInstallationRepositoriesEvent?

Somewhat similar to pull_request_review_comment and pull_request mapping to their own separate types.

Are they different or special in a way? I'm not very familiar with the details here, so I'm asking.

@cyberdelia

Copy link
Copy Markdown
Contributor Author

I moved Installation in the same file as the events, and separated the two webhooks events.

@googlebot

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@dmitshur

dmitshur commented Sep 27, 2016 •

Copy link
Copy Markdown
Member

LGTM.

I fixed a typo and made the URLs more specific (trying out github's new collaboration feature, lol, and figured it's easier to fix a typo myself than to tell you to fix it). Hope that's okay. Check it over.

@cyberdelia

Copy link
Copy Markdown
Contributor Author

Looks good to me, thanks.

@gmlewis gmlewis added the lgtm label Sep 27, 2016
@gmlewis

gmlewis commented Sep 27, 2016

Copy link
Copy Markdown
Collaborator

LGTM. Merging.

@gmlewis gmlewis closed this in b0b867f Sep 27, 2016
@gmlewis

gmlewis commented Sep 27, 2016

Copy link
Copy Markdown
Collaborator

Integrated in b0b867f
Thank you, @cyberdelia and @shurcooL !

bradleyfalzon added a commit to bradleyfalzon/go-github that referenced this pull request Jun 3, 2017
With the release of GitHub Apps (was GitHub Integrations), GitHub
have renamed the integration_installation and integration_installation_repositories
event to installation and installation_repositories respectively.

This is a breaking change for those using this API, and can be fixed with:

gofmt -w -r 'IntegrationInstallationEvent -> InstallationEvent' [path ...]
gofmt -w -r 'IntegrationInstallationRepositoriesEvent -> InstallationRepositoriesEvent' [path ...]

Closes google#627.
Updates google#434.
bradleyfalzon added a commit to bradleyfalzon/go-github that referenced this pull request Jun 3, 2017
With the release of GitHub Apps (was GitHub Integrations), GitHub
have renamed the integration_installation and integration_installation_repositories
event to installation and installation_repositories respectively.

This is a breaking change for those using this API, and can be fixed with:

gofmt -w -r 'IntegrationInstallationEvent -> InstallationEvent' [path ...]
gofmt -w -r 'IntegrationInstallationRepositoriesEvent -> InstallationRepositoriesEvent' [path ...]

Closes google#627.
Updates google#434.
bradleyfalzon added a commit to bradleyfalzon/go-github that referenced this pull request Jun 3, 2017
With the release of GitHub Apps (was GitHub Integrations), GitHub
have renamed the integration_installation and integration_installation_repositories
event to installation and installation_repositories respectively.

This is a breaking change for those using this API, and can be fixed with:

gofmt -w -r 'IntegrationInstallationEvent -> InstallationEvent' [path ...]
gofmt -w -r 'IntegrationInstallationRepositoriesEvent -> InstallationRepositoriesEvent' [path ...]

Closes google#627.
Updates google#434.
bradleyfalzon added a commit to bradleyfalzon/go-github that referenced this pull request Jun 3, 2017
With the release of GitHub Apps (was GitHub Integrations), GitHub
have renamed the integration_installation and integration_installation_repositories
event to installation and installation_repositories respectively.

This is a breaking change for those using this API, and can be fixed with:

gofmt -w -r 'IntegrationInstallationEvent -> InstallationEvent' [path ...]
gofmt -w -r 'IntegrationInstallationRepositoriesEvent -> InstallationRepositoriesEvent' [path ...]

Closes google#627.
Updates google#434.
dmitshur pushed a commit that referenced this pull request Jun 4, 2017
With the release of GitHub Apps (was GitHub Integrations), GitHub
have renamed the integration_installation and integration_installation_repositories
event to installation and installation_repositories respectively.

This is a breaking change for those using this API, and can be fixed with:

gofmt -w -r 'IntegrationInstallationEvent -> InstallationEvent' [path ...]
gofmt -w -r 'IntegrationInstallationRepositoriesEvent -> InstallationRepositoriesEvent' [path ...]

Closes #627.
Updates #434.
bubg-dev pushed a commit to bubg-dev/go-github that referenced this pull request Jun 16, 2017
Add support for the new webhooks event for installations.
See: https://developer.github.com/early-access/integrations/webhooks/

Closes google#434.

Change-Id: I74d3d50cb6b350322fc4515ad70097f0f70ae478
bubg-dev pushed a commit to bubg-dev/go-github that referenced this pull request Jun 16, 2017
With the release of GitHub Apps (was GitHub Integrations), GitHub
have renamed the integration_installation and integration_installation_repositories
event to installation and installation_repositories respectively.

This is a breaking change for those using this API, and can be fixed with:

gofmt -w -r 'IntegrationInstallationEvent -> InstallationEvent' [path ...]
gofmt -w -r 'IntegrationInstallationRepositoriesEvent -> InstallationRepositoriesEvent' [path ...]

Closes google#627.
Updates google#434.
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Add support for the new webhooks event for installations.
See: https://developer.github.com/early-access/integrations/webhooks/

Closes google#434.

Change-Id: I74d3d50cb6b350322fc4515ad70097f0f70ae478
jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
With the release of GitHub Apps (was GitHub Integrations), GitHub
have renamed the integration_installation and integration_installation_repositories
event to installation and installation_repositories respectively.

This is a breaking change for those using this API, and can be fixed with:

gofmt -w -r 'IntegrationInstallationEvent -> InstallationEvent' [path ...]
gofmt -w -r 'IntegrationInstallationRepositoriesEvent -> InstallationRepositoriesEvent' [path ...]

Closes google#627.
Updates google#434.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants