Repository navigation
refactor!: Rename MaintenanceOptions to SetMaintenanceStatusRequest and CreateMaintenance to SetMaintenanceStatus, and pass it by value - #4708
Merged
gmlewis merged 2 commits intoNov 10, 2026
Conversation
…t` and `CreateMaintenance` to `SetMaintenanceStatus`, and pass it by value BREAKING CHANGE: `MaintenanceOptions` is renamed to `SetMaintenanceStatusRequest`; `EnterpriseService.CreateMaintenance` is renamed to `SetMaintenanceStatus`, drops its `enable` parameter in favor of `SetMaintenanceStatusRequest.Enabled`, and takes the request by value.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4708 +/- ##
==========================================
- Coverage 98.64% 98.64% -0.01%
==========================================
Files 204 204
Lines 19080 19079 -1
==========================================
- Hits 18822 18821 -1
Misses 258 258 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gmlewis
approved these changes
Nov 10, 2026
gmlewis
left a comment
Collaborator
There was a problem hiding this comment.
Thank you, @JamBalaya56562!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
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.
Updates #3644.
BREAKING CHANGE:
MaintenanceOptionsis renamed toSetMaintenanceStatusRequest;EnterpriseService.CreateMaintenanceis renamed toSetMaintenanceStatus, drops itsenableparameter in favor ofSetMaintenanceStatusRequest.Enabled, and takes the request by value.This PR:
MaintenanceOptionstoSetMaintenanceStatusRequestand passes it by value, removingMaintenanceOptionsfrom bothbody-allowed-pointer-typesandbody-allowed-wrong-namesin.golangci.yml.CreateMaintenancetoSetMaintenanceStatusto match the GitHub docs operation name ("Set the status of maintenance mode") and the existingGetMaintenanceStatus.enable boolparameter. It duplicated the requiredenabledbody field and was written into the caller's struct (body.Enabled = enable), which also panicked on anilbody.IPExceptionListfromomitemptytoomitzero, so an empty list can be sent explicitly.errorproperty of theghes-set-maintenance-responseschema toMaintenanceOperationStatus(separate commit).The request fields match the
ghes-set-maintenance-requestschema (enabledis the only required property and is already a non-pointerbool).