Feature/ab#2111 add shutdown inhibit endpoint#27
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a shutdown inhibition feature to the HCU subsystem, exposing new HTTP endpoints to inhibit an in-progress (or future) HCU-triggered shutdown and to query shutdown status. This is supported by introducing a dedicated shutdown timer model and reorganizing/refactoring HCU-related tests.
Changes:
- Add
ShutdownModelfor tracking shutdown timing, inhibition, and remaining time. - Extend HCU HTTP API with
/shutdown/inhibit/{seconds}and/shutdown/status, plus new API tests usinghttpx. - Refactor/move existing HCU monitor tests into a dedicated
tests/hcu/package with shared fixtures.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_hcu_monitor.py | Removes old top-level HCU monitor tests (moved/refactored under tests/hcu/). |
| tests/hcu/test_shutdown.py | Adds unit tests for the new shutdown timing/inhibition model. |
| tests/hcu/test_hcu_monitor.py | Adds refactored async integration tests for shutdown/resume behavior. |
| tests/hcu/test_hcu_api.py | Adds FastAPI route tests for shutdown inhibit and status endpoints. |
| tests/hcu/conftest.py | Introduces shared HCU test fixtures (serial socket, default skill, tmp file). |
| tests/hcu/init.py | Establishes tests.hcu as a package. |
| pyproject.toml | Adds httpx to dev dependencies for ASGI/API testing. |
| poetry.lock | Updates lockfile to include httpx and dependency group metadata changes. |
| msu_manager/hcu/skill.py | Adds shutdown inhibit and shutdown status endpoints to the HCU API routes. |
| msu_manager/hcu/shutdown.py | Introduces ShutdownModel and ShutdownError. |
| msu_manager/hcu/controller.py | Integrates ShutdownModel into shutdown scheduling/cancel flow and exposes status/inhibit helpers. |
| msu_manager/config.py | Adds shutdown_inhibit_max_s configuration setting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
This adds an http endpoint to inhibit HCU-triggered shutdowns (e.g. to complete a maintenance task).
Also adds HTTP API tests and refactors existing hcu related tests.
Motivation and Context
How has this been tested?
Screenshots (if appropriate):
Types of changes
Checklist: