Skip to content

Support updates to Marketplace APIs and webhook payload#1042

Merged
gmlewis merged 10 commits into
google:masterfrom
srmocher:feature/support-marketplace-events
Nov 22, 2018
Merged

Support updates to Marketplace APIs and webhook payload#1042
gmlewis merged 10 commits into
google:masterfrom
srmocher:feature/support-marketplace-events

Conversation

@srmocher
Copy link
Copy Markdown

@srmocher srmocher commented Nov 4, 2018

Adds support for pending changes to Marketplace plans which were added to the API. (discussed here https://developer.github.com/changes/2018-10-31-improved-experience-for-marketplace-pending-changes/) and referenced here #1040.

@googlebot googlebot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Nov 4, 2018
Copy link
Copy Markdown
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, @srmocher!
This looks like a good start. Feel free to use multiple PRs to address all the issues in #1040.
I've requested a few tweaks.

Also, please make sure to read CONTRIBUTING.md which will show you how to update the github-accessors.go file which should cause the Travis CI build to succeed.

Comment thread github/apps_marketplace.go Outdated
Comment thread github/apps_marketplace.go Outdated
Copy link
Copy Markdown
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, @srmocher - this is a quick review... I need to dig into the history later to see why some things were *string when they look like they should be *Timestamp from a quick glance...
but here are some comments that we can discuss.

Comment thread github/apps_marketplace.go Outdated
PriceModel *string `json:"price_model,omitempty"`
UnitName *string `json:"unit_name,omitempty"`
Bullets *[]string `json:"bullets,omitempty"`
State *string `json:"state,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.

What are the possible values of State? Can you please add a comment to State?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I only found sparse description for the possible values here. Seems like it can take either "draft" or "published". https://developer.github.com/marketplace/listing-on-github-marketplace/setting-a-github-marketplace-listing-s-pricing-plan/#creating-pricing-plans

Comment thread github/apps_marketplace.go Outdated
Plan *MarketplacePlan `json:"plan,omitempty"`
Account *MarketplacePlanAccount `json:"account,omitempty"`
OnFreeTrial *bool `json:"on_free_trial,omitempty"`
FreeTrialEndsOn *string `json:"free_trial_ends_on,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.

This should probably be a *Timestamp.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated.

Comment thread github/apps_marketplace.go Outdated
type MarketplacePurchase struct {
// BillingCycle can be one of the values "yearly", "monthly" or nil.
BillingCycle *string `json:"billing_cycle,omitempty"`
NextBillingDate *string `json:"next_billing_date,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.

This should probably be a *Timestamp.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated.

Comment thread github/apps_marketplace.go Outdated

// MarketplacePendingChange represents a pending change to a GitHub Apps Marketplace Plan.
type MarketplacePendingChange struct {
EffectiveDate *time.Time `json:"effective_date,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.

This should be a *Timestamp to be consistent with the repo.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Updated.

Copy link
Copy Markdown
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, @srmocher!

LGTM.
Awaiting second LGTM before merging.

Note to self: This is a breaking API change due to the string => Timestamp and the time.Time => Timestamp changes. So the version number will need to be bumped after merging.

@gmlewis gmlewis requested a review from gauntface November 16, 2018 14:42
Copy link
Copy Markdown
Contributor

@gauntface gauntface left a comment

Choose a reason for hiding this comment

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

Looks great to me and thank you for the extra timestamp clean up :)

@gmlewis
Copy link
Copy Markdown
Collaborator

gmlewis commented Nov 22, 2018

Thank you, @gauntface!
Merging.

@gmlewis gmlewis merged commit a20c5a1 into google:master Nov 22, 2018
@srmocher srmocher deleted the feature/support-marketplace-events branch November 22, 2018 04:43
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.

4 participants