Skip to content

chore(release): Windows compatibility & CI hardening (2026-05-10)#56

Open
ar7casper wants to merge 11 commits intomasterfrom
release/2026-05-10
Open

chore(release): Windows compatibility & CI hardening (2026-05-10)#56
ar7casper wants to merge 11 commits intomasterfrom
release/2026-05-10

Conversation

@ar7casper
Copy link
Copy Markdown
Collaborator

Summary

Release bundle for 2026-05-10. Combines three independently-reviewed PRs into one RC so the overlapping changes in parsers/{javascript,go}/test_pipeline.py (touched by both #45 and #46) merge cleanly once, instead of forcing a fork rebase.

Scope is Windows compatibility + CI hardening — no behaviour changes for Linux/macOS users beyond the new lint step in python-tests.

Included PRs

  • ci: add ruff lint with F821/F811 rules #44ci: add ruff lint with F821/F811 rules
    Adds a ruff check . step to the python-tests job before pytest. Conservative rule set (F821 undefined name, F811 redefined unused) — both zero-FP runtime-bug catchers. Fixed one real dormant NameError in core/analyzer.py:393 that this lint surfaced (tracker.add_prior_usage(...)get_global_tracker().add_prior_usage(...)).

  • fix: centralize UTF-8 file I/O for Windows compatibility #45fix: centralize UTF-8 file I/O for Windows compatibility
    Adds libs/openant-core/utilities/file_io.py (open_utf8, read_json, write_json, run_utf8) and migrates ~190 bare open() and subprocess.run(..., text=True) call sites to pin UTF-8 explicitly. Four regression scanners in tests/test_file_io.py (bare open(, .read_text/.write_text(, .open(, subprocess.run text=True) prevent reintroduction. Resolves 'charmap' codec can't decode byte ... on cp1252 consoles when scanning code with non-ASCII content (curly quotes, accents, CJK).

  • fix: Windows-compatible path handling in JS/Go parsers #46fix: Windows-compatible path handling in JS/Go parsers
    Three Windows-only failures in the JS/Go parsers:

    1. toPosixPath() helper + a static-scanner test guard so ts-morph doesn't silently drop every file when it gets backslash paths.
    2. --files-from now splits on /\r?\n/ and trims each line so CRLF-terminated lists don't leave a trailing \r.
    3. parsers/{javascript,go}/test_pipeline.py probe sys.stdout.encoding at import time and fall back to OK/FAIL/-> on cp1252 — UTF-8 terminals keep ✓ ✗ →.
      Stale xfail markers in test_js_parser.py and test_go_cli.py removed.

Conflicts resolved during the merge

parsers/javascript/test_pipeline.py and parsers/go/test_pipeline.py were touched by both #45 and #46 (PR #45 swapped subprocess.runrun_utf8; PR #46 added the SYM_OK/SYM_FAIL/SYM_ARROW probe). Combined cleanly — both changes belong.

Changelog

Top entry of CHANGELOG.md updated with [2026-05-10] — Windows compatibility & CI hardening, voicing the user-facing impact of each fix.

Test plan

  • Each constituent PR's test suite green on its own branch (verified per-PR review).
  • Combined pytest libs/openant-core/tests/ green on the merged RC branch (re-runs the regression scanners from fix: centralize UTF-8 file I/O for Windows compatibility #45 over the post-fix: Windows-compatible path handling in JS/Go parsers #46 code).
  • ruff check libs/openant-core/ exits 0 on the merged RC branch.
  • go vet ./... and go build ./... clean (no Go-side changes here, but the test_pipeline.py Python wrappers are exercised by tests/test_go_cli.py).
  • Manual on Windows: run openant scan against a TS repo with non-ASCII content. Expected: non-zero file count from the JS parser, no charmap errors in the pipeline status output, no UnicodeEncodeError on subprocess capture.

Closes the Windows-side of items 2, 8, 9 from #16. Does not close #16 (other items remain — venv binary path on Windows, etc.).

@ar7casper ar7casper force-pushed the release/2026-05-10 branch from b16f27c to db7f79d Compare May 10, 2026 14:06
@ar7casper ar7casper changed the title release(2026-05-10): Windows compatibility & CI hardening (#44, #45, #46) chore(release): Windows compatibility & CI hardening (2026-05-10) May 10, 2026
ar7casper and others added 7 commits May 10, 2026 17:16
The managed venv path was hardcoded to Unix-style bin/python, which fails
on Windows where venvs use Scripts/python.exe. Now detects the correct
path based on runtime.GOOS.

Also adds comprehensive tests for venvPython() to catch platform-specific
path issues.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
ci: add Go unit tests to CI pipeline

Fixed withTempHome() helpers in scan_meta_test.go and mode_test.go to work
on Windows by setting USERPROFILE instead of HOME (which os.UserHomeDir()
respects on Windows but not in test environments).

Also added Go unit tests to the CI pipeline so these tests now run on all
platforms (Ubuntu, macOS, Windows) to catch regressions early.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1. JavaScript and Go parser imports: Added sys.path configuration to
   test_pipeline.py scripts so they can find the utilities module when
   run as subprocesses. The working directory is set but Python's module
   search path wasn't automatically updated.

2. APIStatusError constructor: Updated test_silent_401.py to work with
   the new Anthropic SDK where AuthenticationError requires response and
   body keyword arguments. Mock response now includes headers dict that
   the exception handler expects.

ci: run all Python tests instead of a subset

Changed from running a hardcoded list of test files to running all tests
in the tests/ directory. This ensures all regression tests, Windows path
handling tests, and other critical tests are part of the CI pipeline.

Previously missing from CI:
- test_agreement_filter.py
- test_cwe_tagging.py
- test_dedup.py
- test_diff_filter.py
- test_docker_scaffold.py
- test_evidence_tier.py
- test_file_io.py (important for cross-platform UTF-8 handling)
- test_metadata_plumbing.py
- test_silent_401.py
- test_windows_path_handling.py (important for Windows)

All 117 Python tests now pass with this change.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- README: add Python runtime subsection covering OPENANT_PYTHON, the
  auto-managed venv (Unix bin/python vs Windows Scripts\python.exe),
  and how to rebuild a stale venv.
- CHANGELOG: extend the 2026-05-10 entry with the Windows venv path
  fix, the parser sys.path / Anthropic SDK / run_utf8 / withTempHome
  test fixes, and the new go test ./... CI step + pytest tests/
  switch.
- .gitignore: add _docs/ (local internal notes, not for the public
  repo).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Fork contributions: bug fixes, Windows compatibility, pipeline resilience, and new features

2 participants