Skip to content

Expose a normalized chassis in the submission (New) - #2662

Open
diohe0311 wants to merge 2 commits into
mainfrom
checkbox-2304-expose-normailized-chassis
Open

Expose a normalized chassis in the submission (New)#2662
diohe0311 wants to merge 2 commits into
mainfrom
checkbox-2304-expose-normailized-chassis

Conversation

@diohe0311

Copy link
Copy Markdown
Contributor

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 chassis field so C3 get a normalized chassis without having to re-parse anything. The dmi resource now send a chassis field 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 IndexError in the chassis lookup. That path now guards its bounds and returns Unknown instead of raising error.

Example submission field:

"chassis": "Notebook",

Description

Resolved issues

Resolves https://warthogs.atlassian.net/browse/CHECKBOX-2304

Documentation

Tests

Tested locally

Copilot AI review requested due to automatic review settings July 8, 2026 11:18

Copilot AI 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.

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 chassis field to the submission JSON schema.
  • Emit a chassis attribute from the dmi resource 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.

Comment thread checkbox-ng/plainbox/impl/providers/exporters/data/checkbox.json
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.98%. Comparing base (31b74c6) to head (0d61e76).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
checkbox-ng/checkbox_ng/support/lib/dmi.py 50.00% 1 Missing and 1 partial ⚠️
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     
Flag Coverage Δ
checkbox-ng 76.32% <84.61%> (+<0.01%) ⬆️
provider-resource 46.56% <100.00%> (+0.90%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@diohe0311
diohe0311 requested review from Hook25 and pieqq July 9, 2026 03:53

@Hook25 Hook25 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use system information

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we are getting away from that, call the script from a collector, that will add the information as a system_information

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above, use the system information and update it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants