Skip to content

fix(tests): pin LF line endings in cached Codex source-pin fixture - #3561

Merged
Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-fix-main-ci-1111
Nov 11, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-fix-main-ci-1111

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fixes the deterministic Windows failure that keeps CI/CD Pipeline red on
main. tests/unit/install/test_cached_codex_source_pin.py (from #3407) writes
its fixture package with Path.write_text(); on Windows \n becomes \r\n,
so compute_package_hash() returns sha256:b6500037... instead of the pinned
sha256:4680f02c... and the fixture assertion fails for all 5 parametrizations.
The fixture files are now written with newline="\n", making the bytes and the
hash platform independent. The module is also marked windows_compat so the PR-time Windows
Compatibility Gate exercises it (the gate selects by marker, which is why the
regression only surfaced post-merge). Test-only change; no product code touched.

Failing main runs (Windows Build & Test job only): 43024070124,
43024578103, 43032218648, 43032236928, 43036634830, 43036737902.

Issue and approved scope

Issue: Fixes #3560

Human scope-approval comment: scope approved by Daniel Meppiel (@danielmeppiel)'s explicit
session mandate ("loop until the CI pipelines in main are fixed, and that the
release pipeline is passing on a dry run"), recorded in #3560. Review contact:
Daniel Meppiel (@danielmeppiel).

Does this PR complete the issue, or what remains? Completes it.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally

  • All existing tests pass

  • Added tests for new functionality (if applicable)

  • .venv/bin/pytest tests/unit/install/test_cached_codex_source_pin.py -q -> 5 passed (macOS).

  • Root-cause repro: writing the same fixture with newline="\r\n" and hashing
    with compute_package_hash yields sha256:b65000370e9f..., exactly the
    Windows CI value; newline="\n" yields the pinned sha256:4680f02c21d1....

  • ruff check / ruff format --check on the CI-mirror paths -> clean.

  • .venv/bin/pytest -m windows_compat tests/unit/install/test_cached_codex_source_pin.py -q -> 5 passed.

  • Windows coverage: this PR's Windows Compatibility Gate job now selects the test.

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

On Windows, Path.write_text translates "\n" to "\r\n", so the fixture
package hashed to sha256:b6500037... instead of the pinned
sha256:4680f02c... and every parametrization of
test_frozen_global_install_from_warm_cache_uses_locked_source_pin failed
on the windows-latest Build & Test job on main. Write the fixture files
with newline="\n" so the bytes and the content hash are platform
independent.

Refs #3560

Co-authored-by: Copilot App <[email protected]>

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.

🟡 Changes recommended

All five regression cases are excluded from the pull-request Windows gate because the module lacks the windows_compat marker, and the release workflow provides no pre-merge coverage.

1 open issue
What changed in this PR

This test-only PR addresses #3560 by making the cached Codex source-pin fixture’s bytes consistent across platforms, preventing Windows line-ending conversion from breaking its pinned hash assertion.

Changes:

  • Explicitly writes LF line endings for the skill, plugin metadata, and cache-pin fixture files.
  • Preserves the expected package hash and leaves production code unchanged.
File Description
tests/​unit/​install/​test_cached_codex_source_pin.py Pins fixture writes to LF for platform-independent content hashing.

Review effort: Balanced

)
(package / "SKILL.md").write_text(_SKILL_MD, encoding="utf-8")
# newline="\n" keeps the bytes (and the pinned content hash) identical on Windows.
(package / "SKILL.md").write_text(_SKILL_MD, encoding="utf-8", newline="\n")
The CRLF hash regression only surfaced post-merge because the PR-time
Windows gate selects tests by the windows_compat marker. Mark this module
so the LF-pinned fixture is exercised on windows-latest before merge.

Refs #3560

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 00cc47b into main Nov 11, 2026
38 of 42 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-fix-main-ci-1111 branch November 11, 2026 18:01
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.

CI: main pipeline failing on Windows Build & Test (test_cached_codex_source_pin CRLF hash)

2 participants