[PR #7055] [CLOSED] fix(build): normalize release dependency patch directory for git apply #7608

Closed
opened 2026-11-03 13:39:05 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7055
Author: @viniciusdsandrade
Created: 10/25/2026
Status: ❌ Closed

Base: main ← Head: fix/7050-release-please-patch-directory-separator


📝 Commits (1)

  • 81925f8 fix(build): normalize release dependency patch directory for git apply

📊 Changes

1 file changed (+5 additions, -1 deletions)

View changed files

📝 scripts/lib/release-proposal.mjs (+5 -1)

📄 Description

Summary

applyReleasePleasePatch passed relative(project, directory) directly to git apply --directory. On Windows hosts with Git default core.protectNTFS, relative() produces backslashes (for example node_modules\release-please), which Git rejects as an invalid path component with exit code 128. This caused check() to rethrow instead of detecting whether the patch is already applied, causing scripts/prepare.mjs and npm ci to fail immediately. Normalizing the relative directory path to forward slashes allows Git to prepend --directory cleanly across platforms.

Fixes #7050

Problem and expected behavior

Smallest trigger: run npm ci on Windows from a source checkout, or run node -e "import('./scripts/lib/release-proposal.mjs').then(m => m.applyReleasePleasePatch())".

Observed before this change: relative(project, directory) yields node_modules\release-please. git apply --check exits with code 128 (error: invalid path 'node_modules\release-please/build/src/github.js'). Because exit code 128 is not code 1, check() rethrows the failure, aborting prepare during dependency install.

Expected behavior: the patch check runs cleanly and applies the patch (or detects it as already applied), completing prepare idempotently on Windows as it does on Linux and macOS.

Change and scope

  • scripts/lib/release-proposal.mjs: normalize relative(project, directory) to forward slashes with .replaceAll("\\", "/") when constructing --directory arguments for git apply.

Intentionally not included: changes to patch files, git config overrides, or build scripts. No speculative complexity was added.

Follow the contribution scope.
Unresolved scope, authority, side effects, or required verification block
integration. Link the required maintainer scope decision for new providers or
capabilities involving target execution, injection, mutation, or protection
recovery; ordinary fixes within existing boundaries may state "not applicable".
Draft PRs may leave the scope decision pending and the readiness and merge checklists
unchecked. Maintainers can help resolve open questions.

Contract and boundary impact

  • Semantic owner and earliest changed stage: scripts/lib/release-proposal.mjs, argument preparation for git apply in applyReleasePleasePatch.
  • Contribution scope fit and linked maintainer decision: not applicable (ordinary fix within existing tooling boundary).
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: enables source checkouts and npm ci to succeed on Windows without disabling Git NTFS path protection.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: existing regression test it("applies the exact dependency patch idempotently and rejects another version") in tests/boundary/filesystem/releaseProposal.test.ts exercises applyReleasePleasePatch().
  • Base reproduction or other evidence: reported and reproduced on Windows in #7050 (error: invalid path 'node_modules\release-please/build/src/github.js'). Confirmed from source reading that Git --directory path prefix joining requires POSIX forward slashes.
  • User-visible CLI/MCP output (if applicable): not applicable.
  • Remaining proof gaps: verification on a physical Windows host is delegated to CI (windows-curated).

For boundary fixes, identify the applicable boundary regressions and lifecycle regressions covered by the evidence above, and explain relevant gaps.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Not an evidence-bearing change.

Validation performed

  • No commands were run locally. The repository CI on this PR is the executed validation; its results are the checks on this PR.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: Windows source installation fix.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: avoids requiring users to disable core.protectNTFS.

Author readiness

Human owner: @viniciusdsandrade

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/7055 **Author:** [@viniciusdsandrade](https://github.com/viniciusdsandrade) **Created:** 10/25/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/7050-release-please-patch-directory-separator` --- ### 📝 Commits (1) - [`81925f8`](https://github.com/morluto/rea/commit/81925f8b7bf372cf6ab384b9f35367f3f389c725) fix(build): normalize release dependency patch directory for git apply ### 📊 Changes **1 file changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `scripts/lib/release-proposal.mjs` (+5 -1) </details> ### 📄 Description ## Summary `applyReleasePleasePatch` passed `relative(project, directory)` directly to `git apply --directory`. On Windows hosts with Git default `core.protectNTFS`, `relative()` produces backslashes (for example `node_modules\release-please`), which Git rejects as an invalid path component with exit code 128. This caused `check()` to rethrow instead of detecting whether the patch is already applied, causing `scripts/prepare.mjs` and `npm ci` to fail immediately. Normalizing the relative directory path to forward slashes allows Git to prepend `--directory` cleanly across platforms. Fixes #7050 ## Problem and expected behavior Smallest trigger: run `npm ci` on Windows from a source checkout, or run `node -e "import('./scripts/lib/release-proposal.mjs').then(m => m.applyReleasePleasePatch())"`. Observed before this change: `relative(project, directory)` yields `node_modules\release-please`. `git apply --check` exits with code 128 (`error: invalid path 'node_modules\release-please/build/src/github.js'`). Because exit code 128 is not code 1, `check()` rethrows the failure, aborting `prepare` during dependency install. Expected behavior: the patch check runs cleanly and applies the patch (or detects it as already applied), completing `prepare` idempotently on Windows as it does on Linux and macOS. ## Change and scope - `scripts/lib/release-proposal.mjs`: normalize `relative(project, directory)` to forward slashes with `.replaceAll("\\", "/")` when constructing `--directory` arguments for `git apply`. Intentionally not included: changes to patch files, git config overrides, or build scripts. No speculative complexity was added. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). Unresolved scope, authority, side effects, or required verification block integration. Link the required maintainer scope decision for new providers or capabilities involving target execution, injection, mutation, or protection recovery; ordinary fixes within existing boundaries may state "not applicable". Draft PRs may leave the scope decision pending and the readiness and merge checklists unchecked. Maintainers can help resolve open questions. ## Contract and boundary impact - Semantic owner and earliest changed stage: `scripts/lib/release-proposal.mjs`, argument preparation for `git apply` in `applyReleasePleasePatch`. - Contribution scope fit and linked maintainer decision: not applicable (ordinary fix within existing tooling boundary). - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: enables source checkouts and `npm ci` to succeed on Windows without disabling Git NTFS path protection. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable. - Generated metadata (`docs/public/product-catalog.json`), package, or installation impact: none. Expected effects (check known effects; use documentation-only on its own). Unchecked items do not establish absence; leave uncertainties visible. - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - Tests added or updated: existing regression test `it("applies the exact dependency patch idempotently and rejects another version")` in `tests/boundary/filesystem/releaseProposal.test.ts` exercises `applyReleasePleasePatch()`. - Base reproduction or other evidence: reported and reproduced on Windows in #7050 (`error: invalid path 'node_modules\release-please/build/src/github.js'`). Confirmed from source reading that Git `--directory` path prefix joining requires POSIX forward slashes. - User-visible CLI/MCP output (if applicable): not applicable. - Remaining proof gaps: verification on a physical Windows host is delegated to CI (`windows-curated`). For boundary fixes, identify the applicable boundary regressions and lifecycle regressions covered by the evidence above, and explain relevant gaps. For evidence-bearing changes: - [ ] Observed, derived, and inferred claims remain distinguishable. - [ ] Artifact identity, source provenance, and failed attempts remain preserved. - [ ] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. Not an evidence-bearing change. ## Validation performed - No commands were run locally. The repository CI on this PR is the executed validation; its results are the checks on this PR. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: Windows source installation fix. - Package or release metadata impact: none. - Security, privacy, process, or containment review: avoids requiring users to disable `core.protectNTFS`. ## Author readiness Human owner: @viniciusdsandrade - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 13:39:05 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#7608
No description provided.