Skip to content

fix(pipeline): Windows compat — nocase matching, CRLF normalization, SIGKILL#96

Merged
gregpriday merged 1 commit into
developfrom
feature/issue-87-windows-compat-gaps-case
Feb 26, 2026
Merged

fix(pipeline): Windows compat — nocase matching, CRLF normalization, SIGKILL#96
gregpriday merged 1 commit into
developfrom
feature/issue-87-windows-compat-gaps-case

Conversation

@gregpriday
Copy link
Copy Markdown
Owner

Summary

Addresses three independent Windows compatibility gaps identified in issue #87.

Closes #87

Changes Made

A) Case-insensitive pattern matching (nocase)

  • Added nocase: process.platform === 'win32' to all minimatch calls in ProfileFilterStage, FileLoadingStage, and SecretsGuardStage
  • AlwaysIncludeStage already had this option and served as the reference implementation
  • On Windows, files named README.MD now correctly match patterns like README.md

B) CRLF normalization

  • Added .replace(/\r\n/g, '\n').replace(/\r/g, '\n') after UTF-8 reads in FileLoadingStage and fileLoader.js
  • Ensures output never contains \r\n or bare \r, matching git's core.autocrlf behaviour
  • Only applied to text file reads; binary paths are unaffected

C) Cross-platform process termination

  • Replaced child.kill('SIGKILL') with child.kill() in GitleaksAdapter timeout handler
  • No-arg kill() sends SIGTERM on POSIX and calls TerminateProcess on Windows — the documented cross-platform behaviour

Tests

  • New: tests/unit/pipeline/stages/ProfileFilterStage.test.js — nocase win32/linux behaviour
  • New: tests/unit/pipeline/stages/FileLoadingStage.test.js — CRLF normalization (7 cases) + nocase
  • Extended: tests/unit/pipeline/stages/SecretsGuardStage.test.js — nocase exclusion win32/linux
  • Updated: tests/unit/services/GitleaksAdapter.test.js — kill assertion updated to no-arg

…SIGKILL

- Add `nocase: process.platform === 'win32'` to all minimatch calls in
  ProfileFilterStage, FileLoadingStage, and SecretsGuardStage (AlwaysIncludeStage
  already had this; it served as the reference)
- Normalize CRLF and lone CR to LF in FileLoadingStage text reads and
  fileLoader utility so output is deterministic across platforms
- Replace child.kill('SIGKILL') with child.kill() in GitleaksAdapter timeout
  handler; no-arg kill sends SIGTERM on POSIX and calls TerminateProcess on
  Windows — the documented cross-platform behaviour
- Add unit tests: ProfileFilterStage (nocase win32/linux), FileLoadingStage
  (CRLF normalization + edge cases + nocase), SecretsGuardStage (nocase
  win32/linux), GitleaksAdapter (updated kill assertion)
@gregpriday gregpriday merged commit 8be5f31 into develop Feb 26, 2026
11 of 15 checks passed
@gregpriday gregpriday deleted the feature/issue-87-windows-compat-gaps-case branch February 26, 2026 03:20
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.

Windows compat gaps: case-insensitive matching, CRLF file content, and SIGKILL on GitleaksAdapter

1 participant