Repository: google/go-github
Pull request #3257 (2024-09-04 23:58:18)

Update active committers struct
Update active committers struct to include additional attributes.

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/google/go-github/pull/3257?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 92.94%. Comparing base [(`2b8c7fa`)](https://app.codecov.io/gh/google/go-github/commit/2b8c7fa86fcd1cb4a89a44c8e7b5a49fe4be8a45?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) to head [(`66567f8`)](https://app.codecov.io/gh/google/go-github/commit/66567f8a9dac5fafe4428d211b1be2731d7c7cd6?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).
> Report is 105 commits behind head on master.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #3257      +/-   ##
==========================================
- Coverage   97.72%   92.94%   -4.78%     
==========================================
  Files         153      171      +18     
  Lines       13390    11663    -1727     
==========================================
- Hits        13085    10840    -2245     
- Misses        215      729     +514     
- Partials       90       94       +4     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/google/go-github/pull/3257?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).

ganeshkumarsv: @gmlewis can you please take a look when you have time? I added all the introduced attributes into the test case, I'm not sure why the code coverage still fails. 
gmlewis: > @gmlewis can you please take a look when you have time? I added all the introduced attributes into the test case, I'm not sure why the code coverage still fails.

Thank you, @ganeshkumarsv !
Yes, we currently have an issue with CodeCov where we need the token in this repo to be updated for it to work again.
For details, see: https://github.com/google/go-github/pull/3221

Patch:
diff --git a/github/billing.go b/github/billing.go
index 6d7579b8..09b1a5d0 100644
--- a/github/billing.go
+++ b/github/billing.go
@@ -43,8 +43,11 @@ type StorageBilling struct {
 
 // ActiveCommitters represents the total active committers across all repositories in an Organization.
 type ActiveCommitters struct {
-	TotalAdvancedSecurityCommitters int                           `json:"total_advanced_security_committers"`
-	Repositories                    []*RepositoryActiveCommitters `json:"repositories,omitempty"`
+	TotalAdvancedSecurityCommitters     int                           `json:"total_advanced_security_committers"`
+	TotalCount                          int                           `json:"total_count"`
+	MaximumAdvancedSecurityCommitters   int                           `json:"maximum_advanced_security_committers"`
+	PurchasedAdvancedSecurityCommitters int                           `json:"purchased_advanced_security_committers"`
+	Repositories                        []*RepositoryActiveCommitters `json:"repositories,omitempty"`
 }
 
 // RepositoryActiveCommitters represents active committers on each repository.


Test patch:
diff --git a/github/billing_test.go b/github/billing_test.go
index d7adcb09..5c929d5f 100644
--- a/github/billing_test.go
+++ b/github/billing_test.go
@@ -436,10 +436,14 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) {
 		testMethod(t, r, "GET")
 		fmt.Fprint(w, `{
   "total_advanced_security_committers": 2,
+  "total_count": 2,
+  "maximum_advanced_security_committers": 3,
+  "purchased_advanced_security_committers": 4,
   "repositories": [
     {
       "name": "octocat-org/Hello-World",
       "advanced_security_committers": 2,
+      
       "advanced_security_committers_breakdown": [
         {
           "user_login": "octokitten",
@@ -459,7 +463,10 @@ func TestBillingService_GetAdvancedSecurityActiveCommittersOrg(t *testing.T) {
 	}
 
 	want := &ActiveCommitters{
-		TotalAdvancedSecurityCommitters: 2,
+		TotalAdvancedSecurityCommitters:     2,
+		TotalCount:                          2,
+		MaximumAdvancedSecurityCommitters:   3,
+		PurchasedAdvancedSecurityCommitters: 4,
 		Repositories: []*RepositoryActiveCommitters{
 			{
 				Name:                       String("octocat-org/Hello-World"),