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

Support updates to Marketplace APIs and webhook payload #1042

Merged
merged 10 commits into from
Nov 22, 2018

Conversation

srmocher
Copy link

@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
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.

github/apps_marketplace.go Outdated Show resolved Hide resolved
github/apps_marketplace.go Outdated Show resolved Hide resolved
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, @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.

PriceModel *string `json:"price_model,omitempty"`
UnitName *string `json:"unit_name,omitempty"`
Bullets *[]string `json:"bullets,omitempty"`
State *string `json:"state,omitempty"`
Copy link
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
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

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"`
Copy link
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
Author

Choose a reason for hiding this comment

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

Updated.

}

// 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"`
Copy link
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
Author

Choose a reason for hiding this comment

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

Updated.


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

Choose a reason for hiding this comment

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

Updated.

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, @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.

Copy link
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
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