Skip to content

feat(bmc-discovery): Record the reset actions each BMC offers - #181

Merged
scotwells merged 2 commits into
feat/manual-inventory-recordsfrom
feat/bmc-discovery-reset-types
Nov 28, 2026
Merged

scotwells merged 2 commits into
feat/manual-inventory-recordsfrom
feat/bmc-discovery-reset-types

Conversation

@scotwells

@scotwells scotwells commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • Discovery records offered actions, both listed inline and from a separate action description
  • Discovery sends only GET requests, and never sends a request under the System's actions
  • Malformed actions, or an unreadable or missing action description, keep the rest of the inventory
  • All GitHub checks pass, including multiplane acceptance

🤖 Generated with Claude Code

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
scotwells force-pushed the feat/bmc-discovery-reset-types branch from 4fa20bf to 099f77a Compare November 28, 2026 19:20
@scotwells scotwells added the multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners label Nov 28, 2026
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 scotwells added multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners and removed multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners labels Nov 28, 2026
@scotwells
scotwells marked this pull request as ready for review November 28, 2026 20:16
@scotwells
scotwells requested a review from a team as a code owner November 28, 2026 20:16
@scotwells
scotwells removed the request for review from a team November 28, 2026 20:16

@ecv ecv 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.

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.

  • Identify shares 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 resetTypes means 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. Reading Identify'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
scotwells merged commit ee6961b into feat/manual-inventory-records Nov 28, 2026
23 of 25 checks passed
@scotwells
scotwells deleted the feat/bmc-discovery-reset-types branch November 28, 2026 20:26
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

multiplane-acceptance Run the multiplane acceptance suites on GitHub-hosted runners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants