[nexus] refactor SP ereport processing into nexus-types
#9480
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.
This commit moves the code that processes raw JSON representations of SP ereports from the
ereport_ingesterbackground task tonexus_types::fm::ereport. While a production system will only perform this processing when an ereport is received from a service processor via MGS in theereprot_ingestertask, I'd like to be able to also invoke the same logic with hard-coded example JSON ereports for test purposes. Currently, the test code for diagnosis engines in #9346 implemented its own version of this which was slightly different from the ereport_ingester version, so I've moved it to here so that we can use the same logic when processing test inputs.Note that this change was cherry-picked from #9346, where I had actually written tests that needed to use this logic. I figured it was a small and uncontroversial enough refactor (that makes no functional change whatsoever) to pull it out to merge now, in an attempt to keep that branch from getting even bigger and touching even more files.