Skip to content

feat: Add enterprise billing usage endpoints and response types#4288

Open
maishivamhoo123 wants to merge 12 commits into
google:masterfrom
maishivamhoo123:refactor/enterprise-billing-merge-structs
Open

feat: Add enterprise billing usage endpoints and response types#4288
maishivamhoo123 wants to merge 12 commits into
google:masterfrom
maishivamhoo123:refactor/enterprise-billing-merge-structs

Conversation

@maishivamhoo123

@maishivamhoo123 maishivamhoo123 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for the GitHub Enterprise billing usage API endpoints.
#4262

New methods on BillingService

GetEnterpriseUsageReport
GetEnterpriseUsageSummary
GetEnterprisePremiumRequestUsageReport
GetEnterpriseAICreditUsage

And added test for all the new End points .

Comment thread github/enterprise_billing.go Outdated
@gmlewis gmlewis changed the title Add enterprise billing usage endpoints and response types feat: Add enterprise billing usage endpoints and response types Jun 8, 2026
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.47%. Comparing base (34dd998) to head (450899d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4288   +/-   ##
=======================================
  Coverage   97.46%   97.47%           
=======================================
  Files         192      193    +1     
  Lines       19258    19310   +52     
=======================================
+ Hits        18770    18822   +52     
  Misses        270      270           
  Partials      218      218           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
@maishivamhoo123

Copy link
Copy Markdown
Contributor Author

@alexandear @gmlewis @Not-Dhananjay-Mishra i made all the changes can you please review it ?
Thank you.

Comment thread github/enterprise_billing.go
Comment thread github/enterprise_billing_test.go Outdated
Comment thread github/enterprise_billing_test.go
Comment thread github/enterprise_billing.go Outdated
@maishivamhoo123

Copy link
Copy Markdown
Contributor Author

@gmlewis @alexandear @Not-Dhananjay-Mishra All tests and lint checks are passing in my local setup.
Screenshot 2026-06-11 153028

However, I'm not sure why the CI is failing here. Could you please guide me on how to debug this issue and identify the root cause? I'd also appreciate any suggestions on how to fix the linting error.
Thank you!

@alexandear

alexandear commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

However, I'm not sure why the CI is failing here. Could you please guide me on how to debug this issue and identify the root cause? I'd also appreciate any suggestions on how to fix the linting error. Thank you!

Don't worry; it's a GitHub problem. @gmlewis will retry the workflow run.

@gmlewis gmlewis left a comment

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.

Thank you, @maishivamhoo123!

The new endpoints are missing tests that make calls to testBadOptions and testNewRequestAndDoFailure. For example:

const methodName = "ListSelectedReposForOrgSecret"
testBadOptions(t, methodName, func() (err error) {
        _, _, err = client.Dependabot.ListSelectedReposForOrgSecret(ctx, "\n", "\n", opts)
        return err
})

testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
        got, resp, err := client.Dependabot.ListSelectedReposForOrgSecret(ctx, "o", "NAME", opts)
        if got != nil {
                t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
        }
        return resp, err

        })
})

There are many examples in this repo. Please add similar tests to fix code coverage.

@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Jun 11, 2026
Comment thread github/enterprise_billing.go Outdated
…ints

Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
@maishivamhoo123 maishivamhoo123 requested a review from gmlewis June 11, 2026 14:25
@maishivamhoo123

Copy link
Copy Markdown
Contributor Author

@alexandear and @gmlewis i made all the recommended changes can you please review this .
Thank you!

@gmlewis gmlewis left a comment

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.

Thank you, @maishivamhoo123!
LGTM.
Awaiting LGTM+Approval from other reviewers before merging:

cc: @alexandear - @Not-Dhananjay-Mishra

Comment thread github/enterprise_billing_test.go Outdated
Comment thread github/enterprise_billing_test.go Outdated
Comment thread github/enterprise_billing_test.go Outdated
Comment thread github/enterprise_billing_test.go Outdated
Comment thread github/enterprise_billing_test.go Outdated
Comment thread github/enterprise_billing_test.go Outdated
Comment thread github/enterprise_billing_test.go Outdated
Comment thread github/enterprise_billing_test.go Outdated
Comment thread github/enterprise_billing_test.go Outdated
Comment thread github/enterprise_billing_test.go Outdated
Signed-off-by: maishivamhoo123 <maishivamhoo@gmail.com>
@maishivamhoo123

Copy link
Copy Markdown
Contributor Author

@alexandear Thank you for your review .
I made all the suggested changes can you please take a another look .
Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants