Repository navigation
feat(bmc-discovery): Record the reset actions each BMC offers - #181
Merged
scotwells merged 2 commits intoNov 28, 2026
Merged
Conversation
This was referenced Nov 25, 2026
Power admission must refuse an action the server does not offer before anything is sent. Discovery now records the ComputerSystem.Reset types each System advertises, inline or from the System's own ActionInfo, in status.discovery.inventory.systems[].resetTypes. It reads them with GETs and never invokes the action. A reset target or ActionInfo off the System records none. Discover and Inventory share one reset-type reader, so both parse ActionInfo the same way. An ActionInfo that cannot be read records no reset types and keeps the rest of the inventory, so one broken link never costs a Device its discovery. Ported from the power prototype in #175, without its worker client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scotwells
force-pushed
the
feat/bmc-discovery-reset-types
branch
from
November 28, 2026 19:20
4fa20bf to
099f77a
Compare
The System document decoded its Actions strictly, so one off-schema reset annotation failed the whole inventory read. Actions now decode on their own, and a malformed value records no reset types. An ActionInfo under the System's Actions is no longer read, so discovery never sends a request there. Tests cover the guarded ActionInfo paths, ActionInfo server errors and rejected credentials, and the recorded reset type bounds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scotwells
marked this pull request as ready for review
November 28, 2026 20:16
ecv
approved these changes
Nov 28, 2026
ecv
left a comment
Contributor
There was a problem hiding this comment.
Approve.
Discovery now records the reset actions each BMC offers, read the same way the power path reads them (inline ResetType@Redfish.AllowableValues, else the System's own ActionInfo), through one shared GET-only helper. Types, CRD limits and the doc agree, and every check at this head is green.
Identifyshares the helper, so the power path also gains the ActionInfo path guard; stricter, no behaviour lost, and the existing Identify tests cover the refactor.- An omitted
resetTypesmeans both "the BMC offers none" and "the ActionInfo read failed" (404, timeout, malformed), and status cannot tell them apart. - The recorded list is normalized and capped at 16, so it can differ from what the BMC offers.
Follow-ups:
- Before the power stack consumes
resetTypes, decide how an omitted list is treated. The doc says power operations will refuse an action the server does not offer; read literally, a transient ActionInfo failure becomes a refused power-on until the next discovery pass. ReadingIdentify's live list at action time avoids both that and staleness. - Surface a failed ActionInfo read (condition or event) so an empty list can be told apart from a BMC that offers none.
scotwells
merged commit Nov 28, 2026
ee6961b
into
feat/manual-inventory-records
23 of 25 checks passed
4 tasks
scotwells
added a commit
that referenced
this pull request
Nov 28, 2026
An empty resetTypes list cannot be told from an omitted one: the field is omitempty, and pruning, apply and other clients do not keep an empty list reliably. resetTypes goes back to #181's tag unchanged. A per-System resetTypesObserved boolean is now true only when this read got an advertised list, inline or from the ActionInfo, even an empty one. A failed read, a System that advertises no list, a list of only blanks or more than 16 types leaves it absent, so the types are unknown. ResetTypesRead keeps explaining failures for operators. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Related to #173. Related to #179.
Power operations must refuse an action a server does not offer before anything reaches it. BMC discovery now records the reset actions each server offers, using read requests only, and never invokes one. Malformed action data, or an action description it cannot read, records none and keeps the rest of the server's discovery. A rejected credential still fails the read. This is live wherever discovery runs. Nothing reads the new field until the power operation kind in #179 lands.
Important
The Device CRD in Milo must update before the new discovery image rolls out. If the old schema is still in place, Milo silently drops the new field, and power would later see no offered actions.
#171 edits the same discovery code. Whichever of the two lands second resolves the conflict.
🤖 Generated with Claude Code