Expose a normalized chassis in the submission (New) - #2662
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends Checkbox’s submission output to include a normalized SMBIOS chassis type (as a top-level chassis field) by propagating the CHASSIS DMI resource value into the JSON submission exporter, and updates the chassis type mapping to match newer SMBIOS spec values while avoiding out-of-range crashes.
Changes:
- Add optional
chassisfield to the submission JSON schema. - Emit a
chassisattribute from thedmiresource output for CHASSIS devices and pull it into the submission template. - Update SMBIOS chassis type lookup to include newer types and guard against out-of-range indices (returning
"Unknown").
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| submission-schema/schema.json | Adds optional chassis property to the submission schema. |
| providers/resource/bin/dmi_resource.py | Prints a chassis field for CHASSIS DMI devices. |
| providers/resource/tests/test_dmi_resource.py | Adds coverage ensuring chassis is emitted only for CHASSIS devices and is mapped. |
| checkbox-ng/plainbox/impl/providers/exporters/data/checkbox.json | Pulls chassis from the DMI resource into the submission payload. |
| checkbox-ng/checkbox_ng/support/lib/dmi.py | Updates chassis type list to SMBIOS 3.9.0 and prevents IndexError on unknown/new types. |
| checkbox-ng/checkbox_ng/support/parsers/tests/test_dmidecode.py | Adds tests for chassis type bounds handling and non-numeric values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2662 +/- ##
==========================================
+ Coverage 59.96% 59.98% +0.02%
==========================================
Files 487 487
Lines 48909 48919 +10
Branches 8764 8764
==========================================
+ Hits 29327 29344 +17
+ Misses 18657 18649 -8
- Partials 925 926 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Hook25
left a comment
There was a problem hiding this comment.
Please use system information
There was a problem hiding this comment.
No, we are getting away from that, call the script from a collector, that will add the information as a system_information
There was a problem hiding this comment.
See above, use the system information and update it!
Checkbox already normalizes the SMBIOS chassis types, but it was only used in resource and never recorded into the submission. This exposes it as a
chassisfield so C3 get a normalized chassis without having to re-parse anything. Thedmiresource now send achassisfield for CHASSIS devices and the submission template pulls it through.The chassis list is also updated based on the latest SMBIOS spec, which adds the 7 new types. I've also fix a potential crash where a machine reporting one of the newer types would hit an out-of-range
IndexErrorin the chassis lookup. That path now guards its bounds and returnsUnknowninstead of raising error.Example submission field:
Description
Resolved issues
Resolves https://warthogs.atlassian.net/browse/CHECKBOX-2304
Documentation
Tests
Tested locally