Skip to content

feat: skip/sort options, hardened parsing, CI updates — v1.7.2#6

Merged
mousebrains merged 5 commits intomasterfrom
skip_and_sort
Mar 31, 2026
Merged

feat: skip/sort options, hardened parsing, CI updates — v1.7.2#6
mousebrains merged 5 commits intomasterfrom
skip_and_sort

Conversation

@mousebrains
Copy link
Copy Markdown
Owner

Summary

  • New CLI flags: --skipAll/-A, --keepFirst (mutually exclusive with --skipFirst), --sort (none/header_time/lexicographic)
  • Header::parseFileOpenTime() in shared library for cross-project reuse with dbd2netcdf-python
  • 10 audit fixes: LZ4 error handling, header DoS cap, PD0 underflow guard, KnownBytes memcpy/gcount, sensor size validation, bounded repair scan, inf→NaN for repeats, shuffle for float/double, CF global attributes, logging cleanup, MyNetCDF loop fix
  • 4 Python-project backports: sensor byte-size validation, KnownBytes tag hex, inf→NaN repeats, thread_local RNG
  • CI: all GitHub Actions updated to latest (checkout v6, upload-artifact v7, download-artifact v8, cache v5, codecov v6) — fixes Node.js 20 deprecation
  • mkOne.py defaults: --skipAll and --sort header_time
  • decompressTWR -s renamed to -p/--pipe
  • Compiler flags: -Wshadow -Wold-style-cast added, all warnings fixed
  • Man pages updated to v1.7.2 with all missing options
  • Version bumped to 1.7.2

Test plan

  • All 18 ctest tests pass locally (unit + integration)
  • Sort-order verification test verifies chronological output
  • Mutual exclusion test for skip flags
  • Reference ncdump files regenerated for CF global attributes
  • CI: Linux GCC/Clang, macOS, Windows MSVC, containers, Cygwin
  • CI: cppcheck, clang-tidy, CodeQL, sanitizers, coverage

🤖 Generated with Claude Code

mousebrains and others added 4 commits March 30, 2026 21:15
New features (ported from dbd2netcdf-python):
- --skipAll/-A: skip first record of ALL files including the first
- --keepFirst: explicitly keep first records (default behavior)
- --skipFirst/-s, --skipAll, --keepFirst are mutually exclusive
- --sort: sort input files by none (default), header_time, or lexicographic
- Header::parseFileOpenTime() added to shared library for cross-project reuse

Audit fixes:
1. Decompress.C: LZ4 error codes stored as int, check < 0 (was silent fail)
2. Header.C: cap num_ascii_tags at 10000 to prevent DoS
3. PD0.C: validate nBytes >= 4 before subtraction (integer underflow)
4. dbd2netCDF.C: wrap first-pass header scan in try-catch (was inconsistent)
5. Data.C: exponential (1.5x) column growth instead of linear (O(n^2) fix)
6. Cache file sizes in first pass to avoid redundant fs::file_size calls
7. Add fuzz_data and fuzz_decompress fuzz targets
8. Update all man pages to v1.7.1 with all missing options
9. Add -Wshadow -Wold-style-cast; fix all C-style casts
10. MyNetCDF.C: split signed/unsigned chunking loop into forward/reverse

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Audit fixes and Python-project backports:
- KnownBytes: replace union type-punning with memcpy (UB fix), add gcount
  checks for short reads, fix tag error message hex formatting, save errno
- SensorsMap: validate sensor byte-size consistency across files (throws on
  mismatch), check getline returns in sensor skip loop
- Sensors: try-catch in cache load for corrupt lines, thread_local RNG
- Data: bound repair scan to 64KB max, convert inf→NaN for repeated values
- MyNetCDF: enable shuffle filter for float/double (~20-40% better compression),
  add putGlobalAtt method, write CF-1.10 Conventions/history/source attributes
- PD0: replace all std::cerr with logger, remove redundant prints before throws
- pd02netCDF: add logger initialization and --log-level option
- decompressTWR: rename -s to -p/--pipe (avoid conflict with --skipFirst),
  fix tolower cast, enable temp file cleanup
- All tools: fix --verbose to not downgrade log level below --log-level

mkOne.py defaults changed to --skipAll and --sort header_time.
Version bumped to 1.7.2. Man pages and reference files updated.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- actions/checkout: v4 → v6
- actions/upload-artifact: v4 → v7
- actions/download-artifact: v4 → v8
- actions/cache: v4 → v5
- codecov/codecov-action: v5 → v6

Fixes Node.js 20 deprecation warnings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use generator expression $<$<COMPILE_LANGUAGE:CXX>:-Wold-style-cast>
  so lz4.c (C code) is not affected by C++-only warning flag
- Add zlib to conda install for Windows builds (CMake 4.3 FindZLIB
  requires explicit zlib package)

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

codecov bot commented Mar 31, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

Silences Node.js 20 deprecation warnings for conda-incubator/setup-miniconda@v3
and ilammy/msvc-dev-cmd@v1 which have no newer major versions yet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mousebrains mousebrains merged commit 93ae8d9 into master Mar 31, 2026
21 checks passed
@mousebrains mousebrains deleted the skip_and_sort branch March 31, 2026 05:40
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.

1 participant