Skip to content

Add machine manifest to submission JSON (New)#2100

Merged
Hook25 merged 4 commits intomainfrom
add-manifest-info-to-submission-json
Sep 2, 2025
Merged

Add machine manifest to submission JSON (New)#2100
Hook25 merged 4 commits intomainfrom
add-manifest-info-to-submission-json

Conversation

@pieqq
Copy link
Copy Markdown
Collaborator

@pieqq pieqq commented Sep 1, 2025

Description

Add the content of /var/tmp/checkbox-ng/machine-manifest.json (aka the machine manifest) to the submission JSON as part of the system_information gathering mechanism.

This information was already present as part of the submission, but in a very awkward format (Checkbox job output). The following PR adds a machine_manifest section to the system_information section with the JSON information about each manifest defined.

Resolved issues

https://warthogs.atlassian.net/browse/CHECKBOX-2001

Documentation

N/A

Tests

Tested in a venv in the 3 different scenarios:

  1. no manifest file is present, and the test plan run does not require one (for example, the smoke test plan).
  2. no manifest file is present, but it's populated using Checkbox manifest screen (I wanted to make sure the system_information was kicked in after the creation of the machine-manifest.json file and not before!)
  3. a manifest file is already there (I made sure to use a different manifest file from case 2 above to compare the outcome)

In case 1, the machine_manifest section of the system_information section in submission.json looks like this:

    "machine_manifest": {
        "tool_version": "4.2.1.dev44+ga23306767",
        "success": false,
        "outputs": {
            "stdout": "",
            "stderr": "cat: /var/tmp/checkbox-ng/machine-manifest.json: No such file or directory\n",
            "return_code": 1
        }

In cases 2 and 3, it looks something like that:

    "machine_manifest": {
        "tool_version": "4.2.1.dev44+ga23306767",
        "success": true,
        "outputs": {
            "payload": {
                "com.canonical.certification::has_audio_capture": true,
                "com.canonical.certification::has_audio_playback": true,
                "com.canonical.certification::has_bt_obex_support": true,
                "com.canonical.certification::has_camera": true,
                "com.canonical.certification::has_ethernet_adapter": true,
                "com.canonical.certification::has_md_raid": true,
                "com.canonical.certification::has_secure_boot": true,
                "com.canonical.certification::has_touchpad": false,
                "com.canonical.certification::has_usb_dwc3_controller": false,
                "com.canonical.certification::has_usb_storage": false,
                "com.canonical.certification::has_wlan_adapter": true,
                "com.canonical.certification::has_wwan_module": false,
                "com.canonical.certification::need_snapd_snap_update_test": false
            },
            "stderr": ""
        }

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.24%. Comparing base (98beb04) to head (f501c01).
⚠️ Report is 81 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2100   +/-   ##
=======================================
  Coverage   52.23%   52.24%           
=======================================
  Files         391      391           
  Lines       41960    41966    +6     
  Branches     7774     7774           
=======================================
+ Hits        21918    21924    +6     
  Misses      19266    19266           
  Partials      776      776           
Flag Coverage Δ
checkbox-ng 70.92% <100.00%> (+0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@pieqq pieqq force-pushed the add-manifest-info-to-submission-json branch from b12242c to cf4e05f Compare September 1, 2025 19:50
Hook25
Hook25 previously approved these changes Sep 2, 2025
@Hook25
Copy link
Copy Markdown
Collaborator

Hook25 commented Sep 2, 2025

Any reason why you didnt use this:

        WellKnownDirsHelper.manifest_file()

@Hook25 Hook25 merged commit 5ec7183 into main Sep 2, 2025
38 checks passed
@Hook25 Hook25 deleted the add-manifest-info-to-submission-json branch September 2, 2025 12:52
stanley31huang pushed a commit that referenced this pull request Oct 3, 2025
* Add machine manifest to submission JSON

Fix CHECKBOX-2001

* Add unit tests

* Use built-in Checkbox version

* Use existing helper to get manifest file path
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.

2 participants