Finding
scripts/gen-filemap.py (193 lines) contains several pure-logic functions with zero test coverage:
strip_ansi() — ANSI escape removal (regex-based)
guess_interval() — element-to-cadence mapping via substring matching
list_elements() — BST output parsing/filtering
list_all_contents() — tab-indented artifact listing parser (complex state machine)
main() — argparse, filemap assembly, manifest TSV generation
These functions are the backbone of Dakota's OCI layer mapping for chunkah. A bug here silently produces incorrect filemaps, which could cause broken image updates.
The parsing logic (especially list_all_contents) is highly unit-testable by mocking subprocess.run output — no BuildStream installation needed.
Recommendation
- Add
tests/ directory with pytest-based unit tests
- Test
strip_ansi(), guess_interval() with edge cases
- Test
list_all_contents() parser with sample BST output (fixture-based)
- Add a CI workflow to run tests on PR/push
- Target ≥80% coverage for the parsing functions
Priority
- Impact: high (incorrect filemap → broken image updates)
- Effort: low (pure logic, no external deps needed for testing)
Filed by quality agent (hold-gated mode)
Dakota · issue pipeline
▶ triage needs kind/ + area/ then /approve
· discussing —
· queued —
· claimed —
· done —
area: — priority: —
maintainer: set kind/ + area/ labels, then comment /approve
reporter: answer questions; add repro steps if a bug
Finding
scripts/gen-filemap.py(193 lines) contains several pure-logic functions with zero test coverage:strip_ansi()— ANSI escape removal (regex-based)guess_interval()— element-to-cadence mapping via substring matchinglist_elements()— BST output parsing/filteringlist_all_contents()— tab-indented artifact listing parser (complex state machine)main()— argparse, filemap assembly, manifest TSV generationThese functions are the backbone of Dakota's OCI layer mapping for chunkah. A bug here silently produces incorrect filemaps, which could cause broken image updates.
The parsing logic (especially
list_all_contents) is highly unit-testable by mockingsubprocess.runoutput — no BuildStream installation needed.Recommendation
tests/directory with pytest-based unit testsstrip_ansi(),guess_interval()with edge caseslist_all_contents()parser with sample BST output (fixture-based)Priority
Filed by quality agent (hold-gated mode)
Dakota · issue pipeline
area: — priority: —
maintainer: set kind/ + area/ labels, then comment /approve
reporter: answer questions; add repro steps if a bug