-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for personal access tokens request review API #2827
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
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @joaopenteado !
Co-authored-by: Glenn Lewis <[email protected]>
@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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @joaopenteado !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.