-
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
Fix CreateOrUpdateOrgSecret
regression introduced in v53
#2817
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
b18dcbe
to
86e13df
Compare
github/dependabot_secrets.go
Outdated
putSecret := func(ctx context.Context, url string, eSecret interface{}) (*Response, error) { | ||
req, err := s.client.NewRequest("PUT", url, eSecret) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return s.client.Do(ctx, req, nil) | ||
} |
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.
Created this inline for now as it's the only place it's used. Happy to pull it out as an unexported function to match the putSecret
package function (maybe putOrgSecret
). That would require though defining a package type for params
(for used as an input argument). I thought it was an overkill for now, so left it as such.
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.
There's no need for the inline function here. Let's just please delete lines 160 and 167, and move lines 161-166 down to replace line 170 below.
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.
Sounds good - was trying to keep the symmetry with what was previously there. Removed!
ac1e88d
to
bca8d40
Compare
Codecov Report
@@ Coverage Diff @@
## master #2817 +/- ##
=======================================
Coverage 98.05% 98.06%
=======================================
Files 136 136
Lines 12263 12279 +16
=======================================
+ Hits 12025 12041 +16
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, @frankywahl!
Just a few tweaks, please, then we should be ready for a second LGTM+Approval from any other contributor to this repo before merging.
github/dependabot_secrets.go
Outdated
putSecret := func(ctx context.Context, url string, eSecret interface{}) (*Response, error) { | ||
req, err := s.client.NewRequest("PUT", url, eSecret) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return s.client.Do(ctx, req, nil) | ||
} |
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.
There's no need for the inline function here. Let's just please delete lines 160 and 167, and move lines 161-166 down to replace line 170 below.
`CreateOrUpdateOrgSecret`'s API uses `string` for selected repository IDS while other APIs use `int`. This fixes the issue locally by implementing its own type
bca8d40
to
29a4511
Compare
Also, in the future, please don't use force-push in PRs to this repo, as it makes reviewing more challenging to see what has changed since the last review. |
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, @frankywahl !
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
Thank you, @valbeat ! |
CreateOrUpdateOrgSecret
's API usesstring
for selected repository IDS while other APIs useint
. This fixes the issue locally by implementing its own type.fixes #2816