Skip to content

Collect more system info#425

Draft
asmacdo wants to merge 2 commits intocon:mainfrom
asmacdo:add-uname-to-info-json
Draft

Collect more system info#425
asmacdo wants to merge 2 commits intocon:mainfrom
asmacdo:add-uname-to-info-json

Conversation

@asmacdo
Copy link
Copy Markdown
Member

@asmacdo asmacdo commented May 4, 2026

Summary

Adds OS and Linux-distribution provenance to the system block of info.json, so downstream consumers (plot, gallery, future tooling) can tell what host a run came from without parsing free-text strings.

Schema bumped 0.2.2 → 0.2.3. Old logs read by con-duct ls are backfilled with empty strings for the new fields, so consumers can rely on the fields being present.

What's added (14 fields, all under system)

From platform.uname():
os_name, os_release, os_version, arch, processor

From platform.freedesktop_os_release() (Python 3.10+; reads /etc/os-release, falls back to "" on systems without the file):
distro_id, distro_id_like, distro_name, distro_version, distro_version_id, distro_codename, distro_variant_id, distro_pretty_name, distro_build_id

Sample system block:

 'system': {'arch': 'x86_64',
            'cpu_total': 20,
            'distro_build_id': '',
            'distro_codename': '',
            'distro_id': 'fedora',
            'distro_id_like': '',
            'distro_name': 'Fedora Linux',
            'distro_pretty_name': 'Fedora Linux 42 (Workstation Edition)',
            'distro_variant_id': 'workstation',
            'distro_version': '42 (Workstation Edition)',
            'distro_version_id': '42',
            'hostname': 'fancy',
            'memory_total': 33330028544,
            'os_name': 'Linux',
            'os_release': '6.19.12-100.fc42.x86_64',
            'os_version': '#1 SMP PREEMPT_DYNAMIC Sun Apr 12 15:27:03 UTC 2026',
            'processor': '',
            'uid': 1000,
            'user': 'austin'},

Why so many fields?

The motivation here is provenance (because everything matters), not any single consumer's branching needs. Plot logic flagged the gap (it needs to branch between Linux and macOS for pcpu), but capturing the standard os-release fields now means future readers — gallery, repro tooling, archeology — can answer questions we haven't anticipated (variant, codename, build id) without us having to re-collect.

Compatibility

  • Schema version bumped to 0.2.3.
  • ls.ensure_compliant_schema migrates old logs by adding empty strings for all 14 fields, matching the convention set by the 0.2.1 (working_directory) and 0.2.2 (message) migrations.
  • LS_FIELD_CHOICES extended so the new fields are queryable via con-duct ls -F and --eval-filter.
  • POSIX-only, matching the existing constraint imposed by os.sysconf calls in get_system_info(). On systems without /etc/os-release (macOS), the nine distro_* fields fall back to "".

asmacdo and others added 2 commits May 4, 2026 17:32
Adds 14 fields to the system block of info.json: 5 from
platform.uname() (os_name, os_release, os_version, arch,
processor) and 9 from platform.freedesktop_os_release()
(distro_id, distro_id_like, distro_name, distro_version,
distro_version_id, distro_codename, distro_variant_id,
distro_pretty_name, distro_build_id). Bumps schema_version
to 0.2.3.

Distro fields fall back to empty strings on systems without
/etc/os-release (e.g. macOS).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a 0.2.3 migration step to ensure_compliant_schema that fills
the 14 new system.* provenance fields with empty strings when
reading info.json files written by older duct versions, so ls and
related consumers can rely on the fields being present.

Updates test_ls fixtures to include a "system" block (which has
existed in info.json since before MINIMUM_SCHEMA_VERSION) so the
new migration can run against them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.86%. Comparing base (2cd8fb9) to head (3b05d93).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #425      +/-   ##
==========================================
- Coverage   91.87%   91.86%   -0.02%     
==========================================
  Files          15       15              
  Lines        1120     1143      +23     
  Branches      139      141       +2     
==========================================
+ Hits         1029     1050      +21     
- Misses         69       70       +1     
- Partials       22       23       +1     

☔ 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.

@asmacdo asmacdo added the semver-minor Increment the minor version when merged label May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-minor Increment the minor version when merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant