-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Support updates to Marketplace APIs and webhook payload #1042
Support updates to Marketplace APIs and webhook payload #1042
Conversation
There was a problem hiding this 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.
There was a problem hiding this 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.
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"` |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
github/apps_marketplace.go
Outdated
BillingCycle *string `json:"billing_cycle,omitempty"` | ||
NextBillingDate *string `json:"next_billing_date,omitempty"` | ||
UnitCount *int `json:"unit_count,omitempty"` | ||
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"` |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
github/apps_marketplace.go
Outdated
} | ||
|
||
// MarketplacePurchase represents a GitHub Apps Marketplace Purchase. | ||
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"` |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
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"` |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
There was a problem hiding this 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.
There was a problem hiding this 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 :)
Thank you, @gauntface! |
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.