Repository navigation
feat!: Support reason in UsersService.Unsuspend - #4614
JamBalaya56562 wants to merge 2 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4614 +/- ##
==========================================
- Coverage 98.61% 98.61% -0.01%
==========================================
Files 199 199
Lines 18693 18664 -29
==========================================
- Hits 18435 18406 -29
Misses 258 258 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @JamBalaya56562!
LGTM.
|
|
||
| // UnsuspendUserRequest represents a request to unsuspend a user. | ||
| type UnsuspendUserRequest struct { | ||
| Reason *string `json:"reason,omitempty"` |
There was a problem hiding this comment.
Could you please add a comment documenting its default value?
The reason the user is being unsuspended. This message will be logged in the audit log. If you don't provide a reason, it will default to "Unsuspended via API by SITE_ADMINISTRATOR", where SITE_ADMINISTRATOR is the person who performed the action.
There was a problem hiding this comment.
Thanks, @Not-Dhananjay-Mishra! Added a comment documenting the default value in 9b2daa6.
Fixes #4613.
BREAKING CHANGE:
UsersService.Unsuspendnow takes anUnsuspendUserRequestbody argument.The GHES Unsuspend a user endpoint (
DELETE /users/{username}/suspended) accepts an optionalreasonthat is recorded in the audit log, butUnsuspendalways sent no body. This addsUnsuspendUserRequest{Reason *string}and passes it by value, matchingSuspend. PassUnsuspendUserRequest{}to unsuspend without a reason.The new type follows the naming and value passing used for
Suspendin #4612; the two PRs touch different parts ofusers_administration.goand can be merged in either order.Verified locally:
go build ./...,go vet -tags integration ./test/integration/,examplemodule build,go test ./..., generated files idempotent,custom-gcl0 issues, andscript/check-schema-fields.shreports no new issues.