Skip to content

refactor(core): gather facts with cijoe.core.facts.gather() - #227

Merged
safl merged 5 commits into
mainfrom
facts-module
Oct 29, 2026
Merged

safl merged 5 commits into
mainfrom
facts-module

Conversation

@safl

@safl safl commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #225: after #225 merges, delete its branch so GitHub retargets this to main, or retarget it by hand, and merging this then releases 0.9.67.

Fact gathering moves from the core.facts_gather script into cijoe.core.facts, as gather() and SECTIONS, with the OS parsers moved unchanged into cijoe.core.facts.gathering. Importing the parsers from the script no longer works (#224); nothing that uses cijoe did.

A test gathers every section from the machine running the tests, so CI checks Linux and macOS for real; FreeBSD and Windows are checked only through their parsers, on recorded output.

@safl
safl added this pull request to stack #228 October 29, 2026 09:40
@safl safl changed the title refactor(core): gather facts with cijoe.core.facts.gather(), and release 0.9.65 refactor(core): gather facts with cijoe.core.facts.gather(), and release 0.9.66 Oct 29, 2026
@coveralls

coveralls commented Oct 29, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 40872661233

Warning

No base build found for commit c8b40d8 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 62.623%

Details

  • Patch coverage: 20 uncovered changes across 1 file (235 of 255 lines covered, 92.16%).

Uncovered Changes

File Changed Covered %
src/cijoe/core/facts/gathering.py 249 229 91.97%
Total (5 files) 255 235 92.16%

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 3149
Covered Lines: 2026
Line Coverage: 64.34%
Relevant Branches: 1204
Covered Branches: 700
Branch Coverage: 58.14%
Branches in Coverage %: Yes
Coverage Strength: 0.64 hits per line

💛 - Coveralls

@safl safl changed the title refactor(core): gather facts with cijoe.core.facts.gather(), and release 0.9.66 refactor(core): gather facts with cijoe.core.facts.gather() Oct 29, 2026
@safl safl added enhancement New feature or request documentation labels Oct 29, 2026
@safl safl added this to the v1.0.0 milestone Oct 29, 2026
@safl
safl force-pushed the facts-module branch 3 times, most recently from e013a7e to b732176 Compare October 29, 2026 12:04
@safl
safl force-pushed the facts-module branch 2 times, most recently from 7797ea2 to 227f936 Compare October 29, 2026 12:15
Base automatically changed from targets to main October 29, 2026 12:21
safl added 5 commits October 29, 2026 13:22
Gathering lived in the core.facts_gather script, so the CLI, which
gathers the initiator's facts before a run's first step, and any script
wanting to gather facts of its own imported from a script module. It now
lives in cijoe.core.facts, beside the store the facts are written to, as
cijoe.core.facts.gather() and SECTIONS. The OS-specific parsing is kept
apart in cijoe.core.facts.gathering, so the store stays readable, and
the script is left with its arguments and their checks.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Simon A. F. Lund <os@safl.dk>
The parsers of what each OS reports were tested on recorded output, but
nothing ran gather_section() and gather() against a real machine, so the
commands each section runs and the facts they end up as were not checked
together. The test now gathers every section from the machine the tests
run on and checks it against what Python says of that machine: on Linux
every section, with the GPUs, NICs and NVMe controllers among its PCI
functions, and on macOS its OS, kernel and system, with no PCI sections.
FreeBSD and Windows are left to their parsers' tests, as CI has neither.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Simon A. F. Lund <os@safl.dk>
The facts were documented as giving each NVMe namespace an nsid, but on
Linux it is recorded only where the kernel's sysfs or nvme-cli gives it,
and otherwise a namespace has only its devices, paired by name. A GitHub
runner's namespace was one of those, so a task reading the nsid would
fail its step there.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Simon A. F. Lund <os@safl.dk>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Simon A. F. Lund <os@safl.dk>
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Simon A. F. Lund <os@safl.dk>
@safl
safl merged commit b064116 into main Oct 29, 2026
22 checks passed
@safl
safl deleted the facts-module branch October 29, 2026 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants