From 9abe88db985ca756ead4d219b5783b1aa285513e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFs=20Postula?= Date: Wed, 25 Jan 2023 12:53:48 +0100 Subject: [PATCH 1/3] [fix] Github now returns float for total_minutes_used and included_minutes --- github/billing.go | 4 ++-- github/billing_test.go | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/github/billing.go b/github/billing.go index 2f5861ce808..f6935d6d7c0 100644 --- a/github/billing.go +++ b/github/billing.go @@ -18,9 +18,9 @@ type BillingService service // ActionBilling represents a GitHub Action billing. type ActionBilling struct { - TotalMinutesUsed int `json:"total_minutes_used"` + TotalMinutesUsed float64 `json:"total_minutes_used"` TotalPaidMinutesUsed float64 `json:"total_paid_minutes_used"` - IncludedMinutes int `json:"included_minutes"` + IncludedMinutes float64 `json:"included_minutes"` MinutesUsedBreakdown MinutesUsedBreakdown `json:"minutes_used_breakdown"` } diff --git a/github/billing_test.go b/github/billing_test.go index 6a85cd22df6..52b338b8347 100644 --- a/github/billing_test.go +++ b/github/billing_test.go @@ -21,9 +21,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) { mux.HandleFunc("/orgs/o/settings/billing/actions", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") fmt.Fprint(w, `{ - "total_minutes_used": 305, + "total_minutes_used": 305.0, "total_paid_minutes_used": 0.0, - "included_minutes": 3000, + "included_minutes": 3000.0, "minutes_used_breakdown": { "UBUNTU": 205, "MACOS": 10, @@ -39,9 +39,9 @@ func TestBillingService_GetActionsBillingOrg(t *testing.T) { } want := &ActionBilling{ - TotalMinutesUsed: 305, - TotalPaidMinutesUsed: 0, - IncludedMinutes: 3000, + TotalMinutesUsed: 305.0, + TotalPaidMinutesUsed: 0.0, + IncludedMinutes: 3000.0, MinutesUsedBreakdown: MinutesUsedBreakdown{ "UBUNTU": 205, "MACOS": 10, From 19b5aca13f63d4c3e1902f9a25d4cc11d1308ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFs=20Postula?= Date: Wed, 25 Jan 2023 13:36:33 +0100 Subject: [PATCH 2/3] [enh] estimated_storage_for_month has also been migrated to a float64 --- github/billing.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/billing.go b/github/billing.go index f6935d6d7c0..7a5f722fac8 100644 --- a/github/billing.go +++ b/github/billing.go @@ -38,7 +38,7 @@ type PackageBilling struct { type StorageBilling struct { DaysLeftInBillingCycle int `json:"days_left_in_billing_cycle"` EstimatedPaidStorageForMonth float64 `json:"estimated_paid_storage_for_month"` - EstimatedStorageForMonth int `json:"estimated_storage_for_month"` + EstimatedStorageForMonth float64 `json:"estimated_storage_for_month"` } // ActiveCommitters represents the total active committers across all repositories in an Organization. From d7947b8c8b5c1f8245f03f593637a324cda6fbf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFs=20Postula?= Date: Wed, 25 Jan 2023 13:48:40 +0100 Subject: [PATCH 3/3] [enh] included_gigabytes_bandwidth has also been migrated to a float64 --- github/billing.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/github/billing.go b/github/billing.go index 7a5f722fac8..2900a01670a 100644 --- a/github/billing.go +++ b/github/billing.go @@ -29,9 +29,9 @@ type MinutesUsedBreakdown = map[string]int // PackageBilling represents a GitHub Package billing. type PackageBilling struct { - TotalGigabytesBandwidthUsed int `json:"total_gigabytes_bandwidth_used"` - TotalPaidGigabytesBandwidthUsed int `json:"total_paid_gigabytes_bandwidth_used"` - IncludedGigabytesBandwidth int `json:"included_gigabytes_bandwidth"` + TotalGigabytesBandwidthUsed int `json:"total_gigabytes_bandwidth_used"` + TotalPaidGigabytesBandwidthUsed int `json:"total_paid_gigabytes_bandwidth_used"` + IncludedGigabytesBandwidth float64 `json:"included_gigabytes_bandwidth"` } // StorageBilling represents a GitHub Storage billing.