fix(parser): parse Dell iDRAC10 TSR inventory from captured Redfish walk

iDRAC10-generation TSR bundles no longer ship sysinfo_dcim_view.xml /
sysinfo_dcim_softwareidentity.xml, so the dell parser produced events but
no hardware inventory for them. These bundles instead carry
redfishidracwalk.tar.gz, a captured dump of the iDRAC's own Redfish tree.

Add vendors/redfishtree, a shared helper that reconstructs a path->document
map from a tar.gz/zip-packaged Redfish walk (vendor-independent detection:
path hint + /redfish/v1 service-root/Systems/Chassis structural check) and
replays it through the existing collector.ReplayRedfishFromRawPayloads.
vendors/dell uses it to enrich DCIM-XML-derived data (append-only, existing
dedupe passes resolve overlaps). Also register vendors/redfishwalk, a
low-confidence fallback VendorParser using the same helpers, so any other
vendor that starts shipping this kind of raw Redfish walk is picked up
automatically without a dedicated parser.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Mikhail Chusavitin
2026-08-11 10:49:32 +03:00
co-authored by Claude Sonnet 5
parent 6e1a8232ec
commit f599215760
9 changed files with 693 additions and 1 deletions
+41
View File
@@ -1229,3 +1229,44 @@ later content-free duplicate cannot blank out an earlier real reading.
Revisit only if a real archive needs that specific data and asset.json does not cover it.
- Any future component/*.txt GETALL consumer should reuse `parseDBusGetAllObjects` rather than
re-implementing block splitting or field extraction.
---
## ADL-048 — Dell iDRAC10 TSR bundles ship inventory as a raw Redfish walk, not DCIM-XML
**Date:** 2026-08-11
**Context:** A TSR from a PowerEdge R7715 (`TSR20260721231613_1TVFYL4.zip`, iDRAC10-generation
firmware) parsed as `dell` and showed events but no hardware inventory. The `dell` parser
(`internal/parser/vendors/dell/parser.go`) built the entire `Hardware` tree from three files inside
the `.pl.zip`: `sysinfo_dcim_view.xml`, `sysinfo_dcim_softwareidentity.xml`, `sysinfo_cim_sensor.xml`.
This iDRAC generation does not produce those files at all; `tsr/hardware/sysinfo/inventory/` instead
contains `redfishidracwalk.tar.gz` — a captured crawl of the iDRAC's own Redfish tree (one JSON
document per resource, stored as `<url-path>/index.json`, e.g.
`redfish/v1/Systems/System.Embedded.1/index.json`). `Hardware` therefore stayed effectively empty
(only `BoardInfo`/one iDRAC firmware entry from `metadata.json`), while `curr_lclog.xml` still
populated `Events` normally — hence "shows only logs".
**Decision:** Added `internal/parser/vendors/redfishtree` (shared, non-registering helper package)
that reconstructs a `path -> document` tree from a tar.gz- or zip-packaged Redfish walk and feeds it
to the existing `collector.ReplayRedfishFromRawPayloads` replay machinery (previously only used for
live BMC collection and reanimator import). Detection is two-step and vendor-independent: (1) a path
hint — an archive member path containing `redfish` and ending in `.tar.gz`/`.tgz`/`.zip`; (2)
structural confirmation — the unpacked tree must contain a document whose own `@odata.id` is exactly
`/redfish/v1`, plus a `/redfish/v1/Systems` or `/redfish/v1/Chassis` collection. The tree is keyed by
each document's own `@odata.id` (not the on-disk directory name), since some resource names are
URL-encoded on disk (e.g. `Assembly%23`) but not in the JSON payload.
`internal/parser/vendors/dell/redfish_walk.go` uses this to enrich the DCIM-XML-derived result:
append-only merge (`mergeRedfishReplay`) into the same slices the existing `dedupeX` calls already
resolve, so DCIM-derived entries (appended first) win over duplicates from the replay, and the
replay only fills in what DCIM-XML didn't provide. Also registered a new low-confidence fallback
vendor parser, `internal/parser/vendors/redfishwalk` (`Vendor()` = `redfish_walk`, confidence 35 —
above the `generic` fallback's 15, below every dedicated vendor parser), using the same
`redfishtree` helpers directly as its `Parse()`, so any other vendor that starts shipping this kind
of raw Redfish walk is picked up automatically without a dedicated parser.
**Consequences:**
- Dell iDRAC10 TSR bundles now populate full hardware inventory (CPUs, memory, storage, PCIe, NICs,
PSUs, firmware) from `redfishidracwalk.tar.gz` when DCIM-XML is absent, verified end-to-end on
the R7715 archive above (1 CPU, 2 DIMMs, 2 storage, 2 PCIe, 1 NIC, 2 PSU, 19 firmware entries).
- Any future vendor parser that wants to consume a captured Redfish walk as enrichment should reuse
`redfishtree.FindCandidateArchives` + `redfishtree.Build`, not re-implement tar/zip walking.
- `redfishwalk` is a genuine fallback: it only wins `Detect()` when no dedicated vendor parser
scores higher on the same archive, per the registry's highest-confidence-wins rule.