Add support for personal access tokens request review API#2827
Add support for personal access tokens request review API#2827gmlewis merged 4 commits intogoogle:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2827 +/- ##
=======================================
Coverage 98.06% 98.06%
=======================================
Files 136 137 +1
Lines 12279 12287 +8
=======================================
+ Hits 12041 12049 +8
Misses 162 162
Partials 76 76
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @joaopenteado !
Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
|
@gmlewis thanks again for the quick feedback! I'll probably commit the requested changes by tomorrow.
This makes perfect sense. I should've thought of that, thanks for the heads up! Just two questions though, as I am still not very familiar with this package's approach to API design. I saw a lot of other methods using pointers to the Additionally, the In order words, despite type ReviewPersonalAccessTokenRequestOptions struct {
Action *string `json:"action,omitempty"`
Reason *string `json:"reason,omitempty"`
}And not like this: type ReviewPersonalAccessTokenRequestOptions struct {
Action string `json:"action"`
Reason *string `json:"reason,omitempty"` // or string
}Is my understanding of the above points, correct? |
So you will probably see inconsistencies in this regard within this client library, which I will take the blame for.
Again, ideally, if a passed parameter is mandatory, we would not use a pointer, and we would not use So it appears to me that your last suggestion would be preferred since type ReviewPersonalAccessTokenRequestOptions struct {
Action string `json:"action"`
Reason *string `json:"reason,omitempty"`
} |
|
In case the last comment wasn't clear, I would think this method would have this in it: (in other words, not a pointer to a struct, but instead using pass-by-value.) |
|
@gmlewis Thank you for clarifying! Additionally, I've made the parameter |
Since the official docs say that it is an "integer", then let's please make it an |
|
Oh, and you can leave all the "%v" in the |
|
Done! |
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @joaopenteado !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
|
Thank you, @liaodaniel ! |
Following up with my previous PR #2826, I am also proposing the following changes, which add support for programmatically approving or denying fine-grained personal access token requests.
I thought about including the rest of this API, but I don't have an immediate need for it and the PR might get a little too big. I was also a bit unsure on the function signature, so let me know your thoughts.