[Server] Performance results replace server board configuration with server metrics
Description
Meshery's local performance-result conversion stores and returns serverMetrics in the serverBoardConfig field, discarding the actual board configuration in both directions.
Current Behavior
When serverMetrics and serverBoardConfig contain different values, conversion to the database representation writes the metrics value into both columns. Conversion back to the API model again reads ServerMetrics for both fields.
Expected Behavior
serverBoardConfig should round-trip independently from serverMetrics, as defined by the distinct fields in the result contract.
Steps to Reproduce
- Construct a
MesheryResultwithserverMetrics={"source":"metrics"}andserverBoardConfig={"source":"board"}. - Convert it with
convertMesheryResultToLocalRepresentation. - Observe that
ServerBoardConfigcontains the metrics map. - Repeat in the reverse direction and observe the same substitution.
Evidence
$ go test ./server/models -run '^TestReproMesheryResultPreservesServerBoardConfig$' -count=1
write conversion stored map[string]interface {}{"source":"metrics"} as serverBoardConfig, want map[string]interface {}{"source":"board"}
FAILRoot Cause
Both conversion functions select the wrong source field:
convertLocalRepresentationToMesheryResultassignslocal.ServerMetricstoServerBoardConfig.convertMesheryResultToLocalRepresentationassignsmr.ServerMetricstoServerBoardConfig.
Affected Components
- Meshery Server
- Performance result persistence
- Performance result API responses
Validation
Executed on master commit 5b75615243e92b088b4ebf6e7bff82d6f60e5462:
go test ./server/models -run '^TestReproMesheryResultPreservesServerBoardConfig$' -count=1Result: deterministic failure; the board config is replaced with metrics during write conversion.
Acceptance Criteria
- Both conversions map
ServerBoardConfigfrom/to the matching field. - Distinct metrics and board-config values survive a database round trip.
- A regression test asserts both directions.
References
Source: meshery/meshery