Skip to content

Fix Windows CRLF handling in install safety tests#1717

Merged
danielmeppiel merged 1 commit into
mainfrom
danielmeppiel/friendly-dollop
Jun 9, 2026
Merged

Fix Windows CRLF handling in install safety tests#1717
danielmeppiel merged 1 commit into
mainfrom
danielmeppiel/friendly-dollop

Conversation

@danielmeppiel

Copy link
Copy Markdown
Collaborator

Fixes the Windows-only CI failure in install safety tests by normalizing CRLF line endings before extracting the shell validator block.

What changed

  • Added a small reader helper in tests/unit/install/test_install_safety.py to normalize \r\n and \r to \n before extracting the shell block.
  • Updated the test extraction and sentinel assertions to use that normalized reader.

Why

GitHub Actions on Windows checks out files with CRLF line endings. The test sources the extracted shell block into bash; stray carriage returns caused syntax errors and returned exit code 1 instead of the expected safety-validator exit codes.

Validation

  • uv run --extra dev python -m pytest tests/unit/install/test_install_safety.py -q
  • uv run --extra dev ruff check tests/unit/install/test_install_safety.py
  • uv run --extra dev ruff format --check tests/unit/install/test_install_safety.py

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 9, 2026 15:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a Windows-only CI failure in the install.sh safety validation unit tests by normalizing CRLF/CR line endings before extracting and sourcing the sentinel-bounded shell block.

Changes:

  • Added _read_install_sh() helper that normalizes \r\n and \r to \n.
  • Switched validator extraction and sentinel-invariant tests to use the normalized reader.
Show a summary per file
File Description
tests/unit/install/test_install_safety.py Normalize install.sh line endings before sentinel extraction to avoid CR-related bash syntax errors on Windows checkouts.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 1

Comment on lines 48 to 52
"""Extract the apm_lib_dir_validate() block from install.sh and return the
source text of the function plus a small driver wrapper. Tests source the
result into a fresh shell to invoke the function in isolation -- no network
and no real installation side effects.
"""
@danielmeppiel danielmeppiel merged commit 4c917cf into main Jun 9, 2026
21 checks passed
@danielmeppiel danielmeppiel deleted the danielmeppiel/friendly-dollop branch June 9, 2026 15:28
danielmeppiel added a commit that referenced this pull request Jun 9, 2026
Merge origin/main (PRs #1714, #1717, #1718, #1719) into the release
branch. Only #1718 is user-facing (src/apm_cli/install drift +
target-complete lockfile manifest); its entry was authored on main and
now sits in the [0.19.0] Fixed block with the PR number appended.
#1714, #1717, #1719 are maintainer-toolkit / test-only and dropped per
the entry-sanitizer DROP list. Lint mirror green.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
danielmeppiel added a commit that referenced this pull request Jun 9, 2026
* chore: release v0.19.0

Bump pyproject.toml + uv.lock to 0.19.0 and move the [Unreleased]
CHANGELOG block to [0.19.0] - 2026-06-09 with one 'so what' entry per
merged PR. Lint mirror green locally (ruff check + format, pylint
R0801, auth-signals).

Post-merge: tag v0.19.0 to trigger the release workflow.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* chore: fold #1718 into v0.19.0 changelog after main merge

Merge origin/main (PRs #1714, #1717, #1718, #1719) into the release
branch. Only #1718 is user-facing (src/apm_cli/install drift +
target-complete lockfile manifest); its entry was authored on main and
now sits in the [0.19.0] Fixed block with the PR number appended.
#1714, #1717, #1719 are maintainer-toolkit / test-only and dropped per
the entry-sanitizer DROP list. Lint mirror green.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(self-check): reconcile stale apm-review-panel SKILL.md hash in lockfile

The APM Self-Check (apm audit --ci) content-integrity gate failed:
apm.lock.yaml recorded a stale deployed_file_hashes entry
(fe6a73...) for .agents/skills/apm-review-panel/SKILL.md while the
deployed file and its packages/** source are both fc63e25... #1714
updated the skill content but deliberately left apm.lock.yaml
untouched; #1718 then turned the drift gate live (dropped --no-drift),
exposing the mismatch. apm install reconciles the recorded hash (and
refreshes apm_version to 0.19.0). All 9 audit checks now pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: danielmeppiel <danielmeppiel@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
sergio-sisternes-epam pushed a commit that referenced this pull request Jun 9, 2026
…e integrity)

Sync with main through v0.19.0 (#1715, #1714, #1718, #1719, #1717).

Conflicts resolved:
- CHANGELOG.md: main cut the v0.19.0 release, moving prior Unreleased
  entries into a dated section. Took main's restructure; relocated the
  #1681 "Tightened Stage 2 code-complexity thresholds" entry to the new
  ## [Unreleased] section (released sections stay immutable per Keep a
  Changelog). Took main's #1702/#1710 close-ref for the lockfile entry.
- src/apm_cli/install/services.py: #1718 added per-file skill-bundle
  integrity recording inline at a site my refactor had extracted into
  _log_skill_result. Kept the new _skill_bundle_file_entries helper in
  services.py (sibling of _deployed_path_entry); dropped main's duplicate
  inline _log_hook_display_payloads (already relocated to
  services_integrate.py and re-exported in my #1700 port); accepted the
  _log_skill_result delegator at the call site.
- src/apm_cli/install/services_integrate.py: ported #1718's
  deployed.extend(_skill_bundle_file_entries(tp, ...)) into
  _log_skill_result's deployed-path loop (deployed aliases
  result["deployed_files"]), with a lazy import of the helper.

Shadow gate: no markers, all src <=800 lines, ruff check + format clean,
pylint R0801 EXIT=0, auth-signals clean; 11144 tests pass across the
install/integration suites plus the #1718, #1700, and #1709 targeted sets.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.

2 participants