Skip to content

refactor!: Rename MaintenanceOptions to SetMaintenanceStatusRequest and CreateMaintenance to SetMaintenanceStatus, and pass it by value - #4708

Merged
gmlewis merged 2 commits into
google:masterfrom
JamBalaya56562:refactor/3644-maintenance-status-request
Nov 10, 2026
Merged

gmlewis merged 2 commits into
google:masterfrom
JamBalaya56562:refactor/3644-maintenance-status-request

Conversation

@JamBalaya56562

Copy link
Copy Markdown
Contributor

Updates #3644.

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.

This PR:

  • Renames MaintenanceOptions to SetMaintenanceStatusRequest and passes it by value, removing MaintenanceOptions from both body-allowed-pointer-types and body-allowed-wrong-names in .golangci.yml.
  • Renames CreateMaintenance to SetMaintenanceStatus to match the GitHub docs operation name ("Set the status of maintenance mode") and the existing GetMaintenanceStatus.
  • Removes the enable bool parameter. It duplicated the required enabled body field and was written into the caller's struct (body.Enabled = enable), which also panicked on a nil body.
  • Changes IPExceptionList from omitempty to omitzero, so an empty list can be sent explicitly.
  • Adds the missing error property of the ghes-set-maintenance-response schema to MaintenanceOperationStatus (separate commit).

The request fields match the ghes-set-maintenance-request schema (enabled is the only required property and is already a non-pointer bool).

…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.
@gmlewis gmlewis added NeedsReview PR is awaiting a review before merging. Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s). labels Nov 10, 2026
@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.64%. Comparing base (a58c726) to head (86c3b6e).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmlewis gmlewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @JamBalaya56562!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.

cc: @stevehipwell - @Not-Dhananjay-Mishra

@Not-Dhananjay-Mishra Not-Dhananjay-Mishra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gmlewis gmlewis removed the NeedsReview PR is awaiting a review before merging. label Nov 10, 2026
@gmlewis
gmlewis merged commit 78bbe89 into google:master Nov 10, 2026
15 checks passed
@JamBalaya56562
JamBalaya56562 deleted the refactor/3644-maintenance-status-request branch November 10, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Breaking API Change PR will require a bump to the major version num in next release. Look here to see the change(s).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants