Repository navigation
feat!: Support reason in UsersService.Unsuspend - #4614
Open
JamBalaya56562 wants to merge 1 commit into
Open
JamBalaya56562 wants to merge 1 commit into
JamBalaya56562 wants to merge 1 commit 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%
=======================================
Files 199 199
Lines 18693 18693
=======================================
Hits 18435 18435
Misses 258 258 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gmlewis
approved these changes
Oct 12, 2026
gmlewis
left a comment
Collaborator
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"` |
Contributor
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.