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

Handle package webhook #1569

Merged
merged 3 commits into from Jul 8, 2020
Merged

Conversation

KrammerJake
Copy link
Contributor

Addresses #1550

@googlebot googlebot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Jul 6, 2020
@codecov
Copy link

codecov bot commented Jul 6, 2020

Codecov Report

Merging #1569 into master will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1569      +/-   ##
==========================================
+ Coverage   67.90%   67.95%   +0.04%     
==========================================
  Files          95       96       +1     
  Lines        8750     8762      +12     
==========================================
+ Hits         5942     5954      +12     
  Misses       1898     1898              
  Partials      910      910              
Impacted Files Coverage Δ
github/event_types.go 100.00% <ø> (ø)
github/messages.go 81.17% <ø> (ø)
github/event.go 94.00% <100.00%> (+0.12%) ⬆️
github/packages.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0683ca0...a4bf472. Read the comment docs.

Prerelease *bool `json:"prerelease,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
PackageFiles *[]PackageFile `json:"package_files,omitempty"`

Choose a reason for hiding this comment

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

I think the type should be []*PackageFile. Wait for somebody else to confirm it though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, deifinitely. Since a slice is already a reference type, we don't typically use pointers to slices.
Please change this to []*PackageFile.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @KrammerJake and @jeet-parekh!
This looks great! Just a couple minor tweaks, please, and then we will be ready for a second LGTM and merging.

Prerelease *bool `json:"prerelease,omitempty"`
CreatedAt *Timestamp `json:"created_at,omitempty"`
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
PackageFiles *[]PackageFile `json:"package_files,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, deifinitely. Since a slice is already a reference type, we don't typically use pointers to slices.
Please change this to []*PackageFile.

DownloadURL *string `json:"download_url,omitempty"`
ID *int64 `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Sha256 *string `json:"sha256,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since "SHA" is "Secure Hash Algorithm", let's please make these "SHA256" and "SHA1".

Comment on lines +482 to +483
Repo *Repository `json:"repository,omitempty"`
Org *Organization `json:"organization,omitempty"`

Choose a reason for hiding this comment

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

Use full names here? Repository and Organization instead of Repo and Org. For the sake of consistency.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This file does have mixed naming conventions where both the full name and shorthand are used; however, the shorthand (Repo and Org) versions appear to be the more popular names in this file. I think we can leave these the way they are unless we're trying to standardize to the full name going forward.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, we have not been totally consistent in this regard, so I didn't comment on these. I think that these are the two names we regularly allow to be shortened, as they are globally well known throughout the package and have very small chance of ever causing conflicts with new JSON tags that might show up in later releases.

I'm fine with leaving them as Repo and Org.

Copy link
Collaborator

@gmlewis gmlewis left a comment

Choose a reason for hiding this comment

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

Thank you, @KrammerJake!
LGTM.

Awaiting second LGTM before merging.

Comment on lines +482 to +483
Repo *Repository `json:"repository,omitempty"`
Org *Organization `json:"organization,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, we have not been totally consistent in this regard, so I didn't comment on these. I think that these are the two names we regularly allow to be shortened, as they are globally well known throughout the package and have very small chance of ever causing conflicts with new JSON tags that might show up in later releases.

I'm fine with leaving them as Repo and Org.

Copy link
Collaborator

@wesleimp wesleimp left a comment

Choose a reason for hiding this comment

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

LGTM 👌

@gmlewis
Copy link
Collaborator

gmlewis commented Jul 8, 2020

Thank you, @wesleimp!
Merging.

@gmlewis gmlewis merged commit c4f1bb0 into google:master Jul 8, 2020
@KrammerJake KrammerJake deleted the package-webhook-event branch July 8, 2020 03:04
n1lesh pushed a commit to n1lesh/go-github that referenced this pull request Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Indication that the PR author has signed a Google Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants