Skip to content

Add active committers API implementation - #2208

Merged
gmlewis merged 8 commits into
google:masterfrom
ganeshkumarsv:ganesh.kumar-billing-codescanning
Nov 29, 2021
Merged

Add active committers API implementation#2208
gmlewis merged 8 commits into
google:masterfrom
ganeshkumarsv:ganesh.kumar-billing-codescanning

Conversation

@ganeshkumarsv

@ganeshkumarsvganeshkumarsv commented Nov 23, 2021

Copy link
Copy Markdown
Contributor

@google-clagoogle-claBot added the cla: yes Indication that the PR author has signed a Google Contributor License Agreement. label Nov 23, 2021
@ganeshkumarsv
ganeshkumarsv marked this pull request as draft November 23, 2021 21:40
@codecov

codecovBot commented Nov 23, 2021

Copy link
Copy Markdown

Codecov Report

Merging #2208 (54c9873) into master (b26fa8f) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@## master #2208 +/- ##
=======================================
Coverage 97.79% 97.80% =======================================
Files 112 112 Lines 10036 10074 +38 =======================================
+ Hits 9815 9853 +38 
Misses 154 154 Partials 67 67 
Impacted FilesCoverage Δ
github/billing.go100.00% <100.00%> (ø)
github/actions_workflow_runs.go100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b26fa8f...54c9873. Read the comment docs.

@ganeshkumarsv
ganeshkumarsvforce-pushed the ganesh.kumar-billing-codescanning branch from 0b4f992 to 2512b27CompareNovember 23, 2021 23:00
@ganeshkumarsv
ganeshkumarsv marked this pull request as ready for review November 23, 2021 23:14
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing_test.go
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
@ganeshkumarsv

Copy link
Copy Markdown
ContributorAuthor

@gmlewis I guess I addressed all the review comments. Please let me know if everything looks alright. Thanks!

Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated

// ActiveCommitters represents the total active committers across all repositories in an Organization.
type ActiveCommitters struct {
TotalAdvancedSecurityCommitters int `json:"total_advanced_security_committers,omitempty"`

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.

If it isn't a reference type (e.g. *int in this case) then it doesn't need the omitempty.

Suggested change
TotalAdvancedSecurityCommittersint`json:"total_advanced_security_committers,omitempty"`
TotalAdvancedSecurityCommittersint`json:"total_advanced_security_committers"`

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@gmlewis can I know how we find out if its a reference type or not?

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.

@gmlewis can I know how we find out if its a reference type or not?

There are a few scenarios where reference types are needed and/or desired:

  • When the response might not populate the field,
  • When an option being sent from the client to the server is optional and we don't want the zero value of the field to be sent
  • When we have a slice of a struct, it is desirable to iterate over a slice of pointers rather than a slice of values.

Conversely, if a field is already a reference type (for example, a slice or an interface), we don't typically want to have a pointer to it. In other words, if you ever see *[]something or *[]*something` then that is typically suspect and not desirable.

I hope that helps.

Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
Comment threadgithub/billing.go Outdated
@ganeshkumarsv

Copy link
Copy Markdown
ContributorAuthor

@gmlewis I guess I addressed all the comments. Please let me know if the changes look alright! Thanks for the review!

@gmlewisgmlewis changed the title add active committers api implementationAdd active committers API implementationNov 27, 2021

@gmlewisgmlewis 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, @ganeshkumarsv !
LGTM.

Awaiting second LGTM before merging.

(Please note that ALL other contributors to this repo are welcome to provide the second PR review/comment/approval that we need for merging and that we are not waiting for any particular reviewer unless otherwise noted.)

@ganeshkumarsv

Copy link
Copy Markdown
ContributorAuthor

@cpanato@gunadhya@sagar23sj
I see you have contributed to billing.go and billing_test.go. Can anyone please review and approve my PR? 🙇

@cpanatocpanato left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks great to me, thanks for adding that

@gmlewis

Copy link
Copy Markdown
Collaborator

Thank you, @cpanato !
Merging.

@gmlewis
gmlewis merged commit f0f6761 into google:masterNov 29, 2021
@ganeshkumarsv

Copy link
Copy Markdown
ContributorAuthor

@gmlewis can we have a minor release?

@gmlewis

Copy link
Copy Markdown
Collaborator

@gmlewis can we have a minor release?

I will work on a release, but due to the breaking API change in #2205, it will be a major release.

@gmlewis

Copy link
Copy Markdown
Collaborator

@ganeshkumarsv - this change is now incorporated in the new release:
https://github.com/google/go-github/releases/tag/v41.0.0

jlaportebot added a commit to jlaportebot/go-github that referenced this pull request Jun 28, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yesIndication that the PR author has signed a Google Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ganeshkumarsv@gmlewis@cpanato